slotUI/freeslot.py

changeset 77
cede78304992
parent 57
c2e2695c92fe
child 86
79fb119cf3c3
equal deleted inserted replaced
76:1c8305764b3f 77:cede78304992
8 # how often should a command retried when busy? 8 # how often should a command retried when busy?
9 RETRIES = 10 9 RETRIES = 10
10 10
11 # define loglevels 11 # define loglevels
12 DEBUG = 20 12 DEBUG = 20
13 LOGLEVEL = 20
13 def log(level, msg): 14 def log(level, msg):
14 """ 15 """
15 Logging output function 16 Logging output function
16 """ 17 """
17 print msg 18 if level <= LOGLEVEL: print msg
18 19
19 class SerialCommunicator(): 20 class SerialCommunicator():
20 def __init__(self, device, speed): 21 def __init__(self, device, speed):
21 self.device = device 22 self.device = device
22 self.speed = speed 23 self.speed = speed

mercurial