added dev parameter

Sun, 28 Oct 2012 18:04:38 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Sun, 28 Oct 2012 18:04:38 +0100
changeset 106
11fabe1f7c40
parent 105
1defce561e64
child 107
efdf471642f5

added dev parameter

slotUI/SlotCli.py file | annotate | diff | comparison | revisions
--- a/slotUI/SlotCli.py	Sun Oct 28 17:57:54 2012 +0100
+++ b/slotUI/SlotCli.py	Sun Oct 28 18:04:38 2012 +0100
@@ -50,10 +50,10 @@
         #Popen(["/usr/bin/mpg123", SOUNDS[what]]).pid
 
 class SlotCli():
-    def __init__(self, test = None):
+    def __init__(self, test = None, dev=""):
         self.box = Blackbox()
         if not test:
-            self.box.connect()
+            self.box.connect(dev)
         self.slot_dummy = {
             "name": "Unnamed",
             "laps": 0,
@@ -564,9 +564,13 @@
         help="Controlled SPEED MINIMUM (0 = disabled)", metavar="[0-15]")
     parser.add_option("--test", dest="test", action="store_true", default=False,
         help="", metavar="")
+    parser.add_option("--dev", dest="dev", default="/dev/ttyUSB0",
+        help="Communication port", metavar="[/dev/ttyUSB0]")
 
     (options, args) = parser.parse_args()
-    cli = SlotCli(options.test)
+    #if not options.dev:
+    #    options.dev = "/dev/ttyUSB0"
+    cli = SlotCli(options.test, options.dev)
     # should a CLI function be started?
 
     if options.live:

mercurial