Author: ks156
Date: 2009-09-14 12:12:00 +0200 (Mon, 14 Sep 2009)
New Revision: 5366

Modified:
   software_suite_v3/smart-core/smart-server/branches/user_mode/
   
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py
   
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/02_robot/10_resourceRF.py
   
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/02_resourceGagdetsServer.py
   
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/03_resourceUgcServer.py
   software_suite_v3/smart-core/smart-server/branches/user_mode/tuxhttpserver.py
Log:
* Merged rev 5346 to 5365 trunk -> user_mode


Property changes on: 
software_suite_v3/smart-core/smart-server/branches/user_mode
___________________________________________________________________
Name: svn:mergeinfo
   - 

Modified: 
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py  
    2009-09-14 10:07:31 UTC (rev 5365)
+++ 
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py  
    2009-09-14 10:12:00 UTC (rev 5366)
@@ -175,8 +175,6 @@
                 currentVersion = confDict[archName]["version"]
                 if self.__getCurrentPartVersion(partName) == currentVersion:
                     continue
-                # Write CVER file
-                self.__writeCVerFile(partName, currentVersion)
                 installerFile = os.path.join(TDS_UPDATES_PATH, installerName)
                 if os.name == "nt":
                     cmd = [
@@ -186,6 +184,8 @@
                     ]
                     self.__logger.logInfo("Installation started [%s] (%s)" % 
(installerName, currentVersion))
                     process = subprocess.Popen(cmd)
+                    process.wait()
+                    self.__writeCVerFile(partName, currentVersion)
                     self.__logger.logInfo("Installation finished")
                 else:
                     pass

Modified: 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/02_robot/10_resourceRF.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/02_robot/10_resourceRF.py
    2009-09-14 10:07:31 UTC (rev 5365)
+++ 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/02_robot/10_resourceRF.py
    2009-09-14 10:12:00 UTC (rev 5366)
@@ -97,6 +97,16 @@
             'avoided_channel' : None,
             'avoided_bandwidth' : WIFI_DEFAULT_AVOIDED_BANDWIDTH,
         }
+        # Create a logger
+        self.logger = SimpleLogger("rf")
+        self.logger.resetLog()
+        self.logger.setLevel(TDS_CONF_LOG_LEVEL)
+        self.logger.setTarget(TDS_CONF_LOG_TARGET)
+        self.logger.logInfo("-----------------------------------------------")
+        self.logger.logInfo("Smart-core RF")
+        self.logger.logInfo("Licence : GPL")
+        self.logger.logInfo("-----------------------------------------------")
+        # Load configuration
         self.configurator.load('resourceRF.conf', defaultConfiguration)
         self.statesChecker()
         resourceScheduler.createTask_RunEveryX(
@@ -142,11 +152,12 @@
         userBandwidth = 
self.configurator.getConfiguration()['avoided_bandwidth']
         if self.__channelIsInUse() == None:
             if userChannel != None:
-                print "Avoid user selected channel :", userChannel
+                self.logger.logInfo("Manual wifi channel avoidance : ch=%d 
bw=%d" % (userChannel, userBandwidth))
                 self.avoidChannel(userChannel, userBandwidth)
                 self.__setChannelInUse(userChannel)
                 self.__setConnectionDetected(True)
             else:
+                """
                 if URLTools.URLCheck("http://ftp.kysoh.com";, 5.0):
                     detectedChannel = self.detectChannel()
                     if detectedChannel != None:
@@ -159,9 +170,17 @@
                         self.avoidChannel(1, WIFI_DEFAULT_AVOIDED_BANDWIDTH)
                         self.__setChannelInUse(1)
                         self.__setConnectionDetected(True)
+                """
+                # Don't detect internet connection seems to have better results
+                detectedChannel = self.detectChannel()
+                if detectedChannel != None:
+                    self.logger.logInfo("Automatic wifi channel avoidance : 
ch=%d" % detectedChannel)
+                    self.avoidChannel(detectedChannel, 
WIFI_DEFAULT_AVOIDED_BANDWIDTH)
+                    self.__setChannelInUse(detectedChannel)
+                    self.__setConnectionDetected(True)
 
     def resetStates(self):
-        print "Reset wifi channel states"
+        self.logger.logInfo("Reset wifi channel avoidance states")
         self.__setChannelInUse(None)
         self.__setConnectionDetected(False)
 

Modified: 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/02_resourceGagdetsServer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/02_resourceGagdetsServer.py
       2009-09-14 10:07:31 UTC (rev 5365)
+++ 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/02_resourceGagdetsServer.py
       2009-09-14 10:12:00 UTC (rev 5366)
@@ -87,7 +87,7 @@
         scgName = os.path.split(gadget.getScgFile())[-1]
         gadgetDlUrl = '/gadgets/%s' % scgName
         resourcesManager.addFileToServe(gadget.getScgFile(), gadgetDlUrl)
-        self.logger.logDebug("Gadget deployed [%s] to [%s]" % (
+        self.logger.logInfo("Gadget deployed [%s] to [%s]" % (
             gadget.getDescription().getName(), gadgetWorkingPath))
         self.__publishEvents(False, ST_NAME_GS_GADGET_LOADED, [uuid,])
 
@@ -108,7 +108,7 @@
         scgName = os.path.split(gadget.getScgFile())[-1]
         gadgetDlUrl = '/gadgets/%s' % scgName
         resourcesManager.removeFileToServe(gadgetDlUrl)
-        self.logger.logDebug("Gadget undeployed [%s] to [%s]" % (
+        self.logger.logInfo("Gadget undeployed [%s] to [%s]" % (
             gadget.getDescription().getName(), gadgetWorkingPath))
         self.__publishEvents(False, ST_NAME_GS_GADGET_UNLOADED, [uuid,])
 

Modified: 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/03_resourceUgcServer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/03_resourceUgcServer.py
   2009-09-14 10:07:31 UTC (rev 5365)
+++ 
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/03_content_servers/03_resourceUgcServer.py
   2009-09-14 10:12:00 UTC (rev 5366)
@@ -70,7 +70,7 @@
         ugcName = os.path.split(ugc.getUgcFile())[-1]
         ugcDlUrl = '/ugcs/%s' % ugcName
         resourcesManager.addFileToServe(ugc.getUgcFile(), ugcDlUrl)
-        self.logger.logDebug("UGC deployed [%s] to [%s]" % (
+        self.logger.logInfo("UGC deployed [%s] to [%s]" % (
             ugc.getDescription().getName(), ugcFile))
         self.__publishEvents(False, ST_NAME_US_UGC_LOADED, [uuid,])
         self.insertAlertsInScheduler(ugc)
@@ -92,7 +92,7 @@
         ugcName = os.path.split(ugc.getUgcFile())[-1]
         ugcDlUrl = '/ugcs/%s' % ugcName
         resourcesManager.removeFileToServe(ugcDlUrl)
-        self.logger.logDebug("UGC undeployed [%s] from [%s]" % (
+        self.logger.logInfo("UGC undeployed [%s] from [%s]" % (
             ugc.getDescription().getName(), ugcFile))
         self.__publishEvents(False, ST_NAME_US_UGC_UNLOADED, [uuid,])
         self.deleteAlertsFromScheduler(ugc)
@@ -300,26 +300,28 @@
                 [delay['hour'], delay['minute'], delay['second']],
                 data)
             ugcTask.setTaskId1(taskId)
-            if ugc.getCommand(parentTask.getCommand()).isDaemon() and \
-               parentTask.getType() == "DAILY AT":
-                command = "resourceUgcServer.stopUgc"
-                arguments = (ugc.getDescription().getUuid(),)
-                data = {
-                    'commandType' : 'ugc_stop',
-                    'uuid' : ugc.getDescription().getUuid(),
-                }
-                taskId, taskName = resourceScheduler.createTask(
-                    command,
-                    arguments,
-                    parentTask.getType(),
-                    ugcTask.getName(),
-                    ugcTask.getWeekMask(),
-                    [date['year'], date['month'], date['day']],
-                    [hoursEnd['hour'], hoursEnd['minute'], hoursEnd['second']],
-                    [hoursEnd['hour'], hoursEnd['minute'], hoursEnd['second']],
-                    [delay['hour'], delay['minute'], delay['second']],
-                    data)
-                ugcTask.setTaskId2(taskId)
+            parentCommand = ugc.getCommand(parentTask.getCommand())
+            if parentCommand != None:
+                if parentCommand.isDaemon() and \
+                   parentTask.getType() == "DAILY AT":
+                    command = "resourceUgcServer.stopUgc"
+                    arguments = (ugc.getDescription().getUuid(),)
+                    data = {
+                        'commandType' : 'ugc_stop',
+                        'uuid' : ugc.getDescription().getUuid(),
+                    }
+                    taskId, taskName = resourceScheduler.createTask(
+                        command,
+                        arguments,
+                        parentTask.getType(),
+                        ugcTask.getName(),
+                        ugcTask.getWeekMask(),
+                        [date['year'], date['month'], date['day']],
+                        [hoursEnd['hour'], hoursEnd['minute'], 
hoursEnd['second']],
+                        [hoursEnd['hour'], hoursEnd['minute'], 
hoursEnd['second']],
+                        [delay['hour'], delay['minute'], delay['second']],
+                        data)
+                    ugcTask.setTaskId2(taskId)
 
     def deleteAlertsFromScheduler(self, ugc):
         """Delete activated ugc alerts from the scheduler.

Modified: 
software_suite_v3/smart-core/smart-server/branches/user_mode/tuxhttpserver.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/branches/user_mode/tuxhttpserver.py   
    2009-09-14 10:07:31 UTC (rev 5365)
+++ 
software_suite_v3/smart-core/smart-server/branches/user_mode/tuxhttpserver.py   
    2009-09-14 10:12:00 UTC (rev 5366)
@@ -47,9 +47,6 @@
     time.sleep(0.5)
 
 def runServer():
-    killOldSmartCoreChildren()
-    killPreviousSmartServer()
-    refreshTaskBar()
     from TuxDroidServer import initializeServer
     from TuxDroidServer import httpServer
     from TuxDroidServer import finalizeServer


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to