Author: remi
Date: 2009-05-05 16:12:57 +0200 (Tue, 05 May 2009)
New Revision: 4638

Modified:
   
software_suite_v3/smart-core/smart-server/trunk/resources/01_robot_system/resourcePluginsServer.py
   
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
   
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py
Log:
* updated plugin extension name from TPG to SCP (Smart-Core Plugin)
* updated plugin logs to be showed in the console (useful for the 
implementation of the plugin/gadget system)

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/01_robot_system/resourcePluginsServer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/01_robot_system/resourcePluginsServer.py
  2009-05-05 13:59:27 UTC (rev 4637)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/01_robot_system/resourcePluginsServer.py
  2009-05-05 14:12:57 UTC (rev 4638)
@@ -66,7 +66,7 @@
         self.logger = SimpleLogger("plugins_server")
         self.logger.resetLog()
         self.logger.setLevel(LOG_LEVEL_DEBUG)
-        self.logger.setTarget(LOG_TARGET_FILE)
+        self.logger.setTarget(LOG_TARGET_BOTH)
         self.logger.logInfo("-----------------------------------------------")
         self.logger.logInfo("Smart-core Plugins Server")
         self.logger.logInfo("Licence : GPL")
@@ -249,11 +249,11 @@
         """
         return self.__pluginsContainer
 
-    def insertPluginInContainer(self, tpgFilename):
+    def insertPluginInContainer(self, scpFilename):
         """Insert a plugin in the plugins server container.
-        @param tpgFilename: TPG plugin file name.
+        @param scpFilename: SCP plugin file name.
         @return: The success.
-        - tpgFilename can be a local file or an external file (URL)
+        - scpFilename can be a local file or an external file (URL)
         - After the success of the plugin insertion the plugins server will
           detected it.
         """
@@ -266,10 +266,10 @@
             return False
         directory = directories[-1]
         # Check the file extension
-        if tpgFilename.lower().rfind(".tpg") == -1:
+        if scpFilename.lower().rfind(".scp") == -1:
             return False
         # Create a cached file with the plugin file
-        cFile = filesCacheManager.createFileCache(tpgFilename)
+        cFile = filesCacheManager.createFileCache(scpFilename)
         # If the plugin can't be cached then FAIL
         if cFile == None:
             return False
@@ -277,9 +277,9 @@
         result = True
         import shutil
         try:
-            tpgName = os.path.split(tpgFilename)[-1]
-            tpgName = os.path.join(directory, tpgName)
-            shutil.copy(cFile.getOutputFilePath(), tpgName)
+            scpName = os.path.split(scpFilename)[-1]
+            scpName = os.path.join(directory, scpName)
+            shutil.copy(cFile.getOutputFilePath(), scpName)
         except:
             result = False
         filesCacheManager.destroyFileCache(cFile)
@@ -295,9 +295,9 @@
             return False
         for plugin in self.__pluginsContainer.getPlugins():
             if plugin.getDescription().getUuid() == pluginUuid:
-                tpgFile = plugin.getTpgFile()
-                # Remove the tpg file
-                DirectoriesAndFilesTools.RMFile(tpgFile)
+                scpFile = plugin.getScpFile()
+                # Remove the scp file
+                DirectoriesAndFilesTools.RMFile(scpFile)
                 return True
         return False
 

Modified: 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
     2009-05-05 13:59:27 UTC (rev 4637)
+++ 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
     2009-05-05 14:12:57 UTC (rev 4638)
@@ -34,11 +34,11 @@
     # 
--------------------------------------------------------------------------
     # Constructor of the class.
     # 
--------------------------------------------------------------------------
-    def __init__(self, parent, dictionary, tpgFile, workingPath):
+    def __init__(self, parent, dictionary, scpFile, workingPath):
         """Constructor of the class.
         @param parent: Parent Plugins container.
         @param dictionary: Plugin structure as dictionary.
-        @param tpgFile: TPG file name of the plugin.
+        @param scpFile: SCP file name of the plugin.
         @param workingPath: Working path of the plugin.
         """
         self.__parent = parent
@@ -46,8 +46,8 @@
         self.__dictionary = dictionary
         # Save the working path
         self.__workingPath = workingPath
-        # Save the tpg file name
-        self.__tpgFile = tpgFile
+        # Save the scp file name
+        self.__scpFile = scpFile
         # Create i18n table
         self.__i18nList = {}
         self.__updateI18nList()
@@ -193,7 +193,7 @@
         data['description']['help_file'] = helpContent
         data['description']['icon_file'] = "/%s/icon.png" % 
description.getUuid()
         data['description']['working_path'] = self.getWorkingPath()
-        data['description']['tpg_file'] = self.getTpgFile()
+        data['description']['scp_file'] = self.getScpFile()
         data['default_run_command'] = self.getDefaultRunCommandName()
         data['default_check_command'] = self.getDefaultCheckCommandName()
         # Parameters
@@ -274,13 +274,13 @@
         return self.__workingPath
 
     # 
--------------------------------------------------------------------------
-    # Get the TPG file of the plugin.
+    # Get the SCP file of the plugin.
     # 
--------------------------------------------------------------------------
-    def getTpgFile(self):
-        """Get the TPG file of the plugin.
+    def getScpFile(self):
+        """Get the SCP file of the plugin.
         @return: A string.
         """
-        return self.__tpgFile
+        return self.__scpFile
 
     # 
--------------------------------------------------------------------------
     # Get the dictionary of the plugin.

Modified: 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py
   2009-05-05 13:59:27 UTC (rev 4637)
+++ 
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginsContainer.py
   2009-05-05 14:12:57 UTC (rev 4638)
@@ -115,7 +115,7 @@
         """Add a plugins directory to deploy.
         @param directory: Directory path.
         """
-        self.__autoDeployer.addDirectory(directory, [".tpg",])
+        self.__autoDeployer.addDirectory(directory, [".scp",])
 
     # 
--------------------------------------------------------------------------
     # Remove a plugins directory to deploy.
@@ -358,7 +358,7 @@
                 if cmpVersionGt(pluginVersion, sPluginVersion):
                     try:
                         # Remove the old plugin
-                        os.remove(sPlugin.getTpgFile())
+                        os.remove(sPlugin.getScpFile())
                     except:
                         pass
                 # New plugin is older


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to