@@ -1044,34 +1044,24 @@ class itself will store the flag and the ``_on_timer`` method should be
10441044
10451045 - ``_on_timer``: The internal function that any timer object should call,
10461046 which will handle the task of running all callbacks that have been set.
1047-
1048- Attributes
1049- ----------
1050- interval : int, default: 1000ms
1051- The time between timer events in milliseconds.
1052- single_shot : bool, default: False
1053- Whether this timer should operate as single shot (run once and then
1054- stop).
1055- callbacks : List[Tuple[callable, Tuple, Dict]]
1056- Stores list of (func, args, kwargs) tuples that will be called upon
1057- timer events. This list can be manipulated directly, or the
1058- functions `add_callback` and `remove_callback` can be used.
10591047 """
10601048
10611049 def __init__ (self , interval = None , callbacks = None ):
1062- #Initialize empty callbacks list and setup default settings if necssary
1063- if callbacks is None :
1064- self .callbacks = []
1065- else :
1066- self .callbacks = callbacks .copy ()
1067-
1068- if interval is None :
1069- self ._interval = 1000
1070- else :
1071- self ._interval = interval
1072-
1050+ """
1051+ Parameters
1052+ ----------
1053+ interval : int, default: 1000ms
1054+ The time between timer events in milliseconds. Will be stored as
1055+ ``timer.interval``.
1056+ callbacks : List[Tuple[callable, Tuple, Dict]]
1057+ List of (func, args, kwargs) tuples that will be called upon
1058+ timer events. This list is accessible as ``timer.callbacks`` and
1059+ can be manipulated directly, or the functions `add_callback` and
1060+ `remove_callback` can be used.
1061+ """
1062+ self .callbacks = [] if callbacks is None else callbacks .copy ()
1063+ self ._interval = 1000 if interval is None else interval
10731064 self ._single = False
1074-
10751065 # Default attribute for holding the GUI-specific timer object
10761066 self ._timer = None
10771067
@@ -1105,6 +1095,7 @@ def _timer_stop(self):
11051095
11061096 @property
11071097 def interval (self ):
1098+ """The time between timer events, in milliseconds."""
11081099 return self ._interval
11091100
11101101 @interval .setter
@@ -1117,6 +1108,7 @@ def interval(self, interval):
11171108
11181109 @property
11191110 def single_shot (self ):
1111+ """Whether this timer should stop after a single run."""
11201112 return self ._single
11211113
11221114 @single_shot .setter
0 commit comments