(self,root,deltahours = 0)
| 53 | class clock: |
| 54 | |
| 55 | def __init__(self,root,deltahours = 0): |
| 56 | self.world = [-1,-1,1,1] |
| 57 | self.bgcolor = '#000000' |
| 58 | self.circlecolor = '#808080' |
| 59 | self.timecolor = '#ffffff' |
| 60 | self.circlesize = 0.09 |
| 61 | self._ALL = 'all' |
| 62 | self.pad = 25 |
| 63 | self.root = root |
| 64 | self.togstate = 0 |
| 65 | self.firstrun = 1 |
| 66 | self.oldtime = datetime.strptime("01","%d") |
| 67 | self.newtime = datetime.strptime("01","%d") |
| 68 | self.ootime = datetime.strptime("01","%d") |
| 69 | self.ontime = datetime.strptime("01","%d") |
| 70 | self.tdelta = timedelta(0) |
| 71 | WIDTH, HEIGHT = 400, 400 |
| 72 | root.bind("<Escape>", lambda _ : root.destroy()) |
| 73 | root.bind("<Button-1>", lambda _ : self.stopstartpoll()) |
| 74 | self.delta = timedelta(hours = deltahours) |
| 75 | self.canvas = Canvas(root, |
| 76 | width = WIDTH, |
| 77 | height = HEIGHT, |
| 78 | background = self.bgcolor) |
| 79 | viewport = (self.pad,self.pad,WIDTH-self.pad,HEIGHT-self.pad) |
| 80 | self.T = transformer(self.world,viewport) |
| 81 | self.root.title('Clock') |
| 82 | self.canvas.bind("<Configure>",self.configure()) |
| 83 | self.canvas.pack(fill=BOTH, expand=YES) |
| 84 | self.poll() |
| 85 | |
| 86 | def stopstartpoll(self): |
| 87 | if self.togstate == 0: |
nothing calls this directly
no test coverage detected