diff options
Diffstat (limited to 'client/ivam-voicebox')
-rwxr-xr-x | client/ivam-voicebox | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/client/ivam-voicebox b/client/ivam-voicebox new file mode 100755 index 0000000..fc7b45a --- /dev/null +++ b/client/ivam-voicebox @@ -0,0 +1,48 @@ +#!/usr/bin/python + +import sys, os + +from ivamCore import log +import ivamCore, ivamVoiceBox + +def usage(self): + log("%s [--record-time=SECS] [--pin=PIN] [--pin-file=PINFILE] [--debug]", sys.argv[0]) + +def parseArgs(vb, argv): + + try: + opts, args = getopt.getopt(argv[1:], "ht:p:P:de:", ["help", "record-time=", "pin=", "pin-file=", "debug", "message"]) + except getopt.GetoptError: + usage() + sys.exit(1) + + vb.setDirectory(args[0]) + + for o, a in opts: + if o in ("-d", "--debug"): + DEBUG = True + + elif o in ("-h", "--help"): + usage() + sys.exit() + + elif o in ("-t", "--record-time"): + vb.recordTime = int(a) + + elif o in ("-p", "--pin"): + vb.setPin(a) + + elif o in ("-P", "--pin-file"): + vb.setPin(getContents(a)) + + elif o in ("-e", "--message"): + vb.messageProgram = a + +def main(): + vb = ivamVoiceBox.VoiceBox() + parseArgs(vb, sys.argv) + ivamCore.newConnector(vb).run() + sys.exit() + +if __name__ == "__main__": + main() |