From fa9c91de8371c1d03fd8b843b7c459e7d52c648d Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 29 Aug 2012 10:12:11 -0500 Subject: [PATCH] catch missing winservice --- VERSION | 2 +- gluon/widget.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index de0cdbc9..953d2253 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.1 (2012-08-29 10:05:45) rc4 +Version 2.00.1 (2012-08-29 10:12:06) rc4 diff --git a/gluon/widget.py b/gluon/widget.py index 13114466..3b8055f5 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -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)