[Greater-commits] r3634 - trunk/GREAT-ER/Greater/Modules
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Jul 22 10:19:10 CEST 2011
Author: aheinecke
Date: 2011-07-22 10:19:10 +0200 (Fri, 22 Jul 2011)
New Revision: 3634
Modified:
trunk/GREAT-ER/Greater/Modules/model.py
Log:
Place the scheduler and worker logs into the application dir on windows
and into the home directory on linux
Modified: trunk/GREAT-ER/Greater/Modules/model.py
===================================================================
--- trunk/GREAT-ER/Greater/Modules/model.py 2011-07-22 08:18:13 UTC (rev 3633)
+++ trunk/GREAT-ER/Greater/Modules/model.py 2011-07-22 08:19:10 UTC (rev 3634)
@@ -39,6 +39,7 @@
# Under Win32 play a system sound when the simulation finishes
from wxPython.wx import wxPlatform
if wxPlatform == '__WXMSW__':
+ import winpaths
try:
import winsound
except:
@@ -317,14 +318,26 @@
self.useserver = useserver
wxBeginBusyCursor()
+ if wxPlatform == '__WXMSW__':
+ logdir = os.path.join(winpaths.get_appdata(), "greater")
+ else:
+ logdir = os.path.join("~", ".greater")
+
+ if not os.path.isdir(logdir):
+ os.mkdir(logdir)
+
try:
if self.useserver == 'yes':
self.rpc = xmlrpclib.Server(self.serverurl)
else:
- server = SchedulerProcess(port_scan_range = 500,
- allow_shutdown = 1, db_api_module = self.db_api_module)
+ server = SchedulerProcess(port_scan_range = 500,
+ allow_shutdown = 1,
+ db_api_module = self.db_api_module,
+ log_file = os.path.join(logdir, "scheduler.log"))
server.start()
- worker = WorkerProcess(scheduler_port = server.real_worker_port, db_api_module = self.db_api_module)
+ worker = WorkerProcess(scheduler_port = server.real_worker_port,
+ db_api_module = self.db_api_module,
+ log_file = os.path.join(logdir, "worker%s.log" % "1"))
worker.start()
server.wait_for_worker()
self.rpc = xmlrpclib.Server('http://localhost:%d' % \
More information about the Greater-commits
mailing list