summaryrefslogtreecommitdiffstats
path: root/client/ivam-voicebox
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-01-05 22:26:34 +0000
committerLennart Poettering <lennart@poettering.net>2004-01-05 22:26:34 +0000
commit444b524c3a26d8dd83fae2a074d3d13b10ba17f7 (patch)
treee2f5d69324b7383f735fc3f350fa5a10ccaba6bc /client/ivam-voicebox
parentd24a3f265ec4344b5502ec57df3cf8358f6f1499 (diff)
forgot some files
preliminary client implementation git-svn-id: file:///home/lennart/svn/public/ivam2/trunk@15 dbf6933d-3bce-0310-9bcc-ed052ba35b35
Diffstat (limited to 'client/ivam-voicebox')
-rwxr-xr-xclient/ivam-voicebox48
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()