comparison engine/python/fife/extensions/fife_timer.py @ 494:e241d7553496

Fixing the epydoc markup. Did some more commenting.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 10 May 2010 15:54:21 +0000
parents 16ceb3228324
children ae9f5383f5b1
comparison
equal deleted inserted replaced
493:e29853880e87 494:e241d7553496
60 This class wraps the fife.TimeEvent class to make it easily usable from Python 60 This class wraps the fife.TimeEvent class to make it easily usable from Python
61 It allows for a TimeEvent to be executed once or multiple times. 61 It allows for a TimeEvent to be executed once or multiple times.
62 """ 62 """
63 def __init__(self,delay=0,callback=None,repeat=0): 63 def __init__(self,delay=0,callback=None,repeat=0):
64 """ 64 """
65 @param delay The delay in milliseconds to execute the callback 65 @param delay: The delay in milliseconds to execute the callback
66 @param callback The function to execute 66 @param callback: The function to execute
67 @param repeat The number of times to execute the callback. 1=once, 0=forever 67 @param repeat: The number of times to execute the callback. 1=once, 0=forever
68 """ 68 """
69 super(Timer,self).__init__(delay) 69 super(Timer,self).__init__(delay)
70 self._is_registered = False 70 self._is_registered = False
71 self._callback = callback 71 self._callback = callback
72 self._manager = _manager 72 self._manager = _manager
114 114
115 def delayCall(delay,callback): 115 def delayCall(delay,callback):
116 """ 116 """
117 Delay a function call by a number of milliseconds. 117 Delay a function call by a number of milliseconds.
118 118
119 @param delay Delay in milliseconds. 119 @param delay: Delay in milliseconds.
120 @param callback The function to call. 120 @param callback: The function to call.
121 121
122 @return The timer. 122 @return The timer.
123 @rtype: L{Timer}
123 """ 124 """
124 timer = Timer(delay, callback, 1) 125 timer = Timer(delay, callback, 1)
125 timer.start() 126 timer.start()
126 return timer 127 return timer
127 128
128 129
129 def repeatCall(period,callback): 130 def repeatCall(period,callback):
130 """ 131 """
131 Repeat a function call. 132 Repeat a function call.
132 133
133 @param period Period between calls in milliseconds. 134 @param period: Period between calls in milliseconds.
134 @param callback The function to call. 135 @param callback: The function to call.
135 136
136 @return The timer. 137 @return: The timer.
138 @rtype: L{Timer}
137 139
138 The call is repeated until the timer is stopped. 140 The call is repeated until the timer is stopped.
139 """ 141 """
140 timer = Timer(period, callback, 0) 142 timer = Timer(period, callback, 0)
141 timer.start() 143 timer.start()