Author: remi
Date: 2009-03-28 11:30:05 +0100 (Sat, 28 Mar 2009)
New Revision: 4232
Modified:
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/TuxAPI.py
Log:
* added some method alias in order to make more usefull gadgets and attitunes
functionalities.
>>> tux.showGadgets()
>>> ...
>>> gadget = tux.getGadget(5)
or
>>> gadget = tux.getGadget("Weather Gadget")
>>> gadget.start()
Modified:
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/TuxAPI.py
===================================================================
---
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/TuxAPI.py
2009-03-28 10:21:00 UTC (rev 4231)
+++
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/TuxAPI.py
2009-03-28 10:30:05 UTC (rev 4232)
@@ -95,9 +95,22 @@
self.framework = Framework(self, self.server)
# Create the attitune manager object
self.attitunes = AttituneManager(self, self.server)
+ # Bind some methods
+ self.__bindSomeMethods()
# Initialize the helper
Helper.__init__(self)
+ def __bindSomeMethods(self):
+ """Bind some methods in order to make more usefull some
+ functionalities.
+ """
+ # Gadget framework bindings
+ self.showGadgets = self.framework.getGadgetsContainer().showGadgets
+ self.getGadget = self.framework.getGadgetsContainer().getGadget
+ # Attitune manager bindings
+ self.showAttitunes =
self.attitunes.getAttitunesContainer().showAttitunes
+ self.getAttitune = self.attitunes.getAttitunesContainer().getAttitune
+
#
--------------------------------------------------------------------------
# Get the version of this API.
#
--------------------------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn