fixed winservice problem

This commit is contained in:
mdipierro
2012-12-10 21:32:36 -06:00
parent c02b79f0c3
commit a98f45f875
3 changed files with 13 additions and 12 deletions
+5 -3
View File
@@ -34,7 +34,7 @@ try:
import Tkinter
import tkMessageBox
import contrib.taskbar_widget
from winservice import web2py_windows_service_handler
from winservice import register_service_handler, Web2pyService
have_winservice = True
except:
have_winservice = False
@@ -1116,8 +1116,10 @@ def start(cron=True):
if options.winservice:
if os.name == 'nt':
if have_winservice:
web2py_windows_service_handler(['', options.winservice],
options.config)
register_service_handler(
argv=['', options.winservice],
opt_file=options.config,
cls=Web2pyService)
else:
print 'Error: Missing python module winservice'
sys.exit(1)