MCPcopy Create free account
hub / github.com/ActiveState/code / painthms

Method painthms

recipes/Python/576830_analog_clock/recipe-576830.py:98–114  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 self.paintcircle(0,0)
97
98 def painthms(self):
99 T = datetime.timetuple(datetime.utcnow()-self.delta)
100 x,x,x,h,m,s,x,x,x = T
101 self.root.title('%02i:%02i:%02i' %(h,m,s))
102 angle = -pi/2 + (pi/6)*h + (pi/6)*(m/60.0)
103 x, y = cos(angle)*.60,sin(angle)*.60
104 scl = self.canvas.create_line
105 scl(apply(self.T.twopoints,[0,0,x,y]), fill = self.timecolor,
106 tag =self._ALL, width = 6)
107 angle = -pi/2 + (pi/30)*m + (pi/30)*(s/60.0)
108 x, y = cos(angle)*.80,sin(angle)*.80
109 scl(apply(self.T.twopoints,[0,0,x,y]), fill = self.timecolor,
110 tag =self._ALL, width = 3)
111 angle = -pi/2 + (pi/30)*s
112 x, y = cos(angle)*.95,sin(angle)*.95
113 scl(apply(self.T.twopoints, [0,0,x,y]), fill = self.timecolor,
114 tag =self._ALL, arrow = 'last')
115
116 def paintcircle(self,x,y):
117 ss = self.circlesize / 2.0

Callers 1

paintgraficsMethod · 0.95

Calls 4

cosFunction · 0.85
sinFunction · 0.85
applyFunction · 0.50
titleMethod · 0.45

Tested by

no test coverage detected