Commits

Benoît Allard  committed b287133

improve display, make unimportant message take less place

  • Participants
  • Parent commits aa6cbab

Comments (0)

Files changed (2)

File python/antprotocol/connection.py

-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]:
         if conn.open():
-            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

File python/antprotocol/protocol.py

 # Added to and untwistedized and fixed up by Kyle Machulis <kyle@nonpolynomial.com>
 #
 
-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(), '.')
             try:
                 msg = self._receive_message()
             except NoMessageException:
                continue
             if msg.id == 0x4E:
-                print "Got it."
+                os.write(sys.stdout.fileno(), '!')
                 return
         raise FitBitBeaconTimeout("Timeout waiting for beacon, will restart")