[Specto-devel] the main watch class
Brought to you by:
kiddokiddo
|
From: wout c. <wou...@sc...> - 2006-02-07 19:27:48
|
It's time that we start thinking about the main functionalities from the
watch class
so we can actually start working on it.
a main watch has a:
-unique name
-interval timer / watch (time between updates)
-...?
the specific options for a type of watch are set in the subclass.
the main watch class has a function for:
-returning a message when a watch is updated
-setting/getting a name for a watch
-setting/getting the interval period
-calling the subclass when the watch has to be checked for updates
-...?
so it would look something like this (in pseudo):
/if timer == interval
call subclass
(subclass
check_update
if updated:
return updated = True
else:
return updated = False
end subclass)
if updated == True:
return "Watch updated"/
This doesn't look difficult, does it?
some questions about the code that is allready in watch.py:
/ def __init__(self, refresh= float(5.0)):
self.refresh_ = refresh
self.timer = Timer(float(0.1), self.update)
self.timer.start()/
what is "self.update"? is it the interval between updates for a watch?
and why would you use refresh = float(5.0), isn't that something the
user has to set?
And when i wan't to create an object from the module i get this error:
/>>> import specto.watch
>>> t = specto.watch()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'module' object is not callable
>>>
/How can we solve this?
these are my thoughts about the main watch class, feel free to change it!
Wout
|