tux-droid-svn Mailing List for Tux Droid CE (Page 54)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
| 2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
| 2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: remi <c2m...@c2...> - 2009-05-29 12:43:08
|
Author: remi
Date: 2009-05-29 14:42:02 +0200 (Fri, 29 May 2009)
New Revision: 4707
Modified:
software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi
Log:
* updated installer nsi script
Modified: software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi
===================================================================
--- software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi 2009-05-29 12:24:56 UTC (rev 4706)
+++ software_suite_v3/smart-core/smart-api/python/trunk/installer.nsi 2009-05-29 12:42:02 UTC (rev 4707)
@@ -3,12 +3,12 @@
; -----------------------------------------------------------------------------
; HM NIS Edit Wizard helper defines
-!define PRODUCT_NAME "Tuxisalive python package"
+!define PRODUCT_NAME "Smart API for python"
!define PRODUCT_VERSION "0.3.0"
; Output names
-!define FINAL_INSTALLER_EXE "pyTuxisaliveInstaller_${PRODUCT_VERSION}.exe"
-!define UNINSTALLER_EXE "pyTuxisaliveUninstaller.exe"
+!define FINAL_INSTALLER_EXE "pySmartAPIInstaller.exe"
+!define UNINSTALLER_EXE "pySmartAPIUninstaller.exe"
; The name of the installer
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
@@ -28,11 +28,28 @@
var /GLOBAL UNINSTALLERS_SUB_PATH
; -----------------------------------------------------------------------------
+; Section Pre-installation
+; -----------------------------------------------------------------------------
+Section -Pre
+!ifndef INNER
+ ; Needed
+ SectionIn RO
+ ; Get the Tuxdroid installation path
+ ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tux Droid\Installation" "Install_Dir"
+ ; Uninstall old installations of Smart-API
+ DetailPrint "Uninstalling old versions"
+ SetDetailsPrint none
+ ExecWait '"$TUXDROID_PATH\uninstallers\sub\${UNINSTALLER_EXE}" /S _?=$TUXDROID_PATH\uninstallers'
+ SetDetailsPrint textonly
+!endif
+SectionEnd
+
+; -----------------------------------------------------------------------------
; Section ""
; -----------------------------------------------------------------------------
Section ""
; Get the Tuxdroid installation paths
- ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tuxdroid\TuxdroidSetup" "Install_Dir"
+ ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tux Droid\Installation" "Install_Dir"
StrCpy $TUXDROID_PYTHON_PATH "$TUXDROID_PATH\softwares\python2.4"
StrCpy $UNINSTALLERS_SUB_PATH "$TUXDROID_PATH\uninstallers\sub"
@@ -41,8 +58,8 @@
SetOutPath "$TUXDROID_PYTHON_PATH\Lib\site-packages\tuxisalive"
File /r tuxisalive\*
- CreateDirectory "$TUXDROID_PATH\resources\misc"
- SetOutPath "$TUXDROID_PATH\resources\misc"
+ CreateDirectory "$TUXDROID_PATH\resources\images"
+ SetOutPath "$TUXDROID_PATH\resources\images"
File tuxsh.ico
; Write bat file
@@ -52,7 +69,7 @@
Call WriteToFile
; Write shortcut in start menu
- CreateShortCut "$SMPROGRAMS\Tux Droid\Tuxshell.lnk" "$TUXDROID_PATH\bin\tuxsh.bat" "" "$TUXDROID_PATH\resources\misc\tuxsh.ico" 0
+ CreateShortCut "$SMPROGRAMS\Tux Droid\Tux Droid Shell.lnk" "$TUXDROID_PATH\bin\tuxsh.bat" "" "$TUXDROID_PATH\resources\images\tuxsh.ico" 0
; Write the uninstall file
WriteUninstaller "$UNINSTALLERS_SUB_PATH\${UNINSTALLER_EXE}"
@@ -65,19 +82,26 @@
; Section "Uninstall"
; -----------------------------------------------------------------------------
Section "Uninstall"
+ ; Kill troublesome tasks
+ Processes::KillProcess "pythonForTuxdroid"
+ Processes::KillProcess "pythonForTuxdroidA"
+ Processes::KillProcess "python"
+ Processes::KillProcess "java"
+ Processes::KillProcess "javaw"
+ Processes::KillProcess "tux_wifi_channel"
; Get the Tuxdroid installation paths
- ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tuxdroid\TuxdroidSetup" "Install_Dir"
+ ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tux Droid\Installation" "Install_Dir"
StrCpy $TUXDROID_PYTHON_PATH "$TUXDROID_PATH\softwares\python2.4"
StrCpy $UNINSTALLERS_SUB_PATH "$TUXDROID_PATH\uninstallers\sub"
; Remove files and uninstaller
Delete "$TUXDROID_PATH\bin\tuxsh.bat"
- Delete "$TUXDROID_PATH\resources\misc\tuxsh.ico"
+ Delete "$TUXDROID_PATH\resources\images\tuxsh.ico"
RMDir /r "$TUXDROID_PYTHON_PATH\Lib\site-packages\tuxisalive"
Delete "$UNINSTALLERS_SUB_PATH\${UNINSTALLER_EXE}"
; Remove shortcuts
- Delete "$SMPROGRAMS\Tux Droid\Tuxshell.lnk"
+ Delete "$SMPROGRAMS\Tux Droid\Tux Shell.lnk"
; Quit the uninstaller
Quit
|
|
From: remi <c2m...@c2...> - 2009-05-29 12:43:00
|
Author: remi
Date: 2009-05-29 14:42:42 +0200 (Fri, 29 May 2009)
New Revision: 4708
Modified:
software_suite_v3/smart-core/smart-server/trunk/installer.nsi
Log:
* updated installer nsi script
Modified: software_suite_v3/smart-core/smart-server/trunk/installer.nsi
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/installer.nsi 2009-05-29 12:42:02 UTC (rev 4707)
+++ software_suite_v3/smart-core/smart-server/trunk/installer.nsi 2009-05-29 12:42:42 UTC (rev 4708)
@@ -107,6 +107,14 @@
; Section "Uninstall"
; -----------------------------------------------------------------------------
Section "Uninstall"
+ ; Kill troublesome tasks
+ Processes::KillProcess "pythonForTuxdroid"
+ Processes::KillProcess "pythonForTuxdroidA"
+ Processes::KillProcess "python"
+ Processes::KillProcess "java"
+ Processes::KillProcess "javaw"
+ Processes::KillProcess "tux_wifi_channel"
+
; Get the Tuxdroid installation paths
ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tux Droid\Installation" "Install_Dir"
StrCpy $UNINSTALLERS_SUB_PATH "$TUXDROID_PATH\uninstallers\sub"
|
|
From: remi <c2m...@c2...> - 2009-05-29 12:10:35
|
Author: remi Date: 2009-05-29 14:10:24 +0200 (Fri, 29 May 2009) New Revision: 4703 Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_restart.exe software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_start.exe software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_stop.exe Log: * signed binaries Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_restart.exe =================================================================== (Binary files differ) Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_start.exe =================================================================== (Binary files differ) Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_stop.exe =================================================================== (Binary files differ) |
|
From: remi <c2m...@c2...> - 2009-05-29 12:09:06
|
Author: remi
Date: 2009-05-29 14:08:56 +0200 (Fri, 29 May 2009)
New Revision: 4702
Added:
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/smart_server_restart.dpr
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/smart_server_restart.res
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_restart.exe
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_start.exe
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_stop.exe
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/smart_server_start.dpr
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/smart_server_start.res
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/smart_server_stop.dpr
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/smart_server_stop.res
Removed:
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.dpr
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.res
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.dpr
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.res
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.dpr
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.res
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/tuxhttpserver_restart.exe
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/tuxhttpserver_start.exe
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/tuxhttpserver_stop.exe
Modified:
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/start.pas
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/stop.pas
software_suite_v3/smart-core/smart-server/trunk/util/misc/tuxPaths.py
Log:
* updated smart-server start/stop/restart on Windows
* updated registry path for Tux Droid installation
Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas 2009-05-29 10:26:44 UTC (rev 4701)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas 2009-05-29 12:08:56 UTC (rev 4702)
@@ -31,7 +31,7 @@
Registry;
const
- TUXDROID_REGISTRY_PATH = 'SOFTWARE\Tuxdroid\TuxdroidSetup';
+ TUXDROID_REGISTRY_PATH = 'SOFTWARE\Tux Droid\Installation';
type
TForm1 = class(TForm)
@@ -105,7 +105,7 @@
*}
begin
tuxdroid_path := getTuxdroidInstallDirectory;
- serverFileName := format('%s\softwares\tuxhttpserver\tuxhttpserver.py',
+ serverFileName := format('%s\softwares\smart-server\tuxhttpserver.py',
[tuxdroid_path]);
serverPath := extractFilePath(serverFileName);
ShellExecute(
Copied: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/smart_server_restart.dpr (from rev 4701, software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.dpr)
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/smart_server_restart.dpr (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/smart_server_restart.dpr 2009-05-29 12:08:56 UTC (rev 4702)
@@ -0,0 +1,14 @@
+program smart_server_restart;
+
+uses
+ Forms,
+ restart in 'restart.pas' {Form1};
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.Title := 'Tux Droid Server';
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
Copied: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/smart_server_restart.res (from rev 4701, software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.res)
===================================================================
(Binary files differ)
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.dpr
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.dpr 2009-05-29 10:26:44 UTC (rev 4701)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.dpr 2009-05-29 12:08:56 UTC (rev 4702)
@@ -1,14 +0,0 @@
-program tuxdroidserver_restart;
-
-uses
- Forms,
- restart in 'restart.pas' {Form1};
-
-{$R *.res}
-
-begin
- Application.Initialize;
- Application.Title := 'Tux Droid Server';
- Application.CreateForm(TForm1, Form1);
- Application.Run;
-end.
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/tuxdroidserver_restart.res
===================================================================
(Binary files differ)
Added: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_restart.exe
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_restart.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Added: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_start.exe
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_start.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Added: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_stop.exe
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/smart_server_stop.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Copied: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/smart_server_start.dpr (from rev 4701, software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.dpr)
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/smart_server_start.dpr (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/smart_server_start.dpr 2009-05-29 12:08:56 UTC (rev 4702)
@@ -0,0 +1,14 @@
+program smart_server_start;
+
+uses
+ Forms,
+ start in 'start.pas' {Form1};
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.Title := 'Tux Droid Server';
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
Copied: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/smart_server_start.res (from rev 4701, software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.res)
===================================================================
(Binary files differ)
Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/start.pas
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/start.pas 2009-05-29 10:26:44 UTC (rev 4701)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/start.pas 2009-05-29 12:08:56 UTC (rev 4702)
@@ -30,7 +30,7 @@
Registry;
const
- TUXDROID_REGISTRY_PATH = 'SOFTWARE\Tuxdroid\TuxdroidSetup';
+ TUXDROID_REGISTRY_PATH = 'SOFTWARE\Tux Droid\Installation';
type
TForm1 = class(TForm)
@@ -76,7 +76,7 @@
*}
begin
tuxdroid_path := getTuxdroidInstallDirectory;
- serverFileName := format('%s\softwares\tuxhttpserver\tuxhttpserver.py',
+ serverFileName := format('%s\softwares\smart-server\tuxhttpserver.py',
[tuxdroid_path]);
serverPath := extractFilePath(serverFileName);
ShellExecute(
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.dpr
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.dpr 2009-05-29 10:26:44 UTC (rev 4701)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.dpr 2009-05-29 12:08:56 UTC (rev 4702)
@@ -1,14 +0,0 @@
-program tuxdroidserver_start;
-
-uses
- Forms,
- start in 'start.pas' {Form1};
-
-{$R *.res}
-
-begin
- Application.Initialize;
- Application.Title := 'Tux Droid Server';
- Application.CreateForm(TForm1, Form1);
- Application.Run;
-end.
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/start/tuxdroidserver_start.res
===================================================================
(Binary files differ)
Copied: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/smart_server_stop.dpr (from rev 4701, software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.dpr)
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/smart_server_stop.dpr (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/smart_server_stop.dpr 2009-05-29 12:08:56 UTC (rev 4702)
@@ -0,0 +1,14 @@
+program smart_server_stop;
+
+uses
+ Forms,
+ stop in 'stop.pas' {Form1};
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.Title := 'Tux Droid Server';
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
Copied: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/smart_server_stop.res (from rev 4701, software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.res)
===================================================================
(Binary files differ)
Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/stop.pas
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/stop.pas 2009-05-29 10:26:44 UTC (rev 4701)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/stop.pas 2009-05-29 12:08:56 UTC (rev 4702)
@@ -30,7 +30,7 @@
Registry;
const
- TUXDROID_REGISTRY_PATH = 'SOFTWARE\Tuxdroid\TuxdroidSetup';
+ TUXDROID_REGISTRY_PATH = 'SOFTWARE\Tux Droid\Installation';
type
TForm1 = class(TForm)
@@ -76,7 +76,7 @@
*}
begin
tuxdroid_path := getTuxdroidInstallDirectory;
- serverFileName := format('%s\softwares\tuxhttpserver\tuxhttpserver.py',
+ serverFileName := format('%s\softwares\smart-server\tuxhttpserver.py',
[tuxdroid_path]);
serverPath := extractFilePath(serverFileName);
ShellExecute(
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.dpr
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.dpr 2009-05-29 10:26:44 UTC (rev 4701)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.dpr 2009-05-29 12:08:56 UTC (rev 4702)
@@ -1,14 +0,0 @@
-program tuxdroidserver_stop;
-
-uses
- Forms,
- stop in 'stop.pas' {Form1};
-
-{$R *.res}
-
-begin
- Application.Initialize;
- Application.Title := 'Tux Droid Server';
- Application.CreateForm(TForm1, Form1);
- Application.Run;
-end.
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/stop/tuxdroidserver_stop.res
===================================================================
(Binary files differ)
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/tuxhttpserver_restart.exe
===================================================================
(Binary files differ)
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/tuxhttpserver_start.exe
===================================================================
(Binary files differ)
Deleted: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/tuxhttpserver_stop.exe
===================================================================
(Binary files differ)
Modified: software_suite_v3/smart-core/smart-server/trunk/util/misc/tuxPaths.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/misc/tuxPaths.py 2009-05-29 10:26:44 UTC (rev 4701)
+++ software_suite_v3/smart-core/smart-server/trunk/util/misc/tuxPaths.py 2009-05-29 12:08:56 UTC (rev 4702)
@@ -23,7 +23,7 @@
"""Fill the default locutor for a iso lang.
"""
global TUXDROID_DEFAULT_LOCUTOR
-
+
if isoLang == "ar":
TUXDROID_DEFAULT_LOCUTOR = "Salma8k"
elif isoLang == "en_GB":
@@ -56,7 +56,7 @@
if os.name == 'nt':
from _winreg import *
aReg = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
- aKey = OpenKey(aReg, r"SOFTWARE\Tuxdroid\TuxdroidSetup")
+ aKey = OpenKey(aReg, r"SOFTWARE\Tux Droid\Installation")
TUXDROID_BASE_PATH = QueryValueEx(aKey, "Install_Dir")[0]
TUXDROID_LANGUAGE = QueryValueEx(aKey, "Language")[0]
CloseKey(aReg)
@@ -76,4 +76,4 @@
f.close()
except:
TUXDROID_BASE_PATH = "/usr/share/tuxdroid"
-USER_BASE_PATH = os.path.expanduser("~")
\ No newline at end of file
+USER_BASE_PATH = os.path.expanduser("~")
|
|
From: jerome <c2m...@c2...> - 2009-05-29 10:26:55
|
Author: jerome
Date: 2009-05-29 12:26:44 +0200 (Fri, 29 May 2009)
New Revision: 4701
Added:
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.res
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
Log:
* Added first shot of web browser ( without server part ).
Added: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg (rev 0)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.cfg 2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,35 @@
+-$A8
+-$B-
+-$C+
+-$D+
+-$E-
+-$F-
+-$G+
+-$H+
+-$I+
+-$J-
+-$K-
+-$L+
+-$M-
+-$N+
+-$O+
+-$P+
+-$Q-
+-$R-
+-$S-
+-$T-
+-$U-
+-$V+
+-$W-
+-$X+
+-$YD
+-$Z1
+-cg
+-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+-H+
+-W+
+-M
+-$M16384,1048576
+-K$00400000
+-LE"c:\program files\borland\delphi6\Projects\Bpl"
+-LN"c:\program files\borland\delphi6\Projects\Bpl"
Added: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof (rev 0)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dof 2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,83 @@
+[FileVersion]
+Version=6.0
+[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=1
+P=1
+Q=0
+R=0
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+[Linker]
+MapFile=0
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=0
+RemoteSymbols=0
+MinStackSize=16384
+MaxStackSize=1048576
+ImageBase=4194304
+ExeDescription=
+[Directories]
+OutputDir=
+UnitOutputDir=
+PackageDLLOutputDir=
+PackageDCPOutputDir=
+SearchPath=
+Packages=
+Conditionals=
+DebugSourceDirs=
+UsePackages=0
+[Parameters]
+RunParams=
+HostApplication=
+Launcher=
+UseLauncher=0
+DebugCWD=
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
Added: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr (rev 0)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.dpr 2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,14 @@
+program Project2;
+
+uses
+ Forms,
+ Unit1 in 'Unit1.pas' {Form1};
+
+{$R *.res}
+
+begin
+ Application.Initialize;
+ Application.ShowMainForm:=False;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
Added: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.res
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Project2.res
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
===================================================================
(Binary files differ)
Property changes on: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dcu
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm (rev 0)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.dfm 2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,64 @@
+object Form1: TForm1
+ Left = 291
+ Top = 127
+ Width = 963
+ Height = 634
+ Caption = 'Tux Droid Browser'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ OldCreateOrder = False
+ OnCloseQuery = FormCloseQuery
+ OnCreate = FormCreate
+ PixelsPerInch = 96
+ TextHeight = 13
+ object EmbeddedWB1: TEmbeddedWB
+ Left = 0
+ Top = 0
+ Width = 955
+ Height = 600
+ Align = alClient
+ TabOrder = 0
+ DisableCtrlShortcuts = 'N'
+ UserInterfaceOptions = [EnablesFormsAutoComplete, EnableThemes]
+ DisabledPopupMenus = [rcmAll]
+ About = ' EmbeddedWB http://bsalsa.com/'
+ DisabledPopupMenuItems = [rcsOpenNWindow, rcsOpenLink]
+ PrintOptions.HTMLHeader.Strings = (
+ '<HTML></HTML>')
+ PrintOptions.Orientation = poPortrait
+ ControlData = {
+ 4C0000009D530000553200000000000000000000000000000000000000000000
+ 000000004C000000000000000000000001000000E0D057007335CF11AE690800
+ 2B2E126208000000000000004C0000000114020000000000C000000000000046
+ 8000000000000000000000000000000000000000000000000000000000000000
+ 00000000000000000100000000000000000000000000000000000000}
+ end
+ object PopupMenu1: TPopupMenu
+ OnPopup = PopupMenu1Popup
+ Left = 112
+ Top = 168
+ object ShowHide1: TMenuItem
+ Caption = 'Show/Hide'
+ OnClick = ShowHide1Click
+ end
+ object Mute1: TMenuItem
+ Caption = 'Mute'
+ OnClick = Mute1Click
+ end
+ object Help1: TMenuItem
+ Caption = 'Help'
+ OnClick = Help1Click
+ end
+ object N1: TMenuItem
+ Caption = '-'
+ end
+ object Quit1: TMenuItem
+ Caption = 'Quit'
+ OnClick = Quit1Click
+ end
+ end
+end
Added: software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas
===================================================================
--- software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas (rev 0)
+++ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/tux_droid_browser/Unit1.pas 2009-05-29 10:26:44 UTC (rev 4701)
@@ -0,0 +1,215 @@
+{* This file is part of "Tux Droid Browser".
+ * Copyright 2009, kysoh
+ * Author : Conan Jerome.
+ * eMail : jer...@ky...
+ * Site : http://www.kysoh.com/
+ *
+ * "Tux Droid Browser" is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * "Tux Droid Browser" is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with "Tux Droid Browser"; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *}
+
+
+unit Unit1;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, OleCtrls, SHDocVw_EWB, EwbCore, EmbeddedWB, ShellAPI, Menus, Registry;
+
+const wm_AppelMessage = wm_user + 1;
+
+type
+ TForm1 = class(TForm)
+ EmbeddedWB1: TEmbeddedWB;
+ PopupMenu1: TPopupMenu;
+ ShowHide1: TMenuItem;
+ Mute1: TMenuItem;
+ Help1: TMenuItem;
+ N1: TMenuItem;
+ Quit1: TMenuItem;
+
+ procedure FormCreate(Sender: TObject);
+ procedure PopupMenu1Popup(Sender: TObject);
+ procedure ShowHide1Click(Sender: TObject);
+ procedure Quit1Click(Sender: TObject);
+ procedure Help1Click(Sender: TObject);
+ procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+ procedure Mute1Click(Sender: TObject);
+
+ private
+ { Darations priv }
+ procedure WMAppelMessage(var msg : TMessage); message wm_AppelMessage;
+ function OpenUrl(const url : String) : boolean;
+
+ public
+ { Darations publiques }
+ end;
+
+var
+ Form1 : TForm1;
+ Tray : TNotifyIconData;
+
+
+implementation
+
+{$R *.dfm}
+
+{###############################################}
+{####### Form1 properties and events ######}
+{###############################################}
+
+
+//Form initialization.
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+
+ //Tray icon initialization.
+ Tray.cbSize := SizeOf(Tray);
+ Tray.wnd := Handle;
+ Tray.uID := 1;
+ Tray.UCallbackMessage := wm_AppelMessage;
+
+ //Set icon and text.
+ Tray.hIcon := Application.Icon.handle;
+ Tray.szTip := 'Show/Hide Tux Droid Browser';
+ Tray.uFlags := nif_message or nif_icon or nif_tip;
+
+ //Adding tray icon to the system tray.
+ Shell_NotifyIcon(Nim_ADD,@Tray);
+
+ //Embedded browser initialization.
+ EmbeddedWB1.Go('http://127.0.0.1:270/devel/');
+end;
+
+
+//Avoiding close action.
+procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+begin
+ CanClose := False;
+ Form1.Hide;
+end;
+
+
+{###############################################}
+{####### Tray icon properties and events ######}
+{###############################################}
+
+//Actions to do when popup menu is showed.
+procedure TForm1.PopupMenu1Popup(Sender: TObject);
+begin
+ if Form1.Visible then
+ ShowHide1.Caption := 'Hide'
+ else
+ ShowHide1.Caption := 'Show';
+end;
+
+
+//Tray menu show/hide click.
+procedure TForm1.ShowHide1Click(Sender: TObject);
+begin
+ if Form1.Visible then
+ Form1.Hide
+ else
+ Form1.Show;
+end;
+
+
+//Tray icon 'help' click.
+procedure TForm1.Help1Click(Sender: TObject);
+begin
+ if not Form1.OpenUrl('http://www.kysoh.com/documentation/') then
+ dialogs.ShowMessage('Error while loading help');
+end;
+
+
+//Tray icon 'mute' click.
+procedure TForm1.Mute1Click(Sender: TObject);
+begin
+{TODO}
+end;
+
+
+//Tray menu 'quit' click.
+procedure TForm1.Quit1Click(Sender: TObject);
+begin
+ Shell_NotifyIcon(Nim_DELETE,@tray);
+ Application.Terminate;
+end;
+
+
+{###############################################}
+{####### Private functions and procedures ######}
+{###############################################}
+
+//Open an url into the default web browser.
+function TForm1.OpenUrl(const url : String) : boolean;
+var
+ Browser: string;
+begin
+ Browser := '';
+
+ with TRegistry.Create do
+ try
+ RootKey := HKEY_CLASSES_ROOT;
+ Access := KEY_QUERY_VALUE;
+ if OpenKey('\htmlfile\shell\open\command', False) then
+ Browser := ReadString('') ;
+ CloseKey;
+ finally
+ Free;
+ end;
+
+ if Browser = '' then
+ begin
+ Exit;
+ Result := False;
+ end;
+
+ Browser := Copy(Browser, Pos('"', Browser) + 1, Length(Browser)) ;
+ Browser := Copy(Browser, 1, Pos('"', Browser) - 1) ;
+ ShellExecute(0, 'open', PChar(Browser), PChar(URL), nil, SW_SHOW) ;
+
+ Result := True;
+end;
+
+
+//Tray icon click event.
+procedure TForm1.WMAppelMessage(var msg : TMessage);
+var
+ Cursor : TPoint;
+begin
+
+ //Clique droit de la souris
+ if msg.LParam = Wm_LButtonDown then
+ begin
+ //Showing application.
+ if Form1.Visible then
+ Form1.Hide
+ else
+ Form1.Show;
+ end
+ else if msg.LParam = Wm_RButtonDown then
+ begin
+ SetForegroundWindow(Handle);
+ GetCursorPos(Cursor);
+ PopupMenu1.Popup(Cursor.X, Cursor.Y);
+ PostMessage(Handle, WM_NULL, 0, 0);
+ end;
+
+end;
+
+end.
+
|
|
From: ks156 <c2m...@c2...> - 2009-05-29 10:09:44
|
Author: ks156
Date: 2009-05-29 12:09:37 +0200 (Fri, 29 May 2009)
New Revision: 4700
Modified:
software_suite_v2/tuxware/installers/unix/trunk/build.sh
Log:
* Don't need to compile the driver anymore. The SVN version can be used
directly.
* Start the server with the 32 bits version of python for the amd64
architectures.
Modified: software_suite_v2/tuxware/installers/unix/trunk/build.sh
===================================================================
--- software_suite_v2/tuxware/installers/unix/trunk/build.sh 2009-05-29 09:09:58 UTC (rev 4699)
+++ software_suite_v2/tuxware/installers/unix/trunk/build.sh 2009-05-29 10:09:37 UTC (rev 4700)
@@ -377,8 +377,14 @@
serverBin () {
echo "-- Creating server binary"
echo "#!/bin/bash" >$MIRROR_DIR/$PREFIX/$BIN_DIR/tuxhttpserver
- echo "python $PREFIX/$SERVER_DIR/tuxhttpserver.py" >> \
- $MIRROR_DIR/$PREFIX/$BIN_DIR/tuxhttpserver
+ if [ $ARCH == "amd64" ]; then
+ echo "/opt/Python32/bin/python2.6 $PREFIX/$SERVER_DIR/tuxhttpserver.py" >> \
+ $MIRROR_DIR/$PREFIX/$BIN_DIR/tuxhttpserver
+ else
+ echo "python $PREFIX/$SERVER_DIR/tuxhttpserver.py" >> \
+ $MIRROR_DIR/$PREFIX/$BIN_DIR/tuxhttpserver
+ fi
+
chmod +x $MIRROR_DIR/$PREFIX/$BIN_DIR/tuxhttpserver
}
@@ -756,7 +762,7 @@
packPython32
fi
packPythAPI
-compileDriver
+#compileDriver
packJavaAPI
compTuxup
compDfuProgrammer
|
|
From: ks156 <c2m...@c2...> - 2009-05-29 09:10:06
|
Author: ks156
Date: 2009-05-29 11:09:58 +0200 (Fri, 29 May 2009)
New Revision: 4699
Added:
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/Makefile.amd64
Modified:
software_suite_v2/tuxware/installers/unix/trunk/build.sh
Log:
* Added new support for the 64 bits architecture (testing)
Modified: software_suite_v2/tuxware/installers/unix/trunk/build.sh
===================================================================
--- software_suite_v2/tuxware/installers/unix/trunk/build.sh 2009-05-29 08:51:23 UTC (rev 4698)
+++ software_suite_v2/tuxware/installers/unix/trunk/build.sh 2009-05-29 09:09:58 UTC (rev 4699)
@@ -201,6 +201,14 @@
cp -r $TEMP_DIR/tuxhttpserver/* $MIRROR_DIR/$PREFIX/$SERVER_DIR
}
+# Include Python32
+packPython32 () {
+ echo "-- Copying python for 32 bits "
+ mkdir $MIRROR_DIR/tmp
+ wget http://ftp.kysoh.com/apps/installers/unix/python32/Python32.tar.gz -O \
+ $MIRROR_DIR/tmp/Python32.tar.gz
+}
+
# Install the python API from SVN
packPythAPI () {
echo "-- Copying the python API"
@@ -497,6 +505,9 @@
echo "Creating post install script"
sed "s;PREFIX=;PREFIX=$PREFIX;g" build_deps/deb/postinst \
>$POSTINST
+ if [ $ARCH == "amd64" ]; then
+ echo 'tar -xvf /tmp/Python32.tar.gz -C /opt/' >> $POSTINST
+ fi
chmod +x $POSTINST
}
@@ -522,8 +533,14 @@
####### TAR.GZ SPECIFIC ########
packTarSpecifics () {
cp -rf ./build_deps/tar/* $BUILD_DIR/
- sed "s;PREFIX=;PREFIX=$PREFIX;g" build_deps/tar/Makefile \
- >$BUILD_DIR/Makefile
+ if [ $ARCH == "amd64" ]; then
+ sed "s;PREFIX=;PREFIX=$PREFIX;g" build_deps/tar/Makefile.amd64 \
+ >$BUILD_DIR/Makefile
+
+ else
+ sed "s;PREFIX=;PREFIX=$PREFIX;g" build_deps/tar/Makefile \
+ >$BUILD_DIR/Makefile
+ fi
}
@@ -666,6 +683,10 @@
case $options in
a)
ARCH=amd64
+
+ DEPS="libc6(>=2.3), python, libasound2, python-ctypes, libstdc++5, \
+ python-xml, libportaudio2, openjdk-6-jre, python-dev, python-setuptools, sox, \
+ lame, ia32-libs"
;;
q)
SOURCE=$QC
@@ -731,6 +752,9 @@
createBaseDir
# <--- Download stuff from SVN --->
packServer
+if [ $ARCH == "amd64" ]; then
+ packPython32
+fi
packPythAPI
compileDriver
packJavaAPI
Added: software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/Makefile.amd64
===================================================================
--- software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/Makefile.amd64 (rev 0)
+++ software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/Makefile.amd64 2009-05-29 09:09:58 UTC (rev 4699)
@@ -0,0 +1,59 @@
+PREFIX=
+all:
+ @echo Usage make install; make uninstall
+install:
+ echo Installing Tux Droid
+ echo Cleanup the system ...
+ rm -f /etc/tuxdroid/tuxdroid.conf
+ rm -f /usr/bin/tuxsh
+ rm -f /usr/bin/tux_updater
+ rm -f /usr/bin/tux_control_center
+ rm -f /usr/bin/tuxhttpserver
+ rm -f /usr/bin/tuxgi
+ rm -f /usr/bin/dfu-programmer
+ rm -f /usr/bin/tux_wifi_channel
+ rm -f /usr/bin/tuxup
+ echo Copying files
+ if [ ! -e $(PREFIX) ]; then mkdir -p $(PREFIX); fi
+ if [ ! -e $(PREFIX)/lib ]; then mkdir $(PREFIX)/lib; fi
+ if [ ! -e $(PREFIX)/bin ]; then mkdir $(PREFIX)/bin; fi
+ if [ ! -e $(PREFIX)/share]; then mkdir $(PREFIX)/share; fi
+ if [ ! -e $(PREFIX)/share/applications]; then mkdir $(PREFIX)/share/applications; fi
+ if [ ! -e $(PREFIX)/share/pixmaps]; then mkdir $(PREFIX)/share/pixmaps; fi
+ cp -r ./mirror/etc/* /etc/
+ cp -r ./mirror/opt /
+ cp -r ./mirror/$(PREFIX)/lib/* $(PREFIX)/lib/
+ cp -r ./mirror/$(PREFIX)/bin/* $(PREFIX)/bin/
+ cp -r ./mirror/$(PREFIX)/share/tuxdroid $(PREFIX)/share/
+ cp -r ./mirror/usr/share/applications/* /usr/share/applications/
+ cp -r ./mirror/usr/share/pixmaps/* /usr/share/pixmaps/
+ echo Installing python API
+ cp -r $(PREFIX)/lib/tuxdroid/python-api/tuxisalive .
+ cp $(PREFIX)/lib/tuxdroid/python-api/setup.py .
+ python setup.py install >/dev/null
+ rm -rf tuxisalive setup.py build
+ chmod 0755 $(PREFIX)/share/tuxdroid/tuxhttpserver/tuxhttpserver.py
+ chmod 0755 $(PREFIX)/share/tuxdroid/tux_updater/tux_updater
+ tar -xvf ./mirror/Python32.tar.gz -C /opt/
+ echo Done.
+
+uninstall:
+ echo "Uninstalling Tux Droid"
+ rm -r $(PREFIX)/share/tuxdroid
+ rm -r $(PREFIX)/lib/tuxdroid
+ rm -r /opt/Python32
+ rm $(PREFIX)/bin/tuxsh
+ rm $(PREFIX)/bin/tuxup
+ rm $(PREFIX)/bin/tux_control_center
+ rm $(PREFIX)/bin/tux_updater
+ rm $(PREFIX)/bin/tuxhttpserver
+ rm $(PREFIX)/bin/dfu-programmer
+ rm $(PREFIX)/bin/tux_wifi_channel
+ rm /etc/udev/rules.d/45-tuxdroid.rules
+ rm /usr/share/applications/controlcenter.desktop
+ rm /usr/share/applications/updater.desktop
+ rm /usr/share/pixmaps/tuxcc.png
+ rm /usr/share/pixmaps/tuxupd.png
+ rm -r /etc/tuxdroid
+ echo Done.
+
Property changes on: software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/Makefile.amd64
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
|
|
From: remi <c2m...@c2...> - 2009-05-29 08:51:33
|
Author: remi
Date: 2009-05-29 10:51:23 +0200 (Fri, 29 May 2009)
New Revision: 4698
Removed:
software_suite_v3/smart-core/smart-server/trunk/content/
Modified:
software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
Log:
* default content of the server (att, scp, scg, tools) is now out of the server directory.
- C:\Program Files\Kysoh\Tuxdroid\resources on Windows
- /usr/share/tuxdroid/resources on Linux
- Server create directories if not exists
Modified: software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py 2009-05-29 08:02:22 UTC (rev 4697)
+++ software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py 2009-05-29 08:51:23 UTC (rev 4698)
@@ -15,7 +15,7 @@
import os
from util.logger import *
-import util.misc.tuxPaths
+from util.misc.tuxPaths import *
# ==============================================================================
# Class to retrieve the py file path.
@@ -78,15 +78,16 @@
TDS_RESOURCES_PATH = os.path.join(TDS_APPLICATION_PATH, 'resources')
# Path of the resources configurations of the httpserver
if os.name == 'nt':
- TDS_RESOURCES_CONF_PATH = os.path.join(TDS_APPLICATION_PATH, "resources_conf")
+ TDS_RESOURCES_CONF_PATH = os.path.join(TUXDROID_BASE_PATH, "configurations", "resources")
else:
TDS_RESOURCES_CONF_PATH = os.path.join("/etc/tuxdroid", "resources_conf")
# Path of the user configurations
if os.name == 'nt':
- TDS_USERS_CONF_PATH = os.path.join(os.path.split(TDS_APPLICATION_PATH)[0],
- "users_conf")
+ TDS_USERS_CONF_PATH = os.path.join(TUXDROID_BASE_PATH, "configurations", "users_conf")
else:
TDS_USERS_CONF_PATH = os.path.join("/etc/tuxdroid", "users_conf")
+# Path of the default content of the server
+TDS_DEFAULT_CONTENT_PATH = os.path.join(TUXDROID_BASE_PATH, "resources")
# ------------------------------------------------------------------------------
# Resources configuration
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-29 08:02:22 UTC (rev 4697)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-29 08:51:23 UTC (rev 4698)
@@ -60,7 +60,8 @@
self.logger.logInfo("Licence : GPL")
self.logger.logInfo("-----------------------------------------------")
# Get the attitunes path
- attitunesPath = os.path.join(TDS_APPLICATION_PATH, "content", "attitunes")
+ attitunesPath = os.path.join(TDS_DEFAULT_CONTENT_PATH, "attitunes")
+ DirectoriesAndFilesTools.MKDirs(attitunesPath)
self.logger.logInfo("Add directory in the container [%s]." %\
attitunesPath)
self.__attitunesContainer.addDirectory(attitunesPath)
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-29 08:02:22 UTC (rev 4697)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-29 08:51:23 UTC (rev 4698)
@@ -67,7 +67,8 @@
language, country, locutor, pitch))
self.__pluginsContainer.setLocales(language, country, locutor, pitch)
# Get the plugins path
- pluginsPath = os.path.join(TDS_APPLICATION_PATH, "content", "plugins")
+ pluginsPath = os.path.join(TDS_DEFAULT_CONTENT_PATH, "plugins")
+ DirectoriesAndFilesTools.MKDirs(pluginsPath)
self.logger.logInfo("Add directory in the container [%s]." %\
pluginsPath)
self.__pluginsContainer.addDirectory(pluginsPath)
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-05-29 08:02:22 UTC (rev 4697)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-05-29 08:51:23 UTC (rev 4698)
@@ -54,7 +54,8 @@
self.__gadgetsContainer.setOnGadgetDeployedCallback(self.__onGadgetDeployed)
self.__gadgetsContainer.setOnGadgetDeploymentErrorCallback(self.__onGadgetDeploymentError)
self.__gadgetsContainer.setOnGadgetUndeployedCallback(self.__onGadgetUndeployed)
- gadgetsPath = os.path.join(TDS_APPLICATION_PATH, "content", "gadgets")
+ gadgetsPath = os.path.join(TDS_DEFAULT_CONTENT_PATH, "gadgets")
+ DirectoriesAndFilesTools.MKDirs(gadgetsPath)
self.logger.logInfo("Add directory in the container [%s]." %\
gadgetsPath)
self.__gadgetsContainer.addDirectory(gadgetsPath)
|
|
From: jerome <c2m...@c2...> - 2009-05-29 08:02:31
|
Author: jerome Date: 2009-05-29 10:02:22 +0200 (Fri, 29 May 2009) New Revision: 4697 Added: software_suite_v3/software/tool/tux_droid_browser/ software_suite_v3/software/tool/tux_droid_browser/windows/ software_suite_v3/software/tool/tux_droid_browser/windows/branches/ software_suite_v3/software/tool/tux_droid_browser/windows/tags/ software_suite_v3/software/tool/tux_droid_browser/windows/trunk/ Log: * Added tux droid browser tool project directories. |
|
From: remi <c2m...@c2...> - 2009-05-29 08:01:47
|
Author: remi Date: 2009-05-29 10:01:39 +0200 (Fri, 29 May 2009) New Revision: 4696 Added: software_suite_v3/smart-core/smart-api/csharp/ Log: * added directory for the csharp api. |
|
From: remi <c2m...@c2...> - 2009-05-28 10:19:43
|
Author: remi
Date: 2009-05-28 12:19:32 +0200 (Thu, 28 May 2009)
New Revision: 4695
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py
Log:
* referenced the scheduler logs in the server web interface
(http://127.0.0.1:270/menu/logs?log_name=index)
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py 2009-05-28 10:11:42 UTC (rev 4694)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py 2009-05-28 10:19:32 UTC (rev 4695)
@@ -266,6 +266,7 @@
'Gadgets_server' : 'logs?log_name=gadgets_server',
'UGC_server' : 'logs?log_name=ugc_server',
'Attitune_manager' : 'logs?log_name=attitune_manager',
+ 'Scheduler' : 'logs?log_name=scs_scheduler',
}
}
return contentStruct
|
|
From: remi <c2m...@c2...> - 2009-05-28 10:11:51
|
Author: remi
Date: 2009-05-28 12:11:42 +0200 (Thu, 28 May 2009)
New Revision: 4694
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
Log:
* updated log level and log target
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-28 10:10:04 UTC (rev 4693)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-28 10:11:42 UTC (rev 4694)
@@ -48,8 +48,8 @@
# Create a logger
self.logger = SimpleLogger("plugins_server")
self.logger.resetLog()
- self.logger.setLevel(LOG_LEVEL_DEBUG)
- self.logger.setTarget(LOG_TARGET_BOTH)
+ self.logger.setLevel(TDS_CONF_LOG_LEVEL)
+ self.logger.setTarget(TDS_CONF_LOG_TARGET)
self.logger.logInfo("-----------------------------------------------")
self.logger.logInfo("Smart-core Plugins Server")
self.logger.logInfo("Licence : GPL")
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-05-28 10:10:04 UTC (rev 4693)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-05-28 10:11:42 UTC (rev 4694)
@@ -39,8 +39,8 @@
# Create a logger
self.logger = SimpleLogger("gadgets_server")
self.logger.resetLog()
- self.logger.setLevel(LOG_LEVEL_DEBUG)
- self.logger.setTarget(LOG_TARGET_BOTH)
+ self.logger.setLevel(TDS_CONF_LOG_LEVEL)
+ self.logger.setTarget(TDS_CONF_LOG_TARGET)
self.logger.logInfo("-----------------------------------------------")
self.logger.logInfo("Smart-core Gadgets Server")
self.logger.logInfo("Licence : GPL")
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py 2009-05-28 10:10:04 UTC (rev 4693)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py 2009-05-28 10:11:42 UTC (rev 4694)
@@ -40,8 +40,8 @@
# Create a logger
self.logger = SimpleLogger("ugc_server")
self.logger.resetLog()
- self.logger.setLevel(LOG_LEVEL_DEBUG)
- self.logger.setTarget(LOG_TARGET_BOTH)
+ self.logger.setLevel(TDS_CONF_LOG_LEVEL)
+ self.logger.setTarget(TDS_CONF_LOG_TARGET)
self.logger.logInfo("-----------------------------------------------")
self.logger.logInfo("Smart-core User Gadgets Server")
self.logger.logInfo("Licence : GPL")
|
|
From: remi <c2m...@c2...> - 2009-05-28 10:10:14
|
Author: remi
Date: 2009-05-28 12:10:04 +0200 (Thu, 28 May 2009)
New Revision: 4693
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/10_resourceScheduler.py
Log:
* added a logger in the scheduler resource
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/10_resourceScheduler.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/10_resourceScheduler.py 2009-05-28 09:44:17 UTC (rev 4692)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/10_resourceScheduler.py 2009-05-28 10:10:04 UTC (rev 4693)
@@ -7,6 +7,7 @@
from util.scheduler.Scheduler import Scheduler
from util.scheduler.Task import *
+from util.logger.SimpleLogger import *
# Scheduler manager events/statuses
ST_NAME_SCM_TASK_ADDED = "scheduler_manager_task_added"
@@ -57,7 +58,19 @@
# Registering the scheduler manager statuses.
for statusName in SW_NAME_SCHEDULER_MANAGER:
eventsHandler.insert(statusName)
+ # Create a logger
+ self.logger = SimpleLogger("scs_scheduler")
+ 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 Scheduler")
+ self.logger.logInfo("Licence : GPL")
+ self.logger.logInfo("-----------------------------------------------")
+ # Start the scheduler
+ self.logger.logInfo("Starting the scheduler.")
self.__scheduler.start()
+ self.logger.logInfo("Scheduler is started.")
# --------------------------------------------------------------------------
# Stop the resource.
@@ -65,7 +78,9 @@
def stop(self):
"""Stop the resource.
"""
+ self.logger.logInfo("Stopping the scheduler.")
self.__scheduler.stop()
+ self.logger.logInfo("Scheduler is stopped.")
# ==========================================================================
# Private methods
@@ -80,7 +95,7 @@
"""
taskName = task.getDescription().getName()
taskDesc = task.getDescription().toString()
- print "Task added :", taskName, taskDesc
+ self.logger.logInfo("Task added [%s] : %s" % (taskName, taskDesc))
resourceStatus.publishEvents(False, ST_NAME_SCM_TASK_ADDED,
[task.getDescription().getId(), task.getDescription().getName()])
@@ -91,7 +106,9 @@
"""Event on task removed.
@param task: Task object.
"""
- print "Task removed :", task.getDescription().toString()
+ taskName = task.getDescription().getName()
+ taskDesc = task.getDescription().toString()
+ self.logger.logInfo("Task removed [%s] : %s" % (taskName, taskDesc))
resourceStatus.publishEvents(False, ST_NAME_SCM_TASK_REMOVED,
[task.getDescription().getId(), task.getDescription().getName()])
@@ -101,7 +118,7 @@
def __onTasksLoaded(self):
"""Event on tasks loaded.
"""
- print "Tasks loaded"
+ self.logger.logInfo("Tasks container is loaded")
resourceStatus.publishEvents(True, ST_NAME_SCM_TASKS_LOADED, ["True",])
# --------------------------------------------------------------------------
@@ -110,7 +127,7 @@
def __onTasksUnloaded(self):
"""Event on tasks unloaded.
"""
- print "Tasks unloaded"
+ self.logger.logInfo("Tasks container is unloaded")
resourceStatus.publishEvents(True, ST_NAME_SCM_TASKS_UNLOADED,
["True",])
|
|
From: remi <c2m...@c2...> - 2009-05-28 09:44:24
|
Author: remi
Date: 2009-05-28 11:44:17 +0200 (Thu, 28 May 2009)
New Revision: 4692
Modified:
software_suite_v3/smart-core/smart-server/trunk/TDSResourcesManager.py
Log:
* updated the resources load (force alphabetic listing)
Modified: software_suite_v3/smart-core/smart-server/trunk/TDSResourcesManager.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TDSResourcesManager.py 2009-05-28 09:41:58 UTC (rev 4691)
+++ software_suite_v3/smart-core/smart-server/trunk/TDSResourcesManager.py 2009-05-28 09:44:17 UTC (rev 4692)
@@ -448,9 +448,11 @@
for path in os.listdir(resourcesPath):
if path.find(".") == -1:
paths.append(os.path.join(resourcesPath, path))
+ paths.sort()
self.__resourcePathsList = paths
for resourcePath in paths:
resourceList = os.listdir(resourcePath)
+ resourceList.sort()
for resource in resourceList:
if resource.lower().rfind(".py") != -1:
resourceFile = os.path.join(resourcePath, resource)
|
|
From: remi <c2m...@c2...> - 2009-05-28 09:42:14
|
Author: remi Date: 2009-05-28 11:41:58 +0200 (Thu, 28 May 2009) New Revision: 4691 Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/01_resourceStatus.py software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/02_resourceAccess.py software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/03_resourceClient.py software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/10_resourceScheduler.py software_suite_v3/smart-core/smart-server/trunk/resources/01_drivers/00_resourceTuxDriver.py software_suite_v3/smart-core/smart-server/trunk/resources/01_drivers/01_resourceTuxOSL.py Log: * typo Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py 2009-05-28 08:31:55 UTC (rev 4690) +++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py 2009-05-28 09:41:58 UTC (rev 4691) @@ -1,38 +1,62 @@ +# 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 + # ============================================================================== -# Server resource. +# ****************************************************************************** +# RESOURCE DECLARATION +# ****************************************************************************** # ============================================================================== -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the resource "server". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSResourceServer(TDSResource): + """Resource server class. + """ - # -------------------------------------------------------------------------- + # ========================================================================== # Inherited methods from TDSResource + # ========================================================================== + # -------------------------------------------------------------------------- - + # Configure the resource. + # -------------------------------------------------------------------------- def configure(self): + """Configure the resource. + """ self.name = "server" self.comment = "Resource to manage the server." self.fileName = RESOURCE_FILENAME - # -------------------------------------------------------------------------- + # ========================================================================== # Public methods + # ========================================================================== + # -------------------------------------------------------------------------- - + # Stop the server. + # -------------------------------------------------------------------------- def stopServer(self): """Stop the server. """ httpServer.stop() + # -------------------------------------------------------------------------- + # Restart the server. + # -------------------------------------------------------------------------- def restartServer(self): """Restart the server. """ # TODO: Restart on linux if os.name == 'nt': - t = threading.Thread(target = os.system, args = ["tuxhttpserver_restart.exe",]) + t = threading.Thread(target = os.system, + args = ["tuxhttpserver_restart.exe",]) t.start() + # -------------------------------------------------------------------------- + # Get the server version. + # -------------------------------------------------------------------------- def getVersion(self): """Get the server version. @return: The server version. @@ -44,19 +68,39 @@ # Register the resource into the resources manager resourcesManager.addResource(resourceServer) -# ------------------------------------------------------------------------------ +# ============================================================================== +# ****************************************************************************** +# SERVICES DECLARATION +# ****************************************************************************** +# ============================================================================== + +# ============================================================================== # Declaration of the service "stop". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceServerStop(TDSService): + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS self.exclusiveExecution = False self.name = "stop" self.comment = "Stop the server." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -66,19 +110,33 @@ # Register the service into the resource resourceServer.addService(TDSServiceServerStop) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "restart". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceServerRestart(TDSService): + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS self.exclusiveExecution = False self.name = "restart" self.comment = "Restart the server." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -88,19 +146,33 @@ # Register the service into the resource resourceServer.addService(TDSServiceServerRestart) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "version". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceServerVersion(TDSService): + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS self.exclusiveExecution = False self.name = "version" self.comment = "Get the server version." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/01_resourceStatus.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/01_resourceStatus.py 2009-05-28 08:31:55 UTC (rev 4690) +++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/01_resourceStatus.py 2009-05-28 09:41:58 UTC (rev 4691) @@ -1,19 +1,33 @@ +# 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 + +SW_NAME_EXTERNAL_STATUS = "external_status" + # ============================================================================== -# Status resource. +# ****************************************************************************** +# RESOURCE DECLARATION +# ****************************************************************************** # ============================================================================== -SW_NAME_EXTERNAL_STATUS = "external_status" - -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the resource "status". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSResourceStatus(TDSResource): + """Resource status class. + """ - # -------------------------------------------------------------------------- + # ========================================================================== # Inherited methods from TDSResource + # ========================================================================== + # -------------------------------------------------------------------------- - + # Configure the resource. + # -------------------------------------------------------------------------- def configure(self): + """Configure the resource. + """ self.name = "status" self.comment = "Resource to manage the statuses and events." self.fileName = RESOURCE_FILENAME @@ -22,11 +36,14 @@ eventsHandler.insert(SW_NAME_EXTERNAL_STATUS) # Registering the "external" status in the default excluded events list clientsManager.addDefaultExcludedEvent(SW_NAME_EXTERNAL_STATUS) - - # -------------------------------------------------------------------------- + + # ========================================================================== # Public methods + # ========================================================================== + # -------------------------------------------------------------------------- - + # Get the last events from a client stack. + # -------------------------------------------------------------------------- def getEvents(self, idClient): """Get the last events from a client stack. - This function only affect the HTTP/REST clients. @@ -37,7 +54,10 @@ if client == None: return [] return client.popEvents() - + + # -------------------------------------------------------------------------- + # Request the current state of a status. + # -------------------------------------------------------------------------- def requestOne(self, statusName): """Request the current state of a status. @param statusName: Name of the status. @@ -61,7 +81,10 @@ 'delay' : 0.0, } return state - + + # -------------------------------------------------------------------------- + # Request the current state of all statuses. + # -------------------------------------------------------------------------- def requestAll(self): """Request the current state of all statuses. @return: The current state of all statuses as dictionary. @@ -73,7 +96,10 @@ if state != None: states.append(state) return states - + + # -------------------------------------------------------------------------- + # Send a free status. + # -------------------------------------------------------------------------- def sendStatus(self, name, value): """Send a free status. - This function inject a status in the events handler. This kind of @@ -94,7 +120,37 @@ clientsManager.pushEvents([statusStruct,]) t = threading.Thread(target = async) t.start() - + + # -------------------------------------------------------------------------- + # Publish events through the events handler. + # -------------------------------------------------------------------------- + def publishEvents(self, sendToClients, eventName, eventValues = []): + """Publish events through the events handler. + @param sendToClients: Send or not the the api clients. + @param eventName: Event name. + @param eventValues: Values as string array. + """ + def async(): + values = "" + for value in eventValues: + values += value + ":" + if len(values) > 0: + values = values[:-1] + eventStruct = { + 'name' : eventName, + 'value' : values, + 'delay' : "0.0", + 'type' : "string" + } + if sendToClients: + clientsManager.pushEvents([eventStruct,]) + eventsHandler.emit(eventName, (values, 0.0)) + t = threading.Thread(target = async) + t.start() + + # -------------------------------------------------------------------------- + # Add an event in the excluded events list of a client. + # -------------------------------------------------------------------------- def addExcludedEvent(self, idClient, eventName): """Add an event in the excluded events list of a client. - The effect is that the event/status will be anymore sent to this @@ -108,7 +164,10 @@ client.addExcludedEvent(eventName) t = threading.Thread(target = async) t.start() - + + # -------------------------------------------------------------------------- + # Remove an event from the excluded events list of a client. + # -------------------------------------------------------------------------- def removeExcludedEvent(self, idClient, eventName): """Remove an event from the excluded events list of a client. @idClient: Client id. @@ -126,19 +185,41 @@ # Register the resource into the resources manager resourcesManager.addResource(resourceStatus) -# ------------------------------------------------------------------------------ +# ============================================================================== +# ****************************************************************************** +# SERVICES DECLARATION +# ****************************************************************************** +# ============================================================================== + +# ============================================================================== # Declaration of the service "events". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceStatusEvents(TDSService): + """Get the last events from a client stack. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_FREE self.exclusiveExecution = False self.name = "events" self.comment = "Get the last events from a client stack." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -154,12 +235,19 @@ # Register the service into the resource resourceStatus.addService(TDSServiceStatusEvents) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "request_one". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceStatusRequestOne(TDSService): + """Request the current state of a status. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'status_name' : 'string', } @@ -168,7 +256,16 @@ self.name = "request_one" self.comment = "Request the current state of a status." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -182,19 +279,35 @@ # Register the service into the resource resourceStatus.addService(TDSServiceStatusRequestOne) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "request_all". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceStatusRequestAll(TDSService): + """Request the current state of all statuses. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS self.exclusiveExecution = False self.name = "request_all" self.comment = "Request the current state of all statuses." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -209,12 +322,19 @@ # Register the service into the resource resourceStatus.addService(TDSServiceStatusRequestAll) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "send". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceStatusSend(TDSService): + """Send a free status. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'name' : 'string', 'value' : 'string', @@ -224,7 +344,16 @@ self.name = "send" self.comment = "Send a free status." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -234,21 +363,37 @@ # Register the service into the resource resourceStatus.addService(TDSServiceStatusSend) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "register_event". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceStatusRegisterEvent(TDSService): + """Add an event in the registered events list of the client. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'event_name' : 'string', } self.minimalUserLevel = TDS_CLIENT_LEVEL_FREE self.exclusiveExecution = False self.name = "register_event" - self.comment = "Add an event inthe registered events list of the client." + self.comment = "Add an event in the registered events list of the client." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -258,12 +403,19 @@ # Register the service into the resource resourceStatus.addService(TDSServiceStatusRegisterEvent) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "unregister_event". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceStatusUnregisterEvent(TDSService): + """Remove an event from the registered events list of the client. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'event_name' : 'string', } @@ -272,7 +424,16 @@ self.name = "unregister_event" self.comment = "Remove an event from the registered events list of the client." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/02_resourceAccess.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/02_resourceAccess.py 2009-05-28 08:31:55 UTC (rev 4690) +++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/02_resourceAccess.py 2009-05-28 09:41:58 UTC (rev 4691) @@ -1,25 +1,42 @@ +# 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 + # ============================================================================== -# Access resource. +# ****************************************************************************** +# RESOURCE DECLARATION +# ****************************************************************************** # ============================================================================== -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the resource "access". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSResourceAccess(TDSResource): + """Resource access class. + """ - # -------------------------------------------------------------------------- + # ========================================================================== # Inherited methods from TDSResource + # ========================================================================== + # -------------------------------------------------------------------------- - + # Configure the resource. + # -------------------------------------------------------------------------- def configure(self): + """Configure the resource. + """ self.name = "access" self.comment = "Resource to manage the access to the robot resources." self.fileName = RESOURCE_FILENAME - # -------------------------------------------------------------------------- + # ========================================================================== # Public methods + # ========================================================================== + # -------------------------------------------------------------------------- - + # Acquire the access to the robot resources. + # -------------------------------------------------------------------------- def acquireAccess(self, idClient, priorityLevel): """Acquire the access to the robot resources. - This function only affects the RESTRICTED clients @@ -36,6 +53,9 @@ return False return client.acquireAccess(priorityLevel) + # -------------------------------------------------------------------------- + # Release the access to the robot resources. + # -------------------------------------------------------------------------- def releaseAccess(self, idClient): """Release the access to the robot resources. - This function only affects the RESTRICTED clients @@ -43,6 +63,9 @@ """ accessManager.releaseAccess(idClient) + # -------------------------------------------------------------------------- + # Forcing to release the access to the robot resources. + # -------------------------------------------------------------------------- def forcingReleaseAccess(self): """Forcing to release the access to the robot resources. - This function only affects the RESTRICTED clients @@ -50,6 +73,9 @@ """ accessManager.releaseAccess() + # -------------------------------------------------------------------------- + # Forcing to acquire the access to the robot resources. + # -------------------------------------------------------------------------- def forcingAcquireAccess(self, idClient, priorityLevel): """Forcing to acquire the access to the robot resources. - This function only affects the RESTRICTED clients @@ -65,6 +91,9 @@ accessManager.releaseAccess() return accessManager.acquireAccess(idClient, priorityLevel) + # -------------------------------------------------------------------------- + # Lock the access to the robot resources. + # -------------------------------------------------------------------------- def lockAccess(self): """Lock the access to the robot resources. - This function only affects the RESTRICTED clients @@ -72,6 +101,9 @@ """ accessManager.setLocked(True) + # -------------------------------------------------------------------------- + # Lock the access to the robot resources. + # -------------------------------------------------------------------------- def unlockAccess(self): """Lock the access to the robot resources. - This function only affects the RESTRICTED clients @@ -84,12 +116,25 @@ # Register the resource into the resources manager resourcesManager.addResource(resourceAccess) -# ------------------------------------------------------------------------------ +# ============================================================================== +# ****************************************************************************** +# SERVICES DECLARATION +# ****************************************************************************** +# ============================================================================== + +# ============================================================================== # Declaration of the service "acquire". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceAccessAcquire(TDSService): + """Acquire the access to the robot resources. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'priority_level' : 'int', } @@ -98,7 +143,16 @@ self.name = "acquire" self.comment = "Acquire the access to the robot resources." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -109,19 +163,35 @@ # Register the service into the resource resourceAccess.addService(TDSServiceAccessAcquire) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "release". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceAccessRelease(TDSService): + """Release the access to the robot resources. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_RESTRICTED self.exclusiveExecution = False self.name = "release" self.comment = "Release the access to the robot resources." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -131,19 +201,35 @@ # Register the service into the resource resourceAccess.addService(TDSServiceAccessRelease) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "forcing_release". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceAccessForcingRelease(TDSService): + """Forcing to release the access to the robot resources. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ROOT self.exclusiveExecution = False self.name = "forcing_release" self.comment = "Forcing to release the access to the robot resources." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -153,12 +239,19 @@ # Register the service into the resource resourceAccess.addService(TDSServiceAccessForcingRelease) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "forcing_acquire". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceAccessForcingAcquire(TDSService): + """Forcing to acquire the access to the robot resources. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'id_client' : 'string', 'priority_level' : 'int', @@ -168,7 +261,16 @@ self.name = "forcing_acquire" self.comment = "Forcing to acquire the access to the robot resources." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -180,19 +282,35 @@ # Register the service into the resource resourceAccess.addService(TDSServiceAccessForcingAcquire) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "lock". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceAccessLock(TDSService): + """Lock the access to the robot resources. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ROOT self.exclusiveExecution = False self.name = "lock" self.comment = "Lock the access to the robot resources." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -202,19 +320,35 @@ # Register the service into the resource resourceAccess.addService(TDSServiceAccessLock) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "unlock". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceAccessUnlock(TDSService): + """Unlock the access to the robot resources. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ROOT self.exclusiveExecution = False self.name = "unlock" - self.comment = "Lock the access to the robot resources." + self.comment = "Unlock the access to the robot resources." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/03_resourceClient.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/03_resourceClient.py 2009-05-28 08:31:55 UTC (rev 4690) +++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/03_resourceClient.py 2009-05-28 09:41:58 UTC (rev 4691) @@ -1,25 +1,42 @@ +# 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 + # ============================================================================== -# Client resource. +# ****************************************************************************** +# RESOURCE DECLARATION +# ****************************************************************************** # ============================================================================== -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the resource "client". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSResourceClient(TDSResource): + """Resource client class. + """ - # -------------------------------------------------------------------------- + # ========================================================================== # Inherited methods from TDSResource + # ========================================================================== + # -------------------------------------------------------------------------- - + # Configure the resource. + # -------------------------------------------------------------------------- def configure(self): + """Configure the resource. + """ self.name = "client" self.comment = "Resource to manage the clients." self.fileName = RESOURCE_FILENAME - # -------------------------------------------------------------------------- + # ========================================================================== # Public methods + # ========================================================================== + # -------------------------------------------------------------------------- - + # Create a new client. + # -------------------------------------------------------------------------- def createClient(self, clientName, clientLevel): """Create a new client. @clientName: Client name. @@ -35,6 +52,9 @@ idClient = clientsManager.addRESTClient(clientName, clientLevel) return idClient + # -------------------------------------------------------------------------- + # Destroy a client. + # -------------------------------------------------------------------------- def destroyClient(self, idClient): """Destroy a client. - This function only affect the HTTP/REST clients. @@ -42,6 +62,9 @@ """ clientsManager.removeRESTClient(idClient) + # -------------------------------------------------------------------------- + # Get the clients listing with their informations. + # -------------------------------------------------------------------------- def listing(self): """Get the clients listing with their informations. @return: A dictionary. @@ -58,12 +81,25 @@ # Register the resource into the resources manager resourcesManager.addResource(resourceClient) -# ------------------------------------------------------------------------------ +# ============================================================================== +# ****************************************************************************** +# SERVICES DECLARATION +# ****************************************************************************** +# ============================================================================== + +# ============================================================================== # Declaration of the service "create". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceClientCreate(TDSService): + """Create a client. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'name' : 'string', 'level' : 'uint8', @@ -73,7 +109,16 @@ self.name = "create" self.comment = "Create a client." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -89,19 +134,35 @@ # Register the service into the resource resourceClient.addService(TDSServiceClientCreate) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "destroy". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceClientDestroy(TDSService): + """Destroy a client. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_FREE self.exclusiveExecution = False self.name = "destroy" self.comment = "Destroy a client." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) @@ -111,19 +172,35 @@ # Register the service into the resource resourceClient.addService(TDSServiceClientDestroy) -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "listing". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceClientListing(TDSService): + """Get the clients listing with their informations. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_FREE self.exclusiveExecution = False self.name = "listing" self.comment = "Get the clients listing with their informations." + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = self.getDefaultContentStruct() contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS) Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py =================================================================== --- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py 2009-05-28 08:31:55 UTC (rev 4690) +++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py 2009-05-28 09:41:58 UTC (rev 4691) @@ -1,17 +1,31 @@ +# 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 + # ============================================================================== -# Menu resource. +# ****************************************************************************** +# RESOURCE DECLARATION +# ****************************************************************************** # ============================================================================== -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the resource "menu". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSResourceMenu(TDSResource): + """Resource menu class. + """ - # -------------------------------------------------------------------------- + # ========================================================================== # Inherited methods from TDSResource + # ========================================================================== + # -------------------------------------------------------------------------- - + # Configure the resource. + # -------------------------------------------------------------------------- def configure(self): + """Configure the resource. + """ self.name = "menu" self.comment = "Menu resource." self.fileName = RESOURCE_FILENAME @@ -21,12 +35,25 @@ # Register the resource into the resources manager resourcesManager.addResource(resourceMenu) -# ------------------------------------------------------------------------------ +# ============================================================================== +# ****************************************************************************** +# SERVICES DECLARATION +# ****************************************************************************** +# ============================================================================== + +# ============================================================================== # Declaration of the service "index". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceMenuIndex(TDSService): + """Main menu of the server. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = {} self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS self.exclusiveExecution = False @@ -35,12 +62,27 @@ self.haveXsl = True self.xslPath = "/data/web_interface/server_menu/xsl/menu.xsl" + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() contentStruct = {'root' : self.__createXmlIndex()} return headersStruct, contentStruct + # -------------------------------------------------------------------------- + # Create xml data dict for the menu index. + # -------------------------------------------------------------------------- def __createXmlIndex(self): + """Create xml data dict for the menu index. + @return: The xml content as dictionary. + """ contentStruct = { 'title' : 'Tux Droid Server V %s' % serverVersion, 'section' : 'Index', @@ -57,12 +99,19 @@ # Bind the root url to this service resourcesManager.addBinding("ROOT", "menu", "index") -# ------------------------------------------------------------------------------ +# ============================================================================== # Declaration of the service "resources". -# ------------------------------------------------------------------------------ +# ============================================================================== class TDSServiceMenuResources(TDSService): + """Resources menu. + """ + # -------------------------------------------------------------------------- + # Configure the service. + # -------------------------------------------------------------------------- def configure(self): + """Configure the service. + """ self.parametersDict = { 'resource_name' : 'string', } @@ -73,7 +122,16 @@ self.haveXsl = True self.xslPath = "/data/web_interface/server_menu/xsl/menu.xsl" + # -------------------------------------------------------------------------- + # Execute the service. + # -------------------------------------------------------------------------- def execute(self, id, parameters): + """Execute the service. + @param id: Client identifier. + @param parameters: Request parameters. + @return: The headers as list and the content dictionary of the request + answer. + """ headersStruct = self.getDefaultHeadersStruct() if parameters['resource_name'] == 'index': contentStruct = {'root' : self.__createXmlIndex()} @@ -83,7 +141,13 @@ } return headersStruct, contentStruct + # -------------------------------------------------------------------------- + # Create xml data dict for the resources index. + # -------------------------------------------------------------------------- def __createXmlIndex(self): + """Create xml data dict for the resources index. + @return: The xml content as dictionary. + """ self.xslPath = "/data/web_interface/server_menu/xsl/menu_resources.xsl" contentStruct = { 'title' : 'Tux Droid Server V %s' % serverVersion, @@ -104,7 +168,14 @@ contentStruct['items']["Layer_%s" % path][resourceName] = url return contentStruct + # -------------------------------------------------------------------------- + # Create xml data dict for a resource. + # -------------------------------------------------------------------------- def __createXmlResource(self, resourceName): + """Create xml data dict for a resource. + @resourceName: Name of the resource. + @return: The xml content as dictionary. + """ self.xslPath = "/data/web_interface/server_menu/xsl/resource.xsl" resource = resourcesManager.getResource(resourceName) if resource == None: @@ -127,12 +198,19 @@ # Register the service into the resource resourceMenu.addService(TDSServiceMenuResources) -# ---------------... [truncated message content] |
|
From: ks156 <c2m...@c2...> - 2009-05-28 08:32:06
|
Author: ks156
Date: 2009-05-28 10:31:55 +0200 (Thu, 28 May 2009)
New Revision: 4690
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py
Log:
* Fixed a bug with the locale :
If the locale can't be detected by python, the 'en_US' default value is used.
Modified: software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py 2009-05-27 14:08:31 UTC (rev 4689)
+++ software_suite_v3/smart-core/smart-server/trunk/util/i18n/I18n.py 2009-05-28 08:31:55 UTC (rev 4690)
@@ -24,6 +24,8 @@
"""Constructor of the class.
"""
self.__locale = locale.getdefaultlocale()[0]
+ if self.__locale == None:
+ self.__locale = "en_US"
self.__language = self.__locale.split("_")[0]
self.__country = self.__locale.split("_")[1]
self.__poDirectory = None
|
|
From: remi <c2m...@c2...> - 2009-05-27 14:08:36
|
Author: remi
Date: 2009-05-27 16:08:31 +0200 (Wed, 27 May 2009)
New Revision: 4689
Added:
software_suite_v3/smart-core/smart-server/trunk/resources/04_user_configurations/00_resourceUsers.py
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
Log:
* added base to support multi-users
* updated plugins, gadgets and ugc resources to be configured for the current user
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-27 14:06:34 UTC (rev 4688)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-27 14:08:31 UTC (rev 4689)
@@ -77,7 +77,7 @@
def stop(self):
self.logger.logInfo("Undeploy the plugins container")
- self.__PluginsContainer.undeploy()
+ self.__pluginsContainer.undeploy()
# --------------------------------------------------------------------------
# Plugins container events
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-05-27 14:06:34 UTC (rev 4688)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/02_resourceGagdetsServer.py 2009-05-27 14:08:31 UTC (rev 4689)
@@ -46,7 +46,7 @@
self.logger.logInfo("Licence : GPL")
self.logger.logInfo("-----------------------------------------------")
- def start(self):
+ def startServer(self):
# Create a gadgets container
self.__gadgetsContainer = GadgetsContainer(resourcePluginsServer.getPluginsContainer())
self.__gadgetsContainer.setOnDirectoryDeployedCallback(self.__onDirectoryDeployed)
@@ -64,7 +64,7 @@
def stop(self):
self.logger.logInfo("Undeploy the gadgets container")
- self.__GadgetsContainer.undeploy()
+ self.__gadgetsContainer.undeploy()
# --------------------------------------------------------------------------
# Gadgets container events
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py 2009-05-27 14:06:34 UTC (rev 4688)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py 2009-05-27 14:08:31 UTC (rev 4689)
@@ -47,13 +47,12 @@
self.logger.logInfo("Licence : GPL")
self.logger.logInfo("-----------------------------------------------")
- def start(self):
+ def startServer(self, ugcPath):
# Create a UGC container and start the UGC server
self.__ugcContainer = UgcContainer(resourceGadgetsServer.getGadgetsContainer())
self.__ugcContainer.setOnUgcDeployedCallback(self.__onUgcDeployed)
self.__ugcContainer.setOnUgcDeploymentErrorCallback(self.__onUgcDeploymentError)
self.__ugcContainer.setOnUgcUndeployedCallback(self.__onUgcUndeployed)
- ugcPath = os.path.join(TDS_APPLICATION_PATH, "content", "ugcs")
self.logger.logInfo("Set directory in the UGC container [%s]." % ugcPath)
self.__ugcContainer.setDirectory(ugcPath)
self.logger.logInfo("Deploy the UGC container.")
Added: software_suite_v3/smart-core/smart-server/trunk/resources/04_user_configurations/00_resourceUsers.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/04_user_configurations/00_resourceUsers.py (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/04_user_configurations/00_resourceUsers.py 2009-05-27 14:08:31 UTC (rev 4689)
@@ -0,0 +1,176 @@
+# ==============================================================================
+# Users resource.
+# ==============================================================================
+
+from util.misc.tuxPaths import TUXDROID_LANGUAGE
+from util.misc.tuxPaths import TUXDROID_DEFAULT_LOCUTOR
+
+# ------------------------------------------------------------------------------
+# Declaration of the resource "users".
+# ------------------------------------------------------------------------------
+class TDSResourceUsers(TDSResource):
+
+ # --------------------------------------------------------------------------
+ # Inherited methods from TDSResource
+ # --------------------------------------------------------------------------
+
+ def configure(self):
+ self.name = "users"
+ self.comment = "Resource to manage the users configurations."
+ self.fileName = RESOURCE_FILENAME
+ # Ensure that the users_conf directory exists
+ DirectoriesAndFilesTools.MKDirs(TDS_USERS_CONF_PATH)
+
+ def start(self):
+ # Read the last logged user name
+ self.__lastUser = self.getLastLoggedUserName()
+ # Create user directories if not exists
+ self.createUserIfNotExists()
+ # Load the user configuration
+ self.__userConfiguration = self.loadUserConfiguration()
+
+ # --------------------------------------------------------------------------
+ # Shared methods
+ # --------------------------------------------------------------------------
+
+ def getLastLoggedUserName(self):
+ """Get the name of the last logged user.
+ @return: A string.
+ """
+ lastUserConf = os.path.join(TDS_USERS_CONF_PATH, "last_user.name")
+ if not os.path.isfile(lastUserConf):
+ f = open(lastUserConf, "w")
+ f.write("default")
+ f.close()
+ f = open(lastUserConf, "r")
+ result = f.read()
+ f.close()
+ return result
+
+ def createUserIfNotExists(self):
+ """Create the user configuration of the last selected user if not
+ exists.
+ """
+ userName = self.__lastUser
+ DirectoriesAndFilesTools.MKDirs(os.path.join(TDS_USERS_CONF_PATH,
+ userName))
+ DirectoriesAndFilesTools.MKDirs(os.path.join(TDS_USERS_CONF_PATH,
+ userName, "gadgets"))
+ DirectoriesAndFilesTools.MKDirs(os.path.join(TDS_USERS_CONF_PATH,
+ userName, "attitunes"))
+ DirectoriesAndFilesTools.MKDirs(os.path.join(TDS_USERS_CONF_PATH,
+ userName, "ugcs"))
+
+ def loadUserConfiguration(self):
+ """Load an user configuration.
+ @return: The user configuration as dictionary.
+ """
+ userName = self.__lastUser
+ userConfFile = os.path.join(TDS_USERS_CONF_PATH, userName, "user.conf")
+ if not os.path.isfile(userConfFile):
+ # Create default configuration
+ splitedLC = TUXDROID_LANGUAGE.split("_")
+ language = splitedLC[0]
+ if len(splitedLC) > 1:
+ country = splitedLC[1]
+ else:
+ country = language.upper()
+ locutor = TUXDROID_DEFAULT_LOCUTOR
+ pitch = 130
+ defaultConfDict = {
+ 'name' : userName,
+ 'login' : None,
+ 'password' : None,
+ 'language1' : language,
+ 'language2' : language,
+ 'country' : country,
+ 'locutor1' : locutor,
+ 'locutor2' : locutor,
+ 'pitch' : pitch,
+ }
+ f = open(userConfFile, "w")
+ f.write(str(defaultConfDict))
+ f.close()
+ # Load user configuration
+ f = open(userConfFile, "r")
+ result = eval(f.read())
+ f.close()
+ # Reference the user attitunes directory
+ resourceAttituneManager.getAttitunesContainer().addDirectory(
+ os.path.join(TDS_USERS_CONF_PATH, userName, "attitunes"))
+ # Set locales in the plugins server
+ resourcePluginsServer.getPluginsContainer().setLocales(
+ result['language1'], result['country'],
+ result['locutor1'], result['pitch'])
+ # Start gadgets server
+ resourceGadgetsServer.startServer()
+ # Reference user gadgets directory
+ resourceGadgetsServer.getGadgetsContainer().addDirectory(
+ os.path.join(TDS_USERS_CONF_PATH, userName, "gadgets"))
+ # Start ugc server
+ resourceUgcServer.startServer(os.path.join(TDS_USERS_CONF_PATH,
+ userName, "ugcs"))
+ return result
+
+ def getCurrentUserConfiguration(self):
+ """Get the current user configuration.
+ @return: The current user configuration as string.
+ """
+ return self.__userConfiguration
+
+ def updateCurrentUserConfiguration(self, userConfiguration):
+ """Update the current user configuration.
+ @param userConfiguration: New configuration as dictionary.
+ - This function will restart the server.
+ """
+ # Update configuration file
+ userConfFile = os.path.join(TDS_USERS_CONF_PATH, self.__lastUser,
+ "user.conf")
+ f = open(userConfFile, "w")
+ f.write(str(userConfiguration))
+ f.close()
+ # Restart the server
+ resourceServer.restartServer()
+
+ def switchUser(self, userName):
+ """Switch to an other user.
+ @param userName: Name of the requested user.
+ - This function will restart the server.
+ """
+ # Store the requested user name
+ lastUserConf = os.path.join(TDS_USERS_CONF_PATH, "last_user.name")
+ f = open(lastUserConf, "w")
+ f.write(userName)
+ f.close()
+ # Restart the server
+ resourceServer.restartServer()
+
+# Create an instance of the resource
+resourceUsers = TDSResourceUsers("resourceUsers")
+# Register the resource into the resources manager
+resourcesManager.addResource(resourceUsers)
+
+# ------------------------------------------------------------------------------
+# Declaration of the service "switch_user".
+# ------------------------------------------------------------------------------
+class TDSServiceUsersSwitchUser(TDSService):
+
+ def configure(self):
+ self.parametersDict = {
+ 'name' : 'string',
+ }
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "switch_user"
+ self.comment = "Switch to another user."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ name = parameters['name']
+ resourceUsers.switchUser(name)
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceUsers.addService(TDSServiceUsersSwitchUser)
Property changes on: software_suite_v3/smart-core/smart-server/trunk/resources/04_user_configurations/00_resourceUsers.py
___________________________________________________________________
Name: svn:keywords
+ Id
|
|
From: remi <c2m...@c2...> - 2009-05-27 14:06:43
|
Author: remi
Date: 2009-05-27 16:06:34 +0200 (Wed, 27 May 2009)
New Revision: 4688
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py
Log:
* added command to restart the server
* TODO : linux.
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py 2009-05-27 09:49:31 UTC (rev 4687)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/00_resourceServer.py 2009-05-27 14:06:34 UTC (rev 4688)
@@ -25,6 +25,14 @@
"""
httpServer.stop()
+ def restartServer(self):
+ """Restart the server.
+ """
+ # TODO: Restart on linux
+ if os.name == 'nt':
+ t = threading.Thread(target = os.system, args = ["tuxhttpserver_restart.exe",])
+ t.start()
+
def getVersion(self):
"""Get the server version.
@return: The server version.
@@ -59,6 +67,28 @@
resourceServer.addService(TDSServiceServerStop)
# ------------------------------------------------------------------------------
+# Declaration of the service "restart".
+# ------------------------------------------------------------------------------
+class TDSServiceServerRestart(TDSService):
+
+ def configure(self):
+ self.parametersDict = {}
+ self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+ self.exclusiveExecution = False
+ self.name = "restart"
+ self.comment = "Restart the server."
+
+ def execute(self, id, parameters):
+ headersStruct = self.getDefaultHeadersStruct()
+ contentStruct = self.getDefaultContentStruct()
+ contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ resourceServer.restartServer()
+ return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceServer.addService(TDSServiceServerRestart)
+
+# ------------------------------------------------------------------------------
# Declaration of the service "version".
# ------------------------------------------------------------------------------
class TDSServiceServerVersion(TDSService):
|
|
From: remi <c2m...@c2...> - 2009-05-27 09:49:48
|
Author: remi
Date: 2009-05-27 11:49:31 +0200 (Wed, 27 May 2009)
New Revision: 4687
Modified:
software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py
Log:
* added a constant for the path of the users configurations
Modified: software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py 2009-05-27 09:28:19 UTC (rev 4686)
+++ software_suite_v3/smart-core/smart-server/trunk/TDSConfiguration.py 2009-05-27 09:49:31 UTC (rev 4687)
@@ -81,6 +81,12 @@
TDS_RESOURCES_CONF_PATH = os.path.join(TDS_APPLICATION_PATH, "resources_conf")
else:
TDS_RESOURCES_CONF_PATH = os.path.join("/etc/tuxdroid", "resources_conf")
+# Path of the user configurations
+if os.name == 'nt':
+ TDS_USERS_CONF_PATH = os.path.join(os.path.split(TDS_APPLICATION_PATH)[0],
+ "users_conf")
+else:
+ TDS_USERS_CONF_PATH = os.path.join("/etc/tuxdroid", "users_conf")
# ------------------------------------------------------------------------------
# Resources configuration
|
|
From: remi <c2m...@c2...> - 2009-05-27 09:28:30
|
Author: remi
Date: 2009-05-27 11:28:19 +0200 (Wed, 27 May 2009)
New Revision: 4686
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
Log:
* removed useless service from the attitune manager resource
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-27 09:26:05 UTC (rev 4685)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-27 09:28:19 UTC (rev 4686)
@@ -282,48 +282,6 @@
resourcesManager.addResource(resourceAttituneManager)
# ------------------------------------------------------------------------------
-# Declaration of the service "start".
-# ------------------------------------------------------------------------------
-class TDSServiceAttituneManagerStart(TDSService):
-
- def configure(self):
- self.parametersDict = {
- 'attitunes_path' : 'string',
- }
- self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
- self.exclusiveExecution = False
- self.name = "start"
- self.comment = "Start the attitune manager."
-
- def execute(self, id, parameters):
- headersStruct = self.getDefaultHeadersStruct()
- contentStruct = self.getDefaultContentStruct()
- contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
- # Check the directory
- if not os.path.isdir(parameters['attitunes_path']):
- contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
- else:
- # Start the attitune manager
- attitunesContainer = resourceAttituneManager.getAttitunesContainer()
- resourceAttituneManager.logger.logInfo("Undeploy the attitunes container.")
- attitunesContainer.undeploy()
- resourceAttituneManager.logger.logInfo("Attitunes container is undeployed.")
- for directory in attitunesContainer.getDirectories():
- resourceAttituneManager.logger.logInfo("Remove directory from the container [%s]." %\
- directory)
- attitunesContainer.removeDirectory(directory)
- resourceAttituneManager.logger.logInfo("Add directory in the container [%s]." %\
- parameters['attitunes_path'])
- attitunesContainer.addDirectory(parameters['attitunes_path'])
- resourceAttituneManager.logger.logInfo("Deploy the attitunes container.")
- attitunesContainer.deploy()
- resourceAttituneManager.logger.logInfo("Attitunes container is deployed.")
- return headersStruct, contentStruct
-
-# Register the service into the resource
-resourceAttituneManager.addService(TDSServiceAttituneManagerStart)
-
-# ------------------------------------------------------------------------------
# Declaration of the service "attitunes_infos".
# ------------------------------------------------------------------------------
class TDSServiceAttituneManagerAttitunesInfos(TDSService):
|
|
From: remi <c2m...@c2...> - 2009-05-27 09:26:19
|
Author: remi
Date: 2009-05-27 11:26:05 +0200 (Wed, 27 May 2009)
New Revision: 4685
Added:
software_suite_v3/smart-core/smart-server/trunk/content/attitunes/
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py
Log:
* added a directory in the server for the attitunes
* updated the attitune manager to check this directory
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-27 08:33:42 UTC (rev 4684)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-27 09:26:05 UTC (rev 4685)
@@ -59,6 +59,14 @@
self.logger.logInfo("Tux Droid Attitune Manager")
self.logger.logInfo("Licence : GPL")
self.logger.logInfo("-----------------------------------------------")
+ # Get the attitunes path
+ attitunesPath = os.path.join(TDS_APPLICATION_PATH, "content", "attitunes")
+ self.logger.logInfo("Add directory in the container [%s]." %\
+ attitunesPath)
+ self.__attitunesContainer.addDirectory(attitunesPath)
+ self.logger.logInfo("Deploy the attitunes container.")
+ self.__attitunesContainer.deploy()
+ self.logger.logInfo("Attitunes container is deployed.")
def stop(self):
self.logger.logInfo("Undeploy the attitunes container")
@@ -196,6 +204,7 @@
except:
result = False
filesCacheManager.destroyFileCache(cFile)
+ self.__attitunesContainer.check()
return result
def removeAttituneFromContainer(self, attituneName):
@@ -211,6 +220,7 @@
attFile = attitune.getAttFile()
# Remove the att file
DirectoriesAndFilesTools.RMFile(attFile)
+ self.__attitunesContainer.check()
return True
return False
Modified: software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py 2009-05-27 08:33:42 UTC (rev 4684)
+++ software_suite_v3/smart-core/smart-server/trunk/util/attitunes/AttitunesContainer.py 2009-05-27 09:26:05 UTC (rev 4685)
@@ -71,7 +71,7 @@
def deploy(self):
"""Deploy the setted attitunes directories.
"""
- self.__autoDeployer.deploy()
+ self.__autoDeployer.deploy(False)
# --------------------------------------------------------------------------
# Undeploy the setted attitunes directories.
@@ -82,6 +82,14 @@
self.__autoDeployer.undeploy()
# --------------------------------------------------------------------------
+ # Check the attitunes directories manually.
+ # --------------------------------------------------------------------------
+ def check(self):
+ """Check the attitunes directories manually.
+ """
+ self.__autoDeployer.check()
+
+ # --------------------------------------------------------------------------
# Get if the container is deployed or not.
# --------------------------------------------------------------------------
def isDeployed(self):
|
|
From: remi <c2m...@c2...> - 2009-05-27 08:34:01
|
Author: remi
Date: 2009-05-27 10:33:42 +0200 (Wed, 27 May 2009)
New Revision: 4684
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
Log:
* removed useless events
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-27 08:29:03 UTC (rev 4683)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/00_resourceAttituneManager.py 2009-05-27 08:33:42 UTC (rev 4684)
@@ -7,7 +7,6 @@
from util.logger.SimpleLogger import *
# Attitune manager events/statuses
-ST_NAME_AM_RUN = "attitune_manager_run"
ST_NAME_AM_CONTAINER_DEPLOYED = "attitune_manager_container_deployed"
ST_NAME_AM_CONTAINER_ERROR = "attitune_manager_container_error"
ST_NAME_AM_ATTITUNE_LOADED = "attitune_manager_attitune_loaded"
@@ -17,7 +16,6 @@
# Attitune manager events/statuses list
SW_NAME_ATTITUNE_MANAGER = [
- ST_NAME_AM_RUN, # Is sent to clients
ST_NAME_AM_CONTAINER_DEPLOYED, # Is sent to clients
ST_NAME_AM_CONTAINER_ERROR, # Is not sent to clients
ST_NAME_AM_ATTITUNE_LOADED, # Is not sent to clients
@@ -52,7 +50,6 @@
# Registering the attitune manager statuses.
for statusName in SW_NAME_ATTITUNE_MANAGER:
eventsHandler.insert(statusName)
- eventsHandler.getEventHandler(ST_NAME_AM_RUN).updateState("False")
# Create a logger
self.logger = SimpleLogger("attitune_manager")
self.logger.resetLog()
@@ -66,7 +63,6 @@
def stop(self):
self.logger.logInfo("Undeploy the attitunes container")
self.__attitunesContainer.undeploy()
- self.__publishEvents(True, ST_NAME_AM_RUN, ["False",])
# --------------------------------------------------------------------------
# Attitunes container events
@@ -299,7 +295,6 @@
else:
# Start the attitune manager
attitunesContainer = resourceAttituneManager.getAttitunesContainer()
- resourceAttituneManager.publishEvents(True, ST_NAME_AM_RUN, ["False",])
resourceAttituneManager.logger.logInfo("Undeploy the attitunes container.")
attitunesContainer.undeploy()
resourceAttituneManager.logger.logInfo("Attitunes container is undeployed.")
@@ -313,7 +308,6 @@
resourceAttituneManager.logger.logInfo("Deploy the attitunes container.")
attitunesContainer.deploy()
resourceAttituneManager.logger.logInfo("Attitunes container is deployed.")
- resourceAttituneManager.publishEvents(True, ST_NAME_AM_RUN, ["True",])
return headersStruct, contentStruct
# Register the service into the resource
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-27 08:29:03 UTC (rev 4683)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-27 08:33:42 UTC (rev 4684)
@@ -8,20 +8,18 @@
from util.misc.tuxPaths import TUXDROID_DEFAULT_LOCUTOR
from util.logger.SimpleLogger import *
-# Framework events/statuses
-ST_NAME_PS_RUN = "plugins_server_run"
+# Plugins server events/statuses
ST_NAME_PS_CONTAINER_DEPLOYED = "plugins_server_container_deployed"
ST_NAME_PS_CONTAINER_ERROR = "plugins_server_container_error"
ST_NAME_PS_PLUGIN_LOADED = "plugins_server_plugin_loaded"
ST_NAME_PS_PLUGIN_UNLOADED = "plugins_server_plugin_unloaded"
-# Framework events/statuses list
+# Plugins server events/statuses list
SW_NAME_PLUGINS_SERVER = [
- ST_NAME_PS_RUN, # Is sent to clients
- ST_NAME_PS_CONTAINER_DEPLOYED, # Is sent to clients
- ST_NAME_PS_CONTAINER_ERROR, # Is not sent to clients
- ST_NAME_PS_PLUGIN_LOADED, # Is not sent to clients
- ST_NAME_PS_PLUGIN_UNLOADED, # Is not sent to clients
+ ST_NAME_PS_CONTAINER_DEPLOYED,
+ ST_NAME_PS_CONTAINER_ERROR,
+ ST_NAME_PS_PLUGIN_LOADED,
+ ST_NAME_PS_PLUGIN_UNLOADED,
]
# ------------------------------------------------------------------------------
@@ -47,7 +45,6 @@
# Registering the plugins server statuses.
for statusName in SW_NAME_PLUGINS_SERVER:
eventsHandler.insert(statusName)
- eventsHandler.getEventHandler(ST_NAME_PS_RUN).updateState("False")
# Create a logger
self.logger = SimpleLogger("plugins_server")
self.logger.resetLog()
@@ -77,12 +74,10 @@
self.logger.logInfo("Deploy the plugins container.")
self.__pluginsContainer.deploy()
self.logger.logInfo("Plugins container is deployed.")
- self.__publishEvents(True, ST_NAME_PS_RUN, ["True",])
def stop(self):
self.logger.logInfo("Undeploy the plugins container")
self.__PluginsContainer.undeploy()
- self.__publishEvents(True, ST_NAME_PS_RUN, ["False",])
# --------------------------------------------------------------------------
# Plugins container events
|
|
From: remi <c2m...@c2...> - 2009-05-27 08:29:14
|
Author: remi
Date: 2009-05-27 10:29:03 +0200 (Wed, 27 May 2009)
New Revision: 4683
Modified:
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
Log:
* linked plugin/gadget message to the TTS stack
* removed useless events
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-26 17:16:12 UTC (rev 4682)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/01_resourcePluginsServer.py 2009-05-27 08:29:03 UTC (rev 4683)
@@ -14,28 +14,14 @@
ST_NAME_PS_CONTAINER_ERROR = "plugins_server_container_error"
ST_NAME_PS_PLUGIN_LOADED = "plugins_server_plugin_loaded"
ST_NAME_PS_PLUGIN_UNLOADED = "plugins_server_plugin_unloaded"
-ST_NAME_PS_PLUGIN_MESSAGE = "plugins_server_plugin_message"
-ST_NAME_PS_PLUGIN_ERROR = "plugins_server_plugin_error"
-ST_NAME_PS_PLUGIN_TRACE = "plugins_server_plugin_trace"
-ST_NAME_PS_PLUGIN_RESULT = "plugins_server_plugin_result"
-ST_NAME_PS_PLUGIN_NOTIFICATION = "plugins_server_plugin_notification"
-ST_NAME_PS_PLUGIN_STARTING = "plugins_server_plugin_starting"
-ST_NAME_PS_PLUGIN_STOPPED = "plugins_server_plugin_stopped"
# Framework events/statuses list
SW_NAME_PLUGINS_SERVER = [
ST_NAME_PS_RUN, # Is sent to clients
ST_NAME_PS_CONTAINER_DEPLOYED, # Is sent to clients
- ST_NAME_PS_PLUGIN_STARTING, # Is sent to clients
- ST_NAME_PS_PLUGIN_STOPPED, # Is sent to clients
ST_NAME_PS_CONTAINER_ERROR, # Is not sent to clients
ST_NAME_PS_PLUGIN_LOADED, # Is not sent to clients
ST_NAME_PS_PLUGIN_UNLOADED, # Is not sent to clients
- ST_NAME_PS_PLUGIN_MESSAGE, # Is not sent to clients
- ST_NAME_PS_PLUGIN_ERROR, # Is not sent to clients
- ST_NAME_PS_PLUGIN_TRACE, # Is not sent to clients
- ST_NAME_PS_PLUGIN_RESULT, # Is not sent to clients
- ST_NAME_PS_PLUGIN_NOTIFICATION, # Is not sent to clients
]
# ------------------------------------------------------------------------------
@@ -164,8 +150,6 @@
pitch = instanceParameters['pitch']
self.logger.logDebug("Plugin NOTIFICATION [%s] (%s : %s)" % (
plugin.getDescription().getName(), messageId, messageStr))
- self.__publishEvents(False, ST_NAME_PS_PLUGIN_NOTIFICATION, [uuid, "0",
- locutor, pitch, messageId, messageStr])
def __onPluginMessage(self, plugin, instanceParameters, message):
uuid = plugin.getDescription().getUuid()
@@ -173,8 +157,7 @@
pitch = instanceParameters['pitch']
self.logger.logDebug("Plugin MESSAGE [%s] (%s)" % (
plugin.getDescription().getName(), message))
- self.__publishEvents(False, ST_NAME_PS_PLUGIN_MESSAGE, [uuid, "0",
- locutor, pitch, message])
+ self.__pushPluginMessageInTtsStack(uuid, message, locutor, int(pitch))
def __onPluginError(self, plugin, instanceParameters, *messagesList):
messageStr = ""
@@ -182,8 +165,6 @@
messageStr += message
self.logger.logError("Plugin ERROR [%s] (%s)" % (
plugin.getDescription().getName(), messageStr))
- self.__publishEvents(False, ST_NAME_PS_PLUGIN_ERROR, [
- plugin.getDescription().getUuid(), "0", messageStr])
def __onPluginTrace(self, plugin, instanceParameters, *messagesList):
messageStr = ""
@@ -191,21 +172,17 @@
messageStr += message
self.logger.logDebug("Plugin TRACE [%s] (%s)" % (
plugin.getDescription().getName(), messageStr))
- self.__publishEvents(False, ST_NAME_PS_PLUGIN_TRACE, [
- plugin.getDescription().getUuid(), "0", messageStr])
def __onPluginResult(self, plugin, instanceParameters, pluginResult):
self.logger.logDebug("Plugin RESULT [%s] (%s)" % (
plugin.getDescription().getName(), str(pluginResult)))
- self.__publishEvents(False, ST_NAME_PS_PLUGIN_RESULT, [
- plugin.getDescription().getUuid(), "0", str(pluginResult)])
def __onPluginStarting(self, plugin, instanceParameters, instanceCommand,
instanceIsDaemon):
uuid = plugin.getDescription().getUuid()
self.logger.logInfo("Plugin starting [%s] (%s)" % (
plugin.getDescription().getName(), str(instanceParameters)))
- self.__publishEvents(True, ST_NAME_PS_PLUGIN_STARTING, [uuid, "PS"])
+ self.__pluginStopEventFromStartEvent(uuid)
def __onPluginStopped(self, plugin, instanceParameters, instanceCommand,
instanceIsDaemon):
@@ -213,15 +190,39 @@
if instanceIsDaemon:
self.logger.logInfo("Plugin stopped [%s]" % (
plugin.getDescription().getName()))
- self.__publishEvents(True, ST_NAME_PS_PLUGIN_STOPPED, [uuid, "PS"])
- self.__publishEvents(True, ST_NAME_PS_PLUGIN_STOPPED, [uuid, "TTS"])
else:
- self.__publishEvents(True, ST_NAME_PS_PLUGIN_STOPPED, [uuid, "PS"])
+ pass
# --------------------------------------------------------------------------
# Private methods
# --------------------------------------------------------------------------
+ def __pushPluginMessageInTtsStack(self, uuid, message, locutor, pitch):
+ resourceTTS.stackPush(message, locutor, pitch, uuid)
+
+ def __pluginStopEventFromStartEvent(self, uuid):
+ plugin = self.__pluginsContainer.getPluginByUuid(uuid)
+ if plugin == None:
+ return
+ if plugin.instanceIsDaemon():
+ return
+ def async():
+ pluginName = plugin.getDescription().getName()
+ if not resourceTTS.stackIsFilled(uuid):
+ time.sleep(0.5)
+ if not resourceTTS.stackIsFilled(uuid):
+ if not eventsHandler.waitCondition(ST_NAME_TTS_STACK_FILLING,
+ (uuid, None), 10.0):
+ self.logger.logInfo("Plugin stopped [%s]" % pluginName)
+ # Event plugin stop
+ return
+ eventsHandler.waitCondition(ST_NAME_TTS_STACK_EMPTY, (uuid, None),
+ 600.0)
+ self.logger.logInfo("Plugin stopped [%s]" % pluginName)
+ # Event plugin stop
+ t = threading.Thread(target = async)
+ t.start()
+
def __publishEvents(self, sendToClients, eventName, eventValues = []):
def async():
values = ""
|
|
From: remi <c2m...@c2...> - 2009-05-26 17:16:33
|
Author: remi Date: 2009-05-26 19:16:12 +0200 (Tue, 26 May 2009) New Revision: 4682 Added: software_suite_v3/smart-core/smart-server/trunk/content/plugins/plugin-pySkeleton.scp Log: * added an example of plugin Added: software_suite_v3/smart-core/smart-server/trunk/content/plugins/plugin-pySkeleton.scp =================================================================== (Binary files differ) Property changes on: software_suite_v3/smart-core/smart-server/trunk/content/plugins/plugin-pySkeleton.scp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Name: svn:keywords + Id |
Author: remi
Date: 2009-05-26 19:07:03 +0200 (Tue, 26 May 2009)
New Revision: 4681
Added:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/clients.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/log.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu_resources.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/resource.xsl
Removed:
software_suite_v3/smart-core/smart-server/trunk/data/xsl/
Modified:
software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py
software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py
Log:
* moved xsl files of the base server menu
Modified: software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py 2009-05-26 16:43:41 UTC (rev 4680)
+++ software_suite_v3/smart-core/smart-server/trunk/TuxDroidServer.py 2009-05-26 17:07:03 UTC (rev 4681)
@@ -58,7 +58,7 @@
"""
# Load and start the resources manager
resourcesManager.load(TDS_RESOURCES_PATH)
- resourcesManager.addDirectoryToServe("/data/xsl/")
+ resourcesManager.addDirectoryToServe("/data/web_interface/server_menu/xsl/")
resourcesManager.addFileToServe(os.path.join(TDS_APPLICATION_PATH,
"data", "favicon", "favicon.ico"), "/favicon.ico")
# Load wiky scripts
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/clients.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/clients.xsl (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/clients.xsl 2009-05-26 17:07:03 UTC (rev 4681)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
+ <body style="font-family:Arial;font-size:12pt;background-color:#FFFFFF">
+ <div style="margin-bottom:1em;margin-top:1em;font-size:14pt;font-weight:bold;background-color:#CCCCCC">
+ <span style="font-weight:bold"><xsl:value-of select="root/title"/></span>
+ </div>
+ <div style="margin-left:10px;margin-bottom:1em;font-size:12pt">
+ <span style="font-weight:bold;font-style:italic">
+ <xsl:value-of select="root/section"/> :
+ </span>
+ </div>
+ <xsl:for-each select="root/clients/*">
+ <div style="margin-left:20px;margin-bottom:1em;margin-top:1em;font-size:12pt;background-color:#FFFFFF">
+ <span style="font-weight:bold;text-decoration:underline">
+ <xsl:value-of select="position()"/>) <xsl:value-of select="name()"/>
+ </span>
+ </div>
+ <div style="margin-left:40px;font-size:10pt;background-color:#FFFFFF">
+ - Communication type : <xsl:value-of select="type"/>
+ </div>
+ <div style="margin-left:40px;font-size:10pt;background-color:#FFFFFF">
+ - Level : <xsl:value-of select="level"/>
+ </div>
+ </xsl:for-each>
+ </body>
+</html>
\ No newline at end of file
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/clients.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/log.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/log.xsl (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/log.xsl 2009-05-26 17:07:03 UTC (rev 4681)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
+ <body style="font-family:Arial;font-size:12pt;background-color:#FFFFFF">
+
+ <xsl:for-each select="root/data">
+
+ <div style="margin-bottom:1em;margin-top:1em;font-size:14pt;font-weight:bold;background-color:#CCCCCC">
+ <span style="font-weight:bold"><xsl:value-of select="log_file_path"/></span>
+ </div>
+
+ <xsl:for-each select="log_text/*">
+ <div style="margin-left:60px;font-size:10pt">
+ <span style="margin-left:3em;"><xsl:value-of select="."/></span>
+ </div>
+ </xsl:for-each>
+
+ </xsl:for-each>
+
+ </body>
+</html>
\ No newline at end of file
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/log.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu.xsl (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu.xsl 2009-05-26 17:07:03 UTC (rev 4681)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
+ <body style="font-family:Arial;font-size:12pt;background-color:#FFFFFF">
+ <div style="margin-bottom:1em;margin-top:1em;font-size:14pt;font-weight:bold;background-color:#CCCCCC">
+ <span style="font-weight:bold"><xsl:value-of select="root/title"/></span>
+ </div>
+ <div style="margin-left:10px;margin-bottom:1em;font-size:12pt">
+ <span style="font-weight:bold;font-style:italic">
+ <xsl:value-of select="root/section"/> :
+ </span>
+ </div>
+ <xsl:for-each select="root/items/*">
+ <div style="margin-left:20px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF">
+ <xsl:value-of select="position()"/>)
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ <xsl:value-of select="name()"/>
+ </xsl:element>
+ </div>
+ </xsl:for-each>
+ </body>
+</html>
\ No newline at end of file
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu_resources.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu_resources.xsl (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu_resources.xsl 2009-05-26 17:07:03 UTC (rev 4681)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
+ <body style="font-family:Arial;font-size:12pt;background-color:#FFFFFF">
+ <div style="margin-bottom:1em;margin-top:1em;font-size:14pt;font-weight:bold;background-color:#CCCCCC">
+ <span style="font-weight:bold"><xsl:value-of select="root/title"/></span>
+ </div>
+ <div style="margin-left:10px;margin-bottom:1em;font-size:12pt">
+ <span style="font-weight:bold;font-style:italic">
+ <xsl:value-of select="root/section"/> :
+ </span>
+ </div>
+ <xsl:for-each select="root/items/*">
+ <xsl:if test="count(*)>0">
+ <div style="margin-left:20px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF;text-decoration:underline">
+ <xsl:value-of select="position()"/>) <xsl:value-of select="name()"/>
+ </div>
+ <xsl:for-each select="*">
+ <div style="margin-left:30px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF">
+ -
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ <xsl:value-of select="name()"/>
+ </xsl:element>
+ </div>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:for-each>
+ </body>
+</html>
\ No newline at end of file
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/menu_resources.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/resource.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/resource.xsl (rev 0)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/resource.xsl 2009-05-26 17:07:03 UTC (rev 4681)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
+ <body style="font-family:Arial;font-size:12pt;background-color:#FFFFFF">
+ <div style="margin-bottom:1em;margin-top:1em;font-size:14pt;font-weight:bold;background-color:#CCCCCC">
+ <span style="font-weight:bold"><xsl:value-of select="root/title"/></span>
+ </div>
+
+ <div style="margin-left:0px;margin-bottom:1em;margin-top:1em;font-size:12pt;background-color:#EEEEEE">
+ <span style="font-weight:bold">
+ <xsl:value-of select="root/section"/>
+ </span>
+ </div>
+
+ <div style="margin-left:20px;margin-bottom:1em;margin-top:1em;font-size:12pt;background-color:#FFFFFF;font-weight:bold">
+ About this resource :
+ </div>
+
+ <div style="margin-left:20px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF">
+ <xsl:value-of select="root/comment"/>
+ </div>
+
+ <xsl:if test="count(root/shared_methods/*)>0">
+ <div style="margin-left:20px;margin-bottom:1em;margin-top:1em;font-size:12pt;background-color:#FFFFFF;font-weight:bold">
+ Provided functionalities :
+ </div>
+ </xsl:if>
+
+ <xsl:for-each select="root/shared_methods/*">
+ <div style="margin-left:30px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF">
+ <span style="font-weight:bold;text-decoration:underline">
+ <xsl:value-of select="position()"/>) <xsl:value-of select="name"/>
+ </span>
+ </div>
+ <xsl:for-each select="doc/*">
+ <xsl:if test="position()=1">
+ <div style="margin-left:40px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF">
+ <xsl:value-of select="."/>
+ </div>
+ </xsl:if>
+ <xsl:if test="position()>1">
+ <div style="margin-left:45px;margin-right:45px;font-size:10pt;background-color:#EEEEEE">
+ <xsl:value-of select="."/>
+ </div>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:for-each>
+
+ <xsl:if test="count(root/services/*)>0">
+ <div style="margin-left:20px;margin-bottom:1em;margin-top:1em;font-size:12pt;background-color:#FFFFFF;font-weight:bold">
+ REST Services List :
+ </div>
+ </xsl:if>
+
+ <xsl:for-each select="root/services/*">
+ <div style="margin-left:30px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF">
+ <span style="font-weight:bold;text-decoration:underline">
+ <xsl:value-of select="position()"/>) <xsl:value-of select="name()"/>
+ </span>
+ </div>
+ <div style="margin-left:40px;margin-bottom:1em;margin-top:1em;font-size:10pt;background-color:#FFFFFF">
+ <xsl:value-of select="comment"/>
+ </div>
+ <div style="margin-left:45px;margin-right:45px;font-size:10pt;background-color:#EEEEEE">
+ - Service access is exclusive : <xsl:value-of select="exclusiveExecution"/>
+ </div>
+ <div style="margin-left:45px;margin-right:45px;font-size:10pt;background-color:#EEEEEE">
+ - Minimal client level to use this service : <xsl:value-of select="minimalUserLevel"/>
+ </div>
+ <div style="margin-left:45px;margin-right:45px;font-size:10pt;background-color:#EEEEEE">
+ - Command prototype :
+ </div>
+ <div style="margin-left:45px;margin-right:45px;margin-top:1em;font-size:10pt;font-style:italic;background-color:#DDDDDD">
+ <xsl:value-of select="commandPrototype"/>
+ </div>
+ </xsl:for-each>
+
+ </body>
+</html>
\ No newline at end of file
Property changes on: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/server_menu/xsl/resource.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py 2009-05-26 16:43:41 UTC (rev 4680)
+++ software_suite_v3/smart-core/smart-server/trunk/resources/00_smart_server_base/04_resourceMenu.py 2009-05-26 17:07:03 UTC (rev 4681)
@@ -33,7 +33,7 @@
self.name = "index"
self.comment = "Main menu of the server."
self.haveXsl = True
- self.xslPath = "/data/xsl/menu.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/menu.xsl"
def execute(self, id, parameters):
headersStruct = self.getDefaultHeadersStruct()
@@ -71,7 +71,7 @@
self.name = "resources"
self.comment = "Resources menu."
self.haveXsl = True
- self.xslPath = "/data/xsl/menu.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/menu.xsl"
def execute(self, id, parameters):
headersStruct = self.getDefaultHeadersStruct()
@@ -84,7 +84,7 @@
return headersStruct, contentStruct
def __createXmlIndex(self):
- self.xslPath = "/data/xsl/menu_resources.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/menu_resources.xsl"
contentStruct = {
'title' : 'Tux Droid Server V %s' % serverVersion,
'section' : 'Resources',
@@ -105,7 +105,7 @@
return contentStruct
def __createXmlResource(self, resourceName):
- self.xslPath = "/data/xsl/resource.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/resource.xsl"
resource = resourcesManager.getResource(resourceName)
if resource == None:
result = {}
@@ -141,7 +141,7 @@
self.name = "logs"
self.comment = "Logs menu."
self.haveXsl = True
- self.xslPath = "/data/xsl/menu.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/menu.xsl"
if os.name == 'nt':
self.__logPath = os.path.expanduser("~")
else:
@@ -156,7 +156,7 @@
return headersStruct, contentStruct
def __createXmlIndex(self):
- self.xslPath = "/data/xsl/menu.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/menu.xsl"
contentStruct = {
'title' : 'Tux Droid Server V %s' % serverVersion,
'section' : 'Logs',
@@ -172,7 +172,7 @@
return contentStruct
def __createXmlLog(self, logName):
- self.xslPath = "/data/xsl/log.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/log.xsl"
filePath = os.path.join(self.__logPath, "%s.log" % logName)
if not os.path.isfile(filePath):
return {}
@@ -204,7 +204,7 @@
self.name = "clients"
self.comment = "Clients index."
self.haveXsl = True
- self.xslPath = "/data/xsl/clients.xsl"
+ self.xslPath = "/data/web_interface/server_menu/xsl/clients.xsl"
def execute(self, id, parameters):
headersStruct = self.getDefaultHeadersStruct()
|