Author: remi
Date: 2009-04-07 19:05:16 +0200 (Tue, 07 Apr 2009)
New Revision: 4406
Added:
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/tuxdroid/User.py
Modified:
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/TuxAPI.py
Log:
* added a class to manages the user configurations
>>> tux.user.setDirectory("/home/<user name>/MyTux")
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-04-07 16:52:34 UTC (rev 4405)
+++
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/TuxAPI.py
2009-04-07 17:05:16 UTC (rev 4406)
@@ -36,6 +36,7 @@
from tuxdroid.Charger import Charger
from tuxdroid.AttituneManager import AttituneManager
from tuxdroid.Scheduler import Scheduler
+from tuxdroid.User import User
#
------------------------------------------------------------------------------
# Tux Droid API.
@@ -99,6 +100,8 @@
self.attitunes = AttituneManager(self, self.server)
# Create the scheduler object
self.scheduler = Scheduler(self, self.server)
+ # Create the user object
+ self.user = User(self, self.server)
# Bind some methods
self.__bindSomeMethods()
# Initialize the helper
Added:
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/tuxdroid/User.py
===================================================================
---
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/tuxdroid/User.py
(rev 0)
+++
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/tuxdroid/User.py
2009-04-07 17:05:16 UTC (rev 4406)
@@ -0,0 +1,41 @@
+# Copyright (C) 2009 C2ME Sa
+# Remi Jocaille <[email protected]>
+# Distributed under the terms of the GNU General Public License
+# http://www.gnu.org/copyleft/gpl.html
+
+import os
+
+from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
+
+#
------------------------------------------------------------------------------
+# Class to manages the user configurations.
+#
------------------------------------------------------------------------------
+class User(ApiBaseChildResource):
+ """Class to manages the user configurations.
+ """
+
+ #
--------------------------------------------------------------------------
+ # Constructor of the class.
+ #
--------------------------------------------------------------------------
+ def __init__(self, apiBase, apiBaseServer):
+ """Constructor of the class.
+ @param apiBase: ApiBase parent object.
+ @param apiBaseServer: ApiBaseServer object.
+ """
+ ApiBaseChildResource.__init__(self, apiBase, apiBaseServer)
+
+ #
--------------------------------------------------------------------------
+ # Load the configurations from an user directory.
+ #
--------------------------------------------------------------------------
+ def setDirectory(self, userDirectory = None):
+ """Load the configurations from an user directory.
+ @userDirectory: User directory.
+ @return: True or False.
+ """
+ if userDirectory == None:
+ userDirectory = os.path.join(os.path.expanduser("~"), "MyTux")
+ parameters = {
+ 'configuration_path' : userDirectory,
+ }
+ cmd = "user_configuration/set_user_directory?"
+ return self._sendCommandBooleanResult(cmd, parameters)
Property changes on:
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/tuxdroid/User.py
___________________________________________________________________
Name: svn:keywords
+ Id
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn