catch missing winservice

This commit is contained in:
mdipierro
2012-08-29 10:12:11 -05:00
parent 6f6276a912
commit b232a2ddba
2 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.1 (2012-08-29 10:05:45) rc4
Version 2.00.1 (2012-08-29 10:12:06) rc4
+8 -3
View File
@@ -33,8 +33,9 @@ try:
import Tkinter, tkMessageBox
import contrib.taskbar_widget
from winservice import web2py_windows_service_handler
have_winservice = True
except:
pass
have_winservice = False
try:
@@ -1080,8 +1081,12 @@ def start(cron=True):
# ## if -W install/start/stop web2py as service
if options.winservice:
if os.name == 'nt':
web2py_windows_service_handler(['', options.winservice],
options.config)
if have_winservice:
web2py_windows_service_handler(['', options.winservice],
options.config)
else:
print 'Error: Missing python module winservice'
sys.exit(1)
else:
print 'Error: Windows services not supported on this platform'
sys.exit(1)