Author: ks156
Date: 2009-10-15 12:15:14 +0200 (Thu, 15 Oct 2009)
New Revision: 5676
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSConfiguration.py
software_suite_v3/smart-core/smart-server/branches/user_mode/TuxDroidServer.py
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/en.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/fr.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/nl.po
software_suite_v3/smart-core/smart-server/branches/user_mode/tuxhttpserver.py
software_suite_v3/smart-core/smart-server/branches/user_mode/util/logger/SimpleLogger.py
Log:
* Merged rev 5584 to 5671 from the trunk to this branch
-> 5600 : Added TTS fixes for GMail
-> 5671 : Improved the logs
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSConfiguration.py
===================================================================
---
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSConfiguration.py
2009-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSConfiguration.py
2009-10-15 10:15:14 UTC (rev 5676)
@@ -62,6 +62,9 @@
TDS_CONF_LOG_LEVEL = LOG_LEVEL_INFO
# Global log target
TDS_CONF_LOG_TARGET = LOG_TARGET_FILE
+# Activation of the global file for logs
+# All log messages will be merged into one file (Single log files are
preserved)
+TDS_CONF_LOG_GLOBAL = True
# Filename of the global server log
TDS_FILENAME_TUXDROIDSERVER_LOG = "TuxDroidServer"
# Filename of the HTTP server log
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/TuxDroidServer.py
===================================================================
---
software_suite_v3/smart-core/smart-server/branches/user_mode/TuxDroidServer.py
2009-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/TuxDroidServer.py
2009-10-15 10:15:14 UTC (rev 5676)
@@ -30,6 +30,10 @@
from TDSConfiguration import *
from TDSAutoUpdater import TDSAutoUpdater
+# Create looger object
+logger = SimpleLogger("SmartServerMain")
+logger.setLevel(TDS_CONF_LOG_LEVEL)
+logger.setTarget(TDS_CONF_LOG_TARGET)
# Define the events handler.
eventsHandler = TuxEventHandlers()
# Define the files cache manager.
@@ -58,10 +62,14 @@
"""Initialize the server.
"""
# Check for updates
+ logger.logInfo("Create auto-updater")
autoUpdater = TDSAutoUpdater()
+ logger.logInfo("Start auto-updater")
autoUpdater.start()
# Load and start the resources manager
+ logger.logInfo("Load resources manager")
resourcesManager.load(TDS_RESOURCES_PATH)
+ logger.logInfo("Serve additional files")
resourcesManager.addDirectoryToServe("/data/web_interface/server_menu/xsl/")
resourcesManager.addFileToServe(os.path.join(TDS_APPLICATION_PATH,
"data", "favicon", "favicon.ico"), "/favicon.ico")
@@ -79,18 +87,24 @@
resourcesManager.addDirectoryToServe("/data/web_interface/user_01/css/")
resourcesManager.addDirectoryToServe("/data/web_interface/user_01/img/")
resourcesManager.addDirectoryToServe("/data/web_interface/user_01/js/")
+ logger.logInfo("Start resources manager")
resourcesManager.start()
# Start the clients manager
+ logger.logInfo("Start clients manager")
clientsManager.start()
def finalizeServer():
"""Finalize the server.
"""
# Stop the clients manager
+ logger.logInfo("Stop clients manager")
clientsManager.stop()
# Stop the resources manager
+ logger.logInfo("Stop resources manager")
resourcesManager.stop()
# Destroy the files cache manager
+ logger.logInfo("Destroy files cache manager")
filesCacheManager.destroy()
# Destroy the events handler
+ logger.logInfo("Destroy events handler")
eventsHandler.destroy()
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po
===================================================================
---
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po
2009-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po
2009-10-15 10:15:14 UTC (rev 5676)
@@ -21,3 +21,6 @@
msgid "gadget"
msgstr "kadchet"
+
+msgid "gmail"
+msgstr "g-mail"
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/en.po
===================================================================
---
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/en.po
2009-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/en.po
2009-10-15 10:15:14 UTC (rev 5676)
@@ -18,3 +18,6 @@
msgid "facebook"
msgstr "facebook"
+
+msgid "gmail"
+msgstr "g-mail"
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/fr.po
===================================================================
---
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/fr.po
2009-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/fr.po
2009-10-15 10:15:14 UTC (rev 5676)
@@ -27,3 +27,6 @@
msgid "login"
msgstr "loguin"
+
+msgid "gmail"
+msgstr "g-mail"
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/nl.po
===================================================================
---
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/nl.po
2009-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/nl.po
2009-10-15 10:15:14 UTC (rev 5676)
@@ -18,3 +18,6 @@
msgid "facebook"
msgstr "feesboek"
+
+msgid "gmail"
+msgstr "g-mail"
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-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/tuxhttpserver.py
2009-10-15 10:15:14 UTC (rev 5676)
@@ -22,7 +22,22 @@
from util.system.TaskBar import refreshTaskBar
from util.misc.URLTools import URLTestRequestGet
from TDSConfiguration import *
+from util.logger import *
+logger = None
+
+def initLogger():
+ global logger
+ logger = SimpleLogger("SmartServerMain")
+ logger.setLevel(TDS_CONF_LOG_LEVEL)
+ logger.setTarget(TDS_CONF_LOG_TARGET)
+ logger.resetGlobalLogFile(TDS_CONF_LOG_GLOBAL)
+ logger.resetLog()
+ logger.logInfo("-----------------------------------------------")
+ logger.logInfo("SmartServerMain%s" % __version__)
+ logger.logInfo("Licence : %s" % __licence__)
+ logger.logInfo("-----------------------------------------------")
+
def checkServerRun():
return URLTestRequestGet("127.0.0.1", TDS_HTTP_PORT, "/", 200, 5.0)
@@ -43,16 +58,26 @@
refreshTaskBar()
def killServerAndWait():
+ logger.logInfo("Kill server")
killServer()
+ logger.logInfo("Server killed")
time.sleep(0.5)
def runServer():
+ logger.logInfo("Import initializeServer")
from TuxDroidServer import initializeServer
+ logger.logInfo("Import httpServer")
from TuxDroidServer import httpServer
+ logger.logInfo("Import finalizeServer")
from TuxDroidServer import finalizeServer
+ logger.logInfo("Initialize server")
initializeServer()
+ logger.logInfo("Start server")
httpServer.start()
+ logger.logInfo("Server stopped")
+ logger.logInfo("Finalize server")
finalizeServer()
+ logger.logInfo("Server finalized")
def usage():
print '-'*80
@@ -125,6 +150,7 @@
if __stop:
killServer()
elif __restart:
+ initLogger()
killServerAndWait()
start()
else:
@@ -132,5 +158,6 @@
print "Server is already started"
print "Uses --restart if you want to restart the server.. so,
exiting."
else:
+ initLogger()
start()
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/util/logger/SimpleLogger.py
===================================================================
---
software_suite_v3/smart-core/smart-server/branches/user_mode/util/logger/SimpleLogger.py
2009-10-15 10:12:41 UTC (rev 5675)
+++
software_suite_v3/smart-core/smart-server/branches/user_mode/util/logger/SimpleLogger.py
2009-10-15 10:15:14 UTC (rev 5676)
@@ -29,6 +29,8 @@
LOG_TARGET_SHELL = 1
LOG_TARGET_BOTH = 2
LOG_TARGET_NONE = 3
+# Global log file flag
+LOG_GLOBAL_FILE = False
#
==============================================================================
# Public class
@@ -114,6 +116,21 @@
pass
#
--------------------------------------------------------------------------
+ # Reset the global log file.
+ #
--------------------------------------------------------------------------
+ def resetGlobalLogFile(self, activate = True):
+ """Reset the global log file.
+ """
+ global LOG_GLOBAL_FILE
+ LOG_GLOBAL_FILE = activate
+ if LOG_GLOBAL_FILE:
+ try:
+ f = open(os.path.join(self.__logPath, "all.log"), 'w')
+ f.close()
+ except:
+ pass
+
+ #
--------------------------------------------------------------------------
# Put a message in the log.
#
--------------------------------------------------------------------------
def __putLog(self, msgType, msgString):
@@ -132,6 +149,15 @@
f.close()
except:
pass
+ if LOG_GLOBAL_FILE:
+ try:
+ f = open(os.path.join(self.__logPath, "all.log"), 'a')
+ try:
+ f.write(message + "\n")
+ finally:
+ f.close()
+ except:
+ pass
self.__logMutex.release()
if self.__target in [LOG_TARGET_SHELL, LOG_TARGET_BOTH]:
print message
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn