[pywin32-checkins] pywin32/isapi install.py,1.19,1.20
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-03 05:23:14
|
Update of /cvsroot/pywin32/pywin32/isapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9330 Modified Files: install.py Log Message: move to exception attributes and list iterators Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/install.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** install.py 30 Dec 2008 12:06:32 -0000 1.19 --- install.py 3 Jan 2009 05:23:07 -0000 1.20 *************** *** 123,130 **** # Convert an ADSI COM exception to the Win32 error code embedded in it. def _GetWin32ErrorCode(com_exc): ! hr, msg, exc, narg = com_exc ! # If we have more details in the 'exc' struct, use it. ! if exc: ! hr = exc[-1] if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32: raise --- 123,130 ---- # Convert an ADSI COM exception to the Win32 error code embedded in it. def _GetWin32ErrorCode(com_exc): ! hr = com_exc.hresult ! # If we have more details in the 'excepinfo' struct, use it. ! if com_exc.excepinfo: ! hr = com_exc.excepinfo[-1] if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32: raise *************** *** 182,188 **** server = GetObject(path) except pythoncom.com_error, details: ! hr, msg, exc, arg_err = details ! if exc and exc[2]: ! msg = exc[2] msg = "WebServer %s: %s" % (path, msg) raise ItemNotFound(msg) --- 182,188 ---- server = GetObject(path) except pythoncom.com_error, details: ! msg = details.strerror ! if exc.excepinfo and exc.excepinfo[2]: ! msg = exc.excepinfo[2] msg = "WebServer %s: %s" % (path, msg) raise ItemNotFound(msg) *************** *** 332,340 **** try: filters = GetObject(server+"/Filters") ! except pythoncom.com_error, (hr, msg, exc, arg): # Brand new sites don't have the '/Filters' collection - create it. # Any errors other than 'not found' we shouldn't ignore. ! if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32 or \ ! winerror.HRESULT_CODE(hr) != winerror.ERROR_PATH_NOT_FOUND: raise server_ob = GetObject(server) --- 332,340 ---- try: filters = GetObject(server+"/Filters") ! except pythoncom.com_error, exc: # Brand new sites don't have the '/Filters' collection - create it. # Any errors other than 'not found' we shouldn't ignore. ! if winerror.HRESULT_FACILITY(exc.hresult) != winerror.FACILITY_WIN32 or \ ! winerror.HRESULT_CODE(exc.hresult) != winerror.ERROR_PATH_NOT_FOUND: raise server_ob = GetObject(server) *************** *** 620,629 **** def build_usage(handler_map): ! docstrings = [handler.__doc__ for handler in handler_map.values()] ! all_args = dict(zip(handler_map.keys(), docstrings)) ! arg_names = "|".join(all_args.keys()) usage_string = "%prog [options] [" + arg_names + "]\n" usage_string += "commands:\n" ! for arg, desc in all_args.items(): usage_string += " %-10s: %s" % (arg, desc) + "\n" return usage_string[:-1] --- 620,629 ---- def build_usage(handler_map): ! docstrings = [handler.__doc__ for handler in handler_map.itervalues()] ! all_args = dict(zip(handler_map.iterkeys(), docstrings)) ! arg_names = "|".join(all_args.iterkeys()) usage_string = "%prog [options] [" + arg_names + "]\n" usage_string += "commands:\n" ! for arg, desc in all_args.iteritems(): usage_string += " %-10s: %s" % (arg, desc) + "\n" return usage_string[:-1] |