[tuxdroid-svn] r4718 - in software_suite_v3/smart-core/smart-api/python/trunk: . tuxisalive/api tu
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-06-01 10:27:45
|
Author: remi
Date: 2009-06-01 12:27:36 +0200 (Mon, 01 Jun 2009)
New Revision: 4718
Removed:
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/attitunes/
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/gadgets/
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/scheduler/
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Framework.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/User.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstAttitunes.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstFramework.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstScheduler.py
Modified:
software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi
software_suite_v3/smart-core/smart-api/python/trunk/setup.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/TuxAPI.py
software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/version.py
Log:
* removed all libraries and interfaces to gadgets framework/attitunes manager/scheduler. (Will be rewritten in the future)
* bumped to 0.4.0
Modified: software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi 2009-06-01 10:27:36 UTC (rev 4718)
@@ -4,7 +4,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Smart API for python"
-!define PRODUCT_VERSION "0.3.0"
+!define PRODUCT_VERSION "0.4.0"
; Output names
!define FINAL_INSTALLER_EXE "pySmartAPIInstaller_${PRODUCT_VERSION}.exe"
Modified: software_suite_v3/smart-core/smart-api/python/trunk/setup.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/setup.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/setup.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -41,10 +41,6 @@
'tuxisalive.api.base',
'tuxisalive.api.base.const',
'tuxisalive.api.base.lib',
- 'tuxisalive.api.gadgets',
- 'tuxisalive.api.attitunes',
- 'tuxisalive.api.scheduler',
- 'tuxisalive.api.scheduler.const',
'tuxisalive.api.tuxdroid',
'tuxisalive.api.tuxdroid.const',
]
@@ -53,7 +49,7 @@
# Install the package
#
setup(name = 'tuxapi',
- version = '0.3.0',
+ version = '0.4.0',
description = 'Python API for Tuxdroid',
author = 'Remi Jocaille',
author_email = 'rem...@c2...',
Modified: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/TuxAPI.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/TuxAPI.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/TuxAPI.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -16,9 +16,6 @@
from base.ApiBase import *
from tuxdroid.const.ConstTuxDriver import *
from tuxdroid.const.ConstTuxOsl import *
-from tuxdroid.const.ConstFramework import *
-from tuxdroid.const.ConstAttitunes import *
-from tuxdroid.const.ConstScheduler import *
from tuxdroid.MouthEyes import MouthEyes
from tuxdroid.TTS import TTS
from tuxdroid.Wav import Wav
@@ -30,13 +27,9 @@
from tuxdroid.Button import Button
from tuxdroid.Flippers import Flippers
from tuxdroid.Spinning import Spinning
-from tuxdroid.Framework import Framework
from tuxdroid.Light import Light
from tuxdroid.Battery import Battery
from tuxdroid.Charger import Charger
-from tuxdroid.AttituneManager import AttituneManager
-from tuxdroid.Scheduler import Scheduler
-from tuxdroid.User import User
# ------------------------------------------------------------------------------
# Tux Droid API.
@@ -58,8 +51,6 @@
self.getEventsHandler().insert(statusName)
for statusName in SW_NAME_OSL:
self.getEventsHandler().insert(statusName)
- for statusName in SW_NAME_FRAMEWORK:
- self.getEventsHandler().insert(statusName)
# Create the mouth object
self.mouth = MouthEyes(self, self.server, ST_NAME_MOUTH_POSITION,
ST_NAME_MOUTH_RM, "mouth")
@@ -94,43 +85,9 @@
self.battery = Battery(self, self.server)
# Create the charger object
self.charger = Charger(self, self.server)
- # Create the framework object
- self.framework = Framework(self, self.server)
- # Create the attitune manager object
- 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
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
- # Scheduler bindings
- self.showTasks = self.scheduler.getTasksContainer().showTasks
- self.getTask = self.scheduler.getTasksContainer().getTask
- # User method bind
- def userWaitLoaded():
- ret = self.framework.waitLoaded(5.0, 0.0)
- if not ret:
- return False
- ret = self.attitunes.waitLoaded(5.0, 0.0)
- if not ret:
- return False
- return self.scheduler.waitLoaded(5.0, 1.0)
- self.user.waitLoaded = userWaitLoaded
-
# --------------------------------------------------------------------------
# Get the version of this API.
# --------------------------------------------------------------------------
Deleted: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -1,78 +0,0 @@
-# Copyright (C) 2009 C2ME Sa
-# Remi Jocaille <rem...@c2...>
-# Distributed under the terms of the GNU General Public License
-# http://www.gnu.org/copyleft/gpl.html
-
-import os
-import time
-
-from const.ConstAttitunes import *
-from tuxisalive.api.attitunes.AttitunesContainer import AttitunesContainer
-from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
-
-
-# ------------------------------------------------------------------------------
-# Class to control the attitune manager.
-# ------------------------------------------------------------------------------
-class AttituneManager(ApiBaseChildResource):
- """Class to control the attitune manager.
- """
-
- # --------------------------------------------------------------------------
- # 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)
- for statusName in SW_NAME_ATTITUNE_MANAGER:
- self._insertNewEvent(statusName)
- self.__attitunesContainer = AttitunesContainer(apiBase, apiBaseServer, {})
- self._registerEvent(ST_NAME_AM_CONTAINER_DEPLOYED, None,
- self.__updateAttitunesContainer)
-
- # --------------------------------------------------------------------------
- # Get the attitunes container.
- # --------------------------------------------------------------------------
- def getAttitunesContainer(self):
- """Get the attitunes container.
- @return: The attitunes container.
- """
- return self.__attitunesContainer
-
- # --------------------------------------------------------------------------
- # Get if the attitune manager is started or not.
- # --------------------------------------------------------------------------
- def isStarted(self):
- """Get if the attitune manager is started or not.
- @return: True or False:
- """
- ret = self._requestOne(ST_NAME_AM_RUN)
- if ret == "True":
- return True
- else:
- return False
-
- # --------------------------------------------------------------------------
- # Update attitunes list on container deloyed event.
- # --------------------------------------------------------------------------
- def __updateAttitunesContainer(self, *args):
- cmd = "attitune_manager/attitunes_infos?"
- ret, result = self._sendCommandFullResultEx(cmd)
- if ret:
- self.__attitunesContainer._update(result)
-
- # --------------------------------------------------------------------------
- # Wait that the attitunes was loaded.
- # --------------------------------------------------------------------------
- def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
- """Wait that the attitunes was loaded.
- @param timeout: Maximal time to wait.
- @return: True or False.
- """
- ret = self._waitFor(ST_NAME_AM_CONTAINER_DEPLOYED, "True", timeout)
- if ret:
- time.sleep(absDelay)
- return ret
Deleted: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Framework.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Framework.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Framework.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -1,90 +0,0 @@
-# -*- coding: latin1 -*-
-
-# Copyright (C) 2009 C2ME Sa
-# Remi Jocaille <rem...@c2...>
-# Distributed under the terms of the GNU General Public License
-# http://www.gnu.org/copyleft/gpl.html
-
-import os
-import time
-
-from const.ConstFramework import *
-from tuxisalive.api.gadgets.GadgetsContainer import GadgetsContainer
-from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
-
-# ------------------------------------------------------------------------------
-# Class to control the gadgets framework.
-# ------------------------------------------------------------------------------
-class Framework(ApiBaseChildResource):
- """Class to control the gadgets framework.
- """
-
- # --------------------------------------------------------------------------
- # 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)
- for statusName in SW_NAME_FRAMEWORK:
- self._insertNewEvent(statusName)
- self.__gadgetsContainer = GadgetsContainer(apiBase, apiBaseServer, {})
- self._registerEvent(ST_NAME_FW_CONTAINER_DEPLOYED, None,
- self.__updateGadgetsContainer)
- self._registerEvent(ST_NAME_FW_CONFIGURATIONS_LOADED, None,
- self.__updateGadgetsContainer)
-
- # --------------------------------------------------------------------------
- # Get the gadgets container.
- # --------------------------------------------------------------------------
- def getGadgetsContainer(self):
- """Get the gadgets container.
- @return: The gadgets container.
- """
- return self.__gadgetsContainer
-
- # --------------------------------------------------------------------------
- # Get if the framework is started or not.
- # --------------------------------------------------------------------------
- def isStarted(self):
- """Get if the framework is started or not.
- @return: True or False:
- """
- ret = self._requestOne(ST_NAME_FW_RUN)
- if ret == "True":
- return True
- else:
- return False
-
- # --------------------------------------------------------------------------
- # Update gadgets list on container deloyed event.
- # --------------------------------------------------------------------------
- def __updateGadgetsContainer(self, *args):
- cmd = "gadget_framework/gadgets_infos?"
- ret, result = self._sendCommandFullResultEx(cmd)
- if ret:
- gadgetsStruct = {}
- sAddress = self.getParent().server.getAddress()
- for key in result.keys():
- if key.find("data") == 0:
- result[key]['description']['icon_file'] = "%s%s" % (sAddress,
- result[key]['description']['icon_file'])
- result[key]['description']['help_file'] = "%s%s" % (sAddress,
- result[key]['description']['help_file'])
- gadgetsStruct[key] = result[key]
- self.__gadgetsContainer._update(gadgetsStruct)
-
- # --------------------------------------------------------------------------
- # Wait that the gadgets was loaded.
- # --------------------------------------------------------------------------
- def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
- """Wait that the gadgets was loaded.
- @param timeout: Maximal time to wait.
- @return: True or False.
- """
- ret = self._waitFor(ST_NAME_FW_CONFIGURATIONS_LOADED, "True", timeout)
- if ret:
- time.sleep(absDelay)
- return ret
Deleted: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -1,78 +0,0 @@
-# Copyright (C) 2009 C2ME Sa
-# Remi Jocaille <rem...@c2...>
-# Distributed under the terms of the GNU General Public License
-# http://www.gnu.org/copyleft/gpl.html
-
-import time
-
-from const.ConstScheduler import *
-from tuxisalive.api.scheduler.TasksContainer import TasksContainer
-from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
-
-# ------------------------------------------------------------------------------
-# Class to control the scheduler.
-# ------------------------------------------------------------------------------
-class Scheduler(ApiBaseChildResource):
- """Class to control the scheduler.
- """
-
- # --------------------------------------------------------------------------
- # 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)
- for statusName in SW_NAME_SCHEDULER_MANAGER:
- self._insertNewEvent(statusName)
- self.__tasksContainer = TasksContainer(apiBase, apiBaseServer, {})
- self._registerEvent(ST_NAME_SCM_TASKS_LOADED, None,
- self.__updateTasksContainer)
- self._registerEvent(ST_NAME_SCM_TASKS_UNLOADED, None,
- self.__updateTasksContainer)
-
- # --------------------------------------------------------------------------
- # Get the tasks container.
- # --------------------------------------------------------------------------
- def getTasksContainer(self):
- """Get the tasks container.
- @return: The tasks container.
- """
- return self.__tasksContainer
-
- # --------------------------------------------------------------------------
- # Get if the scheduler is started or not.
- # --------------------------------------------------------------------------
- def isStarted(self):
- """Get if the scheduler is started or not.
- @return: True or False:
- """
- ret = self._requestOne(ST_NAME_SCM_RUN)
- if ret == "True":
- return True
- else:
- return False
-
- # --------------------------------------------------------------------------
- # Update tasks list on task added/removed events.
- # --------------------------------------------------------------------------
- def __updateTasksContainer(self, *args):
- cmd = "scheduler/tasks_infos?"
- ret, result = self._sendCommandFullResultEx(cmd)
- if ret:
- self.__tasksContainer._update(result)
-
- # --------------------------------------------------------------------------
- # Wait that the tasks was loaded.
- # --------------------------------------------------------------------------
- def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
- """Wait that the tasks was loaded.
- @param timeout: Maximal time to wait.
- @return: True or False.
- """
- ret = self._waitFor(ST_NAME_SCM_TASKS_LOADED, "True", timeout)
- if ret:
- time.sleep(absDelay)
- return ret
Deleted: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/User.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/User.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/User.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -1,41 +0,0 @@
-# Copyright (C) 2009 C2ME Sa
-# Remi Jocaille <rem...@c2...>
-# 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)
Deleted: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstAttitunes.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstAttitunes.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstAttitunes.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -1,18 +0,0 @@
-# Copyright (C) 2009 C2ME Sa
-# Remi Jocaille <rem...@c2...>
-# Distributed under the terms of the GNU General Public License
-# http://www.gnu.org/copyleft/gpl.html
-
-#
-# Statuses declaration
-#
-ST_NAME_AM_RUN = "attitune_manager_run"
-ST_NAME_AM_CONTAINER_DEPLOYED = "attitune_manager_container_deployed"
-ST_NAME_AM_ATTITUNE_STARTING = "attitune_manager_attitune_starting"
-ST_NAME_AM_ATTITUNE_STOPPED = "attitune_manager_attitune_stopped"
-SW_NAME_ATTITUNE_MANAGER = [
- ST_NAME_AM_RUN,
- ST_NAME_AM_CONTAINER_DEPLOYED,
- ST_NAME_AM_ATTITUNE_STARTING,
- ST_NAME_AM_ATTITUNE_STOPPED,
-]
Deleted: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstFramework.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstFramework.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstFramework.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -1,22 +0,0 @@
-# Copyright (C) 2009 C2ME Sa
-# Remi Jocaille <rem...@c2...>
-# Distributed under the terms of the GNU General Public License
-# http://www.gnu.org/copyleft/gpl.html
-
-#
-# Statuses declaration
-#
-ST_NAME_FW_RUN = "framework_run"
-ST_NAME_FW_CONTAINER_DEPLOYED = "framework_container_deployed"
-ST_NAME_FW_GADGET_STARTING = "framework_gadget_starting"
-ST_NAME_FW_GADGET_STOPPED = "framework_gadget_stopped"
-ST_NAME_FW_CONFIGURATIONS_LOADED = "framework_configurations_loaded"
-ST_NAME_FW_CONFIGURATIONS_UNLOADED = "framework_configurations_unloaded"
-SW_NAME_FRAMEWORK = [
- ST_NAME_FW_RUN,
- ST_NAME_FW_CONTAINER_DEPLOYED,
- ST_NAME_FW_GADGET_STARTING,
- ST_NAME_FW_GADGET_STOPPED,
- ST_NAME_FW_CONFIGURATIONS_LOADED,
- ST_NAME_FW_CONFIGURATIONS_UNLOADED,
-]
Deleted: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstScheduler.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstScheduler.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/tuxdroid/const/ConstScheduler.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -1,16 +0,0 @@
-# Copyright (C) 2009 C2ME Sa
-# Remi Jocaille <rem...@c2...>
-# Distributed under the terms of the GNU General Public License
-# http://www.gnu.org/copyleft/gpl.html
-
-#
-# Scheduler manager events/statuses
-#
-ST_NAME_SCM_RUN = "scheduler_manager_run"
-ST_NAME_SCM_TASKS_LOADED = "scheduler_manager_tasks_loaded"
-ST_NAME_SCM_TASKS_UNLOADED = "scheduler_manager_tasks_unloaded"
-SW_NAME_SCHEDULER_MANAGER = [
- ST_NAME_SCM_RUN,
- ST_NAME_SCM_TASKS_LOADED,
- ST_NAME_SCM_TASKS_UNLOADED,
-]
Modified: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/version.py
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/version.py 2009-06-01 10:11:08 UTC (rev 4717)
+++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/version.py 2009-06-01 10:27:36 UTC (rev 4718)
@@ -7,5 +7,5 @@
author = "Remi Jocaille (rem...@c2...)"
date = "2009"
-version = '0.3.0'
+version = '0.4.0'
licence = "GPL"
|