Author: remi
Date: 2008-09-17 17:06:57 +0200 (Wed, 17 Sep 2008)
New Revision: 1882
Modified:
software_suite_v2/tuxware/tuxhttpserver/trunk/src/tuxhttpserver.py
Log:
* now the server scan the "resources" directory to retrieving and executing the
resources python files.
Resources are now fully incremental ;)
Modified: software_suite_v2/tuxware/tuxhttpserver/trunk/src/tuxhttpserver.py
===================================================================
--- software_suite_v2/tuxware/tuxhttpserver/trunk/src/tuxhttpserver.py
2008-09-17 15:06:17 UTC (rev 1881)
+++ software_suite_v2/tuxware/tuxhttpserver/trunk/src/tuxhttpserver.py
2008-09-17 15:06:57 UTC (rev 1882)
@@ -17,6 +17,7 @@
import threading
import time
import sys
+import os
from tuxisalive.lib.httpserver import *
from tuxisalive.lib.driver import *
@@ -171,38 +172,12 @@
Glb_Version = self.__versionStr
# Load the resources from the external files
- str = open('%s/resources/ResourceFiles.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceClient.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceAccess.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceStatus.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceEyes.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceMacro.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceMouth.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceFlippers.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceSpinning.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceIR.py' % APPLICATION_PATH, 'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceLeds.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceSoundFlash.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceTTS.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceWav.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceAttitune.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
- str = open('%s/resources/ResourceParent.py' % APPLICATION_PATH,
'r').read()
- exec(str) in globals()
+ resourceList = os.listdir('%s/resources' % APPLICATION_PATH)
+ for resource in resourceList:
+ if resource.lower().rfind(".py") != -1:
+ resourceFile = os.path.join(APPLICATION_PATH, 'resources',
resource)
+ str = open(resourceFile, 'r').read()
+ exec(str) in globals()
def run():
"""Run the server
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn