[Sugar-devel] [RELEASE] Calculate 26
reinier at heeres.eu
Tue Dec 23 19:09:45 EST 2008
I just released a new version of Calculate. I know I missed the feature
freeze by about a week, but I was still quite busy finishing the code
Many things are improved, from NEWS with a bit more comment:
* Move to new equation parser based on python ast
Calculate now uses the internal python parser to create an Abstract Syntax
Tree (ast). The tree for an equation is evaluated by Calculate itself, so
that operators (mostly divide) can give different results from standard
python (e.g. return Rational numbers). The way functions, help and constants
are included is also much improved and easier to extend by modifying the
files functions.py and constants.py. Speed increase is about a factor 10,
especially noticeable when plotting. (It's also less code and easier to
* Refactor sharing
This is a major improvement and simplifcation. I recommend other activity
authors and sugar developers to have a look at shareable_activity.py. This
provides a class to easily create activities that can be shared (by
inheriting from ShareableActivity). It automatically sets-up a DBus tube and
a service to communicate between a shared instance. Communication is exposed
by the function send_message('message_name', param1=1, param2=2, ...) that
can be processed on the other end through a registered callback or by
overloading the function message_received(). I think this could really be
sufficient for most Activities.
I tested on 767 but it is also compatible with newer api. This could also be
a good reason to use shareable_activity.py: keep sugar-sharing-api-version
voodoo out of the main activity code and keep it more readable. It could
result in less overall duplicate code (a good thing!).
* Refactored equation drawing code
Adding an equation was slow due to the whole list being regenerated. This is
not the case anymore.
* Add languages: bi, cs, en_US, fi, he, hu, sk, sv, sw, wa
This is a development release and I expect a few bugs; if you find any,
please report them. Testing is appreciated!
I'm aware that I probably should move this code over to sugarlabs; however,
I think I don't have access there yet. Marco, Tomeu, Simon, Bernie, any
2515 XK Den Haag
Tel: +31 6 10852639
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Sugar-devel