[pywin32-checkins] pywin32/win32/Lib win32serviceutil.py, 1.26.2.5, 1.26.2.6
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-03 04:53:32
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7957/win32/Lib Modified Files: Tag: py3k win32serviceutil.py Log Message: merge modernizations from the trunk Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.26.2.5 retrieving revision 1.26.2.6 diff -C2 -d -r1.26.2.5 -r1.26.2.6 *** win32serviceutil.py 11 Dec 2008 05:45:21 -0000 1.26.2.5 --- win32serviceutil.py 3 Jan 2009 04:53:27 -0000 1.26.2.6 *************** *** 8,12 **** import win32service, win32api, win32con, winerror ! import sys, string, pywintypes, os error = RuntimeError --- 8,12 ---- import win32service, win32api, win32con, winerror ! import sys, pywintypes, os error = RuntimeError *************** *** 76,81 **** return win32service.OpenService(hscm, name, access) except win32api.error as details: ! if details[0] not in [winerror.ERROR_SERVICE_DOES_NOT_EXIST, ! winerror.ERROR_INVALID_NAME]: raise name = win32service.GetServiceKeyName(hscm, name) --- 76,81 ---- return win32service.OpenService(hscm, name, access) except win32api.error as details: ! if details.winerror not in [winerror.ERROR_SERVICE_DOES_NOT_EXIST, ! winerror.ERROR_INVALID_NAME]: raise name = win32service.GetServiceKeyName(hscm, name) *************** *** 324,328 **** deps = () for dep in deps: ! dep = string.lower(dep) dep_on = dict.get(dep, []) dep_on.append(svc) --- 324,328 ---- deps = () for dep in deps: ! dep = dep.lower() dep_on = dict.get(dep, []) dep_on.append(svc) *************** *** 333,337 **** def __ResolveDeps(findName, dict): ! items = dict.get(string.lower(findName), []) retList = [] for svc in items: --- 333,337 ---- def __ResolveDeps(findName, dict): ! items = dict.get(findName.lower(), []) retList = [] for svc in items: *************** *** 456,460 **** if argv is None: argv = sys.argv ! import pickle, os modName = pickle.whichmodule(cls, cls.__name__) if modName == '__main__': --- 456,460 ---- if argv is None: argv = sys.argv ! import pickle modName = pickle.whichmodule(cls, cls.__name__) if modName == '__main__': *************** *** 553,557 **** map = {"manual": win32service.SERVICE_DEMAND_START, "auto" : win32service.SERVICE_AUTO_START, "disabled": win32service.SERVICE_DISABLED} try: ! startup = map[string.lower(val)] except KeyError: print("'%s' is not a valid startup option" % val) --- 553,557 ---- map = {"manual": win32service.SERVICE_DEMAND_START, "auto" : win32service.SERVICE_AUTO_START, "disabled": win32service.SERVICE_DISABLED} try: ! startup = map[val.lower()] except KeyError: print("'%s' is not a valid startup option" % val) *************** *** 588,592 **** # non-frozen services use pythonservice.exe which handles a # -debug option ! svcArgs = string.join(args[1:]) try: exeName = LocateSpecificServiceExe(serviceName) --- 588,592 ---- # non-frozen services use pythonservice.exe which handles a # -debug option ! svcArgs = " ".join(args[1:]) try: exeName = LocateSpecificServiceExe(serviceName) *************** *** 644,648 **** else: print("Error installing service: %s (%d)" % (exc.strerror, exc.winerror)) ! err = hr except ValueError as msg: # Can be raised by custom option handler. print("Error installing service: %s" % str(msg)) --- 644,648 ---- else: print("Error installing service: %s (%d)" % (exc.strerror, exc.winerror)) ! err = exc.winerror except ValueError as msg: # Can be raised by custom option handler. print("Error installing service: %s" % str(msg)) *************** *** 684,688 **** except win32service.error as exc: print("Error changing service configuration: %s (%d)" % (exc.strerror,exc.winerror)) ! err = hr elif arg=="remove": --- 684,688 ---- except win32service.error as exc: print("Error changing service configuration: %s (%d)" % (exc.strerror,exc.winerror)) ! err = exc.winerror elif arg=="remove": *************** *** 694,698 **** except win32service.error as exc: print("Error removing service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = hr elif arg=="stop": knownArg = 1 --- 694,698 ---- except win32service.error as exc: print("Error removing service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = exc.winerror elif arg=="stop": knownArg = 1 *************** *** 705,709 **** except win32service.error as exc: print("Error stopping service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = hr if not knownArg: err = -1 --- 705,709 ---- except win32service.error as exc: print("Error stopping service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = exc.winerror if not knownArg: err = -1 |