Benoît Allard avatar Benoît Allard committed b287133

improve display, make unimportant message take less place

Comments (0)

Files changed (2)


-import usb
+import usb, os, sys
 class ANTConnection(object):
     """ An abstract class that represents a connection """
 def getConn():
     for conn in [bc() for bc in CONNS]:
-            print "Found %s base" % (conn.NAME,)
+            os.write(sys.stdout.fileno(), "\n%s: " % conn.NAME)
             return conn
     print "Failed to find a base"
     return None


 # Added to and untwistedized and fixed up by Kyle Machulis <>
-import struct, array, time
+import struct, array, time, os, sys
 from message import MessageIN, MessageOUT
 class ANTException(Exception):
     def receive_bdcast(self):
         # FitBit device initialization
         for tries in range(60):
-            print "Waiting for beacon"
+            os.write(sys.stdout.fileno(), '.')
                 msg = self._receive_message()
             except NoMessageException:
             if == 0x4E:
-                print "Got it."
+                os.write(sys.stdout.fileno(), '!')
         raise FitBitBeaconTimeout("Timeout waiting for beacon, will restart")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.