Browse Source

more changes to allow some testing

kmpm 8 years ago
parent
commit
494bb9a58b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      lib/uploader.py

+ 5 - 2
lib/uploader.py

@@ -25,7 +25,10 @@ class Uploader(object):
 
     def __init__(self, port=PORT, baud=BAUD):
         log.info('opening port %s', port)
-        self._port = serial.Serial(port, Uploader.BAUD, timeout=Uploader.TIMEOUT)
+        if port == 'loop://':
+            self._port = serial.serial_for_url(port, baud, timeout=Uploader.TIMEOUT)
+        else:
+            self._port = serial.Serial(port, baud, timeout=Uploader.TIMEOUT)
 
         # Keeps things working, if following conections are made:
         ## RTS = CH_PD (i.e reset)
@@ -52,7 +55,7 @@ class Uploader(object):
             sync()
 
         self.line_number = 0
-    
+
     def set_baudrate(self, baud):
         try:
             self._port.setBaudrate(baud)