catch missing winservice
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user