pywin32-checkins Mailing List for Python for Windows Extensions (Page 52)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@us...> - 2008-11-26 09:03:35
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/taskscheduler/test Modified Files: Tag: py3k test_addtask.py test_addtask_1.py test_addtask_2.py Log Message: many more upgrades to py3k syntax Index: test_addtask_2.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/test/test_addtask_2.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** test_addtask_2.py 10 Apr 2004 05:18:41 -0000 1.1 --- test_addtask_2.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 6,12 **** tasks=ts.Enum() for task in tasks: ! print task if task_name in tasks: ! print 'Deleting existing task '+task_name ts.Delete(task_name) --- 6,12 ---- tasks=ts.Enum() for task in tasks: ! print(task) if task_name in tasks: ! print('Deleting existing task '+task_name) ts.Delete(task_name) *************** *** 36,40 **** tr.SetTrigger(tt) ! print t.GetTriggerString(tr_ind) pf=t.QueryInterface(pythoncom.IID_IPersistFile) --- 36,40 ---- tr.SetTrigger(tt) ! print(t.GetTriggerString(tr_ind)) pf=t.QueryInterface(pythoncom.IID_IPersistFile) Index: test_addtask_1.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/test/test_addtask_1.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** test_addtask_1.py 10 Apr 2004 05:18:41 -0000 1.1 --- test_addtask_1.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 8,14 **** tasks=ts.Enum() for task in tasks: ! print task if test_task_name in tasks: ! print 'Deleting existing task '+test_task_name ts.Delete(test_task_name) --- 8,14 ---- tasks=ts.Enum() for task in tasks: ! print(task) if test_task_name in tasks: ! print('Deleting existing task '+test_task_name) ts.Delete(test_task_name) *************** *** 48,52 **** tr.SetTrigger(tt) ! print new_task.GetTriggerString(tr_ind) pf=new_task.QueryInterface(pythoncom.IID_IPersistFile) --- 48,52 ---- tr.SetTrigger(tt) ! print(new_task.GetTriggerString(tr_ind)) pf=new_task.QueryInterface(pythoncom.IID_IPersistFile) Index: test_addtask.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/test/test_addtask.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** test_addtask.py 10 Apr 2004 05:18:41 -0000 1.1 --- test_addtask.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 6,12 **** tasks=ts.Enum() for task in tasks: ! print task if task_name in tasks: ! print 'Deleting existing task '+task_name ts.Delete(task_name) --- 6,12 ---- tasks=ts.Enum() for task in tasks: ! print(task) if task_name in tasks: ! print('Deleting existing task '+task_name) ts.Delete(task_name) *************** *** 45,49 **** tt.MonthlyDate_Days=1<<(int(time.strftime('%d',run_time))-1) tr.SetTrigger(tt) ! print t.GetTriggerString(tr_ind) pf=t.QueryInterface(pythoncom.IID_IPersistFile) --- 45,49 ---- tt.MonthlyDate_Days=1<<(int(time.strftime('%d',run_time))-1) tr.SetTrigger(tt) ! print(t.GetTriggerString(tr_ind)) pf=t.QueryInterface(pythoncom.IID_IPersistFile) |
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/win32/Lib Modified Files: Tag: py3k win32evtlogutil.py win32rcparser.py win32serviceutil.py win32timezone.py win32verstamp.py Log Message: many more upgrades to py3k syntax Index: win32verstamp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32verstamp.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** win32verstamp.py 23 Oct 2005 11:31:07 -0000 1.2 --- win32verstamp.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 115,120 **** f = open(pathname, "a+b") f.close() ! except IOError, why: ! print "WARNING: File %s could not be opened - %s" % (pathname, why) ver = options.version --- 115,120 ---- f = open(pathname, "a+b") f.close() ! except IOError as why: ! print("WARNING: File %s could not be opened - %s" % (pathname, why)) ver = options.version *************** *** 123,127 **** vmaj, vmin, vsub, vbuild = bits except (IndexError, TypeError, ValueError): ! raise ValueError, "--version must be a.b.c.d (all integers) - got %r" % ver ifn = options.internal_name --- 123,127 ---- vmaj, vmin, vsub, vbuild = bits except (IndexError, TypeError, ValueError): ! raise ValueError("--version must be a.b.c.d (all integers) - got %r" % ver) ifn = options.internal_name *************** *** 164,168 **** if options.verbose: ! print "Stamped:", pathname if __name__ == '__main__': --- 164,168 ---- if options.verbose: ! print("Stamped:", pathname) if __name__ == '__main__': Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.26.2.1 retrieving revision 1.26.2.2 diff -C2 -d -r1.26.2.1 -r1.26.2.2 *** win32serviceutil.py 1 Oct 2008 04:15:45 -0000 1.26.2.1 --- win32serviceutil.py 26 Nov 2008 09:03:30 -0000 1.26.2.2 *************** *** 10,14 **** import sys, string, pywintypes, os ! error = "Python Service Utility Error" def LocatePythonServiceExe(exeName = None): --- 10,14 ---- import sys, string, pywintypes, os ! error = RuntimeError def LocatePythonServiceExe(exeName = None): *************** *** 32,38 **** if os.path.isfile(exeName): return exeName ! raise RuntimeError, "The executable '%s' is registered as the Python " \ ! "service exe, but it does not exist as specified" \ ! % exeName except win32api.error: # OK - not there - lets go a-searchin' --- 32,38 ---- if os.path.isfile(exeName): return exeName ! raise RuntimeError("The executable '%s' is registered as the Python " \ ! "service exe, but it does not exist as specified" \ ! % exeName) except win32api.error: # OK - not there - lets go a-searchin' *************** *** 46,50 **** except win32api.error: msg = "%s is not correctly registered\nPlease locate and run %s, and it will self-register\nThen run this service registration process again." % (exeName, exeName) ! raise error, msg def _GetServiceShortName(longName): --- 46,50 ---- except win32api.error: msg = "%s is not correctly registered\nPlease locate and run %s, and it will self-register\nThen run this service registration process again." % (exeName, exeName) ! raise error(msg) def _GetServiceShortName(longName): *************** *** 75,79 **** try: return win32service.OpenService(hscm, name, access) ! except win32api.error, details: if details[0] not in [winerror.ERROR_SERVICE_DOES_NOT_EXIST, winerror.ERROR_INVALID_NAME]: --- 75,79 ---- try: 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]: *************** *** 105,109 **** pass if not dllName: ! raise ValueError, "The name of the performance DLL must be available" dllName = win32api.GetFullPathName(dllName) # Now setup all the required "Performance" entries. --- 105,109 ---- pass if not dllName: ! raise ValueError("The name of the performance DLL must be available") dllName = win32api.GetFullPathName(dllName) # Now setup all the required "Performance" entries. *************** *** 132,138 **** finally: os.chdir(oldPath) ! except win32api.error, details: ! print "The service was installed OK, but the performance monitor" ! print "data could not be loaded.", details def _GetCommandLine(exeName, exeArgs): --- 132,138 ---- finally: os.chdir(oldPath) ! except win32api.error as details: ! print("The service was installed OK, but the performance monitor") ! print("data could not be loaded.", details) def _GetCommandLine(exeName, exeArgs): *************** *** 349,360 **** win32api.Sleep(250) else: ! raise pywintypes.error, (winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "QueryServiceStatus", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) def __StopServiceWithTimeout(hs, waitSecs = 30): try: status = win32service.ControlService(hs, win32service.SERVICE_CONTROL_STOP) ! except pywintypes.error, (hr, name, msg): if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error, (hr, name, msg) for i in range(waitSecs): status = win32service.QueryServiceStatus(hs) --- 349,361 ---- win32api.Sleep(250) else: ! raise pywintypes.error(winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "QueryServiceStatus", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) def __StopServiceWithTimeout(hs, waitSecs = 30): try: status = win32service.ControlService(hs, win32service.SERVICE_CONTROL_STOP) ! except pywintypes.error as xxx_todo_changeme: ! (hr, name, msg) = xxx_todo_changeme.args if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error(hr, name, msg) for i in range(waitSecs): status = win32service.QueryServiceStatus(hs) *************** *** 363,367 **** win32api.Sleep(1000) else: ! raise pywintypes.error, (winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "ControlService", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) --- 364,368 ---- win32api.Sleep(1000) else: ! raise pywintypes.error(winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "ControlService", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) *************** *** 407,414 **** try: StopService(serviceName, machine) ! except pywintypes.error, (hr, name, msg): # Allow only "service not running" error if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error, (hr, name, msg) # Give it a few goes, as the service may take time to stop for i in range(waitSeconds): --- 408,417 ---- try: StopService(serviceName, machine) ! except pywintypes.error as xxx_todo_changeme1: ! # Allow only "service not running" error ! (hr, name, msg) = xxx_todo_changeme1.args # Allow only "service not running" error if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error(hr, name, msg) # Give it a few goes, as the service may take time to stop for i in range(waitSeconds): *************** *** 416,430 **** StartService(serviceName, args, machine) break ! except pywintypes.error, (hr, name, msg): if hr!=winerror.ERROR_SERVICE_ALREADY_RUNNING: raise win32api.Sleep(1000) else: ! print "Gave up waiting for the old service to stop!" def _DebugCtrlHandler(evt): if evt in (win32con.CTRL_C_EVENT, win32con.CTRL_BREAK_EVENT): assert g_debugService ! print "Stopping debug service." g_debugService.SvcStop() return True --- 419,434 ---- StartService(serviceName, args, machine) break ! except pywintypes.error as xxx_todo_changeme2: ! (hr, name, msg) = xxx_todo_changeme2.args if hr!=winerror.ERROR_SERVICE_ALREADY_RUNNING: raise win32api.Sleep(1000) else: ! print("Gave up waiting for the old service to stop!") def _DebugCtrlHandler(evt): if evt in (win32con.CTRL_C_EVENT, win32con.CTRL_BREAK_EVENT): assert g_debugService ! print("Stopping debug service.") g_debugService.SvcStop() return True *************** *** 440,444 **** global g_debugService ! print "Debugging service %s - press Ctrl+C to stop." % (cls._svc_name_,) servicemanager.Debugging(True) servicemanager.PrepareToHostSingle(cls) --- 444,448 ---- global g_debugService ! print("Debugging service %s - press Ctrl+C to stop." % (cls._svc_name_,)) servicemanager.Debugging(True) servicemanager.PrepareToHostSingle(cls) *************** *** 467,471 **** fname = os.path.join(path, win32api.FindFiles(fname)[0][8]) except win32api.error: ! raise error, "Could not resolve the path name '%s' to a full path" % (argv[0]) modName = os.path.splitext(fname)[0] return modName + "." + cls.__name__ --- 471,475 ---- fname = os.path.join(path, win32api.FindFiles(fname)[0][8]) except win32api.error: ! raise error("Could not resolve the path name '%s' to a full path" % (argv[0])) modName = os.path.splitext(fname)[0] return modName + "." + cls.__name__ *************** *** 489,506 **** except: fname = sys.argv[0] ! print "Usage: '%s [options] install|update|remove|start [...]|stop|restart [...]|debug [...]'" % fname ! print "Options for 'install' and 'update' commands only:" ! print " --username domain\\username : The Username the service is to run under" ! print " --password password : The password for the username" ! print " --startup [manual|auto|disabled] : How the service starts, default = manual" ! print " --interactive : Allow the service to interact with the desktop." ! print " --perfmonini file: .ini file to use for registering performance monitor data" ! print " --perfmondll file: .dll file to use when querying the service for" ! print " performance data, default = perfmondata.dll" ! print "Options for 'start' and 'stop' commands only:" ! print " --wait seconds: Wait for the service to actually start or stop." ! print " If you specify --wait with the 'stop' option, the service" ! print " and all dependent services will be stopped, each waiting" ! print " the specified period." sys.exit(1) --- 493,510 ---- except: fname = sys.argv[0] ! print("Usage: '%s [options] install|update|remove|start [...]|stop|restart [...]|debug [...]'" % fname) ! print("Options for 'install' and 'update' commands only:") ! print(" --username domain\\username : The Username the service is to run under") ! print(" --password password : The password for the username") ! print(" --startup [manual|auto|disabled] : How the service starts, default = manual") ! print(" --interactive : Allow the service to interact with the desktop.") ! print(" --perfmonini file: .ini file to use for registering performance monitor data") ! print(" --perfmondll file: .dll file to use when querying the service for") ! print(" performance data, default = perfmondata.dll") ! print("Options for 'start' and 'stop' commands only:") ! print(" --wait seconds: Wait for the service to actually start or stop.") ! print(" If you specify --wait with the 'stop' option, the service") ! print(" and all dependent services will be stopped, each waiting") ! print(" the specified period.") sys.exit(1) *************** *** 530,535 **** try: opts, args = getopt.getopt(argv[1:], customInstallOptions,["password=","username=","startup=","perfmonini=", "perfmondll=", "interactive", "wait="]) ! except getopt.error, details: ! print details usage() userName = None --- 534,539 ---- try: opts, args = getopt.getopt(argv[1:], customInstallOptions,["password=","username=","startup=","perfmonini=", "perfmondll=", "interactive", "wait="]) ! except getopt.error as details: ! print(details) usage() userName = None *************** *** 555,564 **** startup = map[string.lower(val)] except KeyError: ! print "'%s' is not a valid startup option" % val elif opt=='--wait': try: waitSecs = int(val) except ValueError: ! print "--wait must specify an integer number of seconds." usage() --- 559,568 ---- startup = map[string.lower(val)] except KeyError: ! print("'%s' is not a valid startup option" % val) elif opt=='--wait': try: waitSecs = int(val) except ValueError: ! print("--wait must specify an integer number of seconds.") usage() *************** *** 568,582 **** if arg=="start": knownArg = 1 ! print "Starting service %s" % (serviceName) try: StartService(serviceName, args[1:]) if waitSecs: WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) ! except win32service.error, (hr, fn, msg): ! print "Error starting service: %s" % msg elif arg=="restart": knownArg = 1 ! print "Restarting service %s" % (serviceName) RestartService(serviceName, args[1:]) if waitSecs: --- 572,587 ---- if arg=="start": knownArg = 1 ! print("Starting service %s" % (serviceName)) try: StartService(serviceName, args[1:]) if waitSecs: WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) ! except win32service.error as xxx_todo_changeme3: ! (hr, fn, msg) = xxx_todo_changeme3.args ! print("Error starting service: %s" % msg) elif arg=="restart": knownArg = 1 ! print("Restarting service %s" % (serviceName)) RestartService(serviceName, args[1:]) if waitSecs: *************** *** 591,598 **** try: exeName = LocateSpecificServiceExe(serviceName) ! except win32api.error, exc: if exc[0] == winerror.ERROR_FILE_NOT_FOUND: ! print "The service does not appear to be installed." ! print "Please install the service before debugging it." sys.exit(1) raise --- 596,603 ---- try: exeName = LocateSpecificServiceExe(serviceName) ! except win32api.error as exc: if exc[0] == winerror.ERROR_FILE_NOT_FOUND: ! print("The service does not appear to be installed.") ! print("Please install the service before debugging it.") sys.exit(1) raise *************** *** 629,633 **** except AttributeError: description = None ! print "Installing service %s" % (serviceName,) # Note that we install the service before calling the custom option # handler, so if the custom handler fails, we have an installed service (from NT's POV) --- 634,638 ---- except AttributeError: description = None ! print("Installing service %s" % (serviceName,)) # Note that we install the service before calling the custom option # handler, so if the custom handler fails, we have an installed service (from NT's POV) *************** *** 638,650 **** if customOptionHandler: apply( customOptionHandler, (opts,) ) ! print "Service installed" ! except win32service.error, (hr, fn, msg): if hr==winerror.ERROR_SERVICE_EXISTS: arg = "update" # Fall through to the "update" param! else: ! print "Error installing service: %s (%d)" % (msg, hr) err = hr ! except ValueError, msg: # Can be raised by custom option handler. ! print "Error installing service: %s" % str(msg) err = -1 # xxx - maybe I should remove after _any_ failed install - however, --- 643,656 ---- if customOptionHandler: apply( customOptionHandler, (opts,) ) ! print("Service installed") ! except win32service.error as xxx_todo_changeme4: ! (hr, fn, msg) = xxx_todo_changeme4.args if hr==winerror.ERROR_SERVICE_EXISTS: arg = "update" # Fall through to the "update" param! else: ! print("Error installing service: %s (%d)" % (msg, hr)) err = hr ! except ValueError as msg: # Can be raised by custom option handler. ! print("Error installing service: %s" % str(msg)) err = -1 # xxx - maybe I should remove after _any_ failed install - however, *************** *** 656,660 **** RemoveService(serviceName) except win32api.error: ! print "Warning - could not remove the partially installed service." if arg == "update": --- 662,666 ---- RemoveService(serviceName) except win32api.error: ! print("Warning - could not remove the partially installed service.") if arg == "update": *************** *** 676,701 **** except AttributeError: description=None ! print "Changing service configuration" try: ChangeServiceConfig(serviceClassString, serviceName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, displayName = serviceDisplayName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs,description=description) if customOptionHandler: apply( customOptionHandler, (opts,) ) ! print "Service updated" ! except win32service.error, (hr, fn, msg): ! print "Error changing service configuration: %s (%d)" % (msg,hr) err = hr elif arg=="remove": knownArg = 1 ! print "Removing service %s" % (serviceName) try: RemoveService(serviceName) ! print "Service removed" ! except win32service.error, (hr, fn, msg): ! print "Error removing service: %s (%d)" % (msg,hr) err = hr elif arg=="stop": knownArg = 1 ! print "Stopping service %s" % (serviceName) try: if waitSecs: --- 682,709 ---- except AttributeError: description=None ! print("Changing service configuration") try: ChangeServiceConfig(serviceClassString, serviceName, serviceDeps = serviceDeps, startType=startup, bRunInteractive=interactive, userName=userName,password=password, exeName=exeName, displayName = serviceDisplayName, perfMonIni=perfMonIni,perfMonDll=perfMonDll,exeArgs=exeArgs,description=description) if customOptionHandler: apply( customOptionHandler, (opts,) ) ! print("Service updated") ! except win32service.error as xxx_todo_changeme5: ! (hr, fn, msg) = xxx_todo_changeme5.args ! print("Error changing service configuration: %s (%d)" % (msg,hr)) err = hr elif arg=="remove": knownArg = 1 ! print("Removing service %s" % (serviceName)) try: RemoveService(serviceName) ! print("Service removed") ! except win32service.error as xxx_todo_changeme6: ! (hr, fn, msg) = xxx_todo_changeme6.args ! print("Error removing service: %s (%d)" % (msg,hr)) err = hr elif arg=="stop": knownArg = 1 ! print("Stopping service %s" % (serviceName)) try: if waitSecs: *************** *** 703,712 **** else: StopService(serviceName) ! except win32service.error, (hr, fn, msg): ! print "Error stopping service: %s (%d)" % (msg,hr) err = hr if not knownArg: err = -1 ! print "Unknown command - '%s'" % arg usage() return err --- 711,721 ---- else: StopService(serviceName) ! except win32service.error as xxx_todo_changeme7: ! (hr, fn, msg) = xxx_todo_changeme7.args ! print("Error stopping service: %s (%d)" % (msg,hr)) err = hr if not knownArg: err = -1 ! print("Unknown command - '%s'" % arg) usage() return err *************** *** 773,777 **** def SvcOther(self, control): try: ! print "Unknown control status - %d" % control except IOError: # services may not have a valid stdout! --- 782,786 ---- def SvcOther(self, control): try: ! print("Unknown control status - %d" % control) except IOError: # services may not have a valid stdout! Index: win32evtlogutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32evtlogutil.py,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -C2 -d -r1.10 -r1.10.4.1 *** win32evtlogutil.py 25 Apr 2004 10:34:10 -0000 1.10 --- win32evtlogutil.py 26 Nov 2008 09:03:30 -0000 1.10.4.1 *************** *** 60,64 **** win32api.RegDeleteKey(win32con.HKEY_LOCAL_MACHINE, \ "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s\\%s" % (eventLogType, appName)) ! except win32api.error, (hr, fn, desc): if hr != winerror.ERROR_FILE_NOT_FOUND: raise --- 60,65 ---- win32api.RegDeleteKey(win32con.HKEY_LOCAL_MACHINE, \ "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s\\%s" % (eventLogType, appName)) ! except win32api.error as xxx_todo_changeme: ! (hr, fn, desc) = xxx_todo_changeme.args if hr != winerror.ERROR_FILE_NOT_FOUND: raise Index: win32rcparser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32rcparser.py,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** win32rcparser.py 4 Jul 2008 01:55:13 -0000 1.5 --- win32rcparser.py 26 Nov 2008 09:03:30 -0000 1.5.2.1 *************** *** 132,136 **** def debug(self, *args): if self.debugEnabled: ! print args def getToken(self): --- 132,136 ---- def debug(self, *args): if self.debugEnabled: ! print(args) def getToken(self): *************** *** 501,509 **** lex = getattr(rcp, "lex", None) if lex: ! print "ERROR parsing dialogs at line", lex.lineno ! print "Next 10 tokens are:" for i in range(10): ! print lex.get_token(), ! print raise return rcp --- 501,509 ---- lex = getattr(rcp, "lex", None) if lex: ! print("ERROR parsing dialogs at line", lex.lineno) ! print("Next 10 tokens are:") for i in range(10): ! print(lex.get_token(), end=' ') ! print() raise return rcp *************** *** 570,577 **** if __name__=='__main__': if len(sys.argv) <= 1: ! print __doc__ ! print ! print "See test_win32rcparser.py, and the win32rcparser directory (both" ! print "in the test suite) for an example of this module's usage." else: import pprint --- 570,577 ---- if __name__=='__main__': if len(sys.argv) <= 1: ! print(__doc__) ! print() ! print("See test_win32rcparser.py, and the win32rcparser directory (both") ! print("in the test suite) for an example of this module's usage.") else: import pprint *************** *** 579,595 **** if "-v" in sys.argv: RCParser.debugEnabled = 1 ! print "Dumping all resources in '%s'" % filename resources = Parse(filename) for id, ddef in resources.dialogs.items(): ! print "Dialog %s (%d controls)" % (id, len(ddef)) pprint.pprint(ddef) ! print for id, sdef in resources.stringTable.items(): ! print "String %s=%r" % (id, sdef.value) ! print for id, sdef in resources.bitmaps.items(): ! print "Bitmap %s=%r" % (id, sdef) ! print for id, sdef in resources.icons.items(): ! print "Icon %s=%r" % (id, sdef) ! print --- 579,595 ---- if "-v" in sys.argv: RCParser.debugEnabled = 1 ! print("Dumping all resources in '%s'" % filename) resources = Parse(filename) for id, ddef in resources.dialogs.items(): ! print("Dialog %s (%d controls)" % (id, len(ddef))) pprint.pprint(ddef) ! print() for id, sdef in resources.stringTable.items(): ! print("String %s=%r" % (id, sdef.value)) ! print() for id, sdef in resources.bitmaps.items(): ! print("Bitmap %s=%r" % (id, sdef)) ! print() for id, sdef in resources.icons.items(): ! print("Icon %s=%r" % (id, sdef)) ! print() Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.9.2.2 retrieving revision 1.9.2.3 diff -C2 -d -r1.9.2.2 -r1.9.2.3 *** win32timezone.py 11 Nov 2008 00:01:14 -0000 1.9.2.2 --- win32timezone.py 26 Nov 2008 09:03:30 -0000 1.9.2.3 *************** *** 234,238 **** key = _winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath) except: ! raise ValueError, 'Timezone Name %s not found.' % timeZoneName return key --- 234,238 ---- key = _winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath) except: ! raise ValueError('Timezone Name %s not found.' % timeZoneName) return key *************** *** 515,519 **** handle = DLLCache[matcher.groupdict()['dllname']] result = win32api.LoadString(handle, int(matcher.groupdict()['index'])) ! except win32api.error, e: result = None return result --- 515,519 ---- handle = DLLCache[matcher.groupdict()['dllname']] result = win32api.LoadString(handle, int(matcher.groupdict()['index'])) ! except win32api.error as e: result = None return result *************** *** 576,580 **** key = self._find_first_match_(sortedKeys, item) result = dict.__getitem__(self, key) ! if isinstance(result, RangeValueUndefined): raise KeyError, key return result --- 576,580 ---- key = self._find_first_match_(sortedKeys, item) result = dict.__getitem__(self, key) ! if isinstance(result, RangeValueUndefined): raise KeyError(key) return result |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:35
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/axscript/client Modified Files: Tag: py3k debug.py error.py framework.py pydumper.py pyscript.py pyscript_rexec.py scriptdispatch.py Log Message: many more upgrades to py3k syntax Index: debug.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/debug.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** debug.py 11 Apr 2005 13:04:40 -0000 1.3 --- debug.py 26 Nov 2008 09:03:29 -0000 1.3.4.1 *************** *** 25,32 **** if not debuggingTrace: return ! print win32api.GetCurrentThreadId(), for arg in args: ! print arg, ! print # Note that the DebugManager is not a COM gateway class for the --- 25,32 ---- if not debuggingTrace: return ! print(win32api.GetCurrentThreadId(), end=' ') for arg in args: ! print(arg, end=' ') ! print() # Note that the DebugManager is not a COM gateway class for the Index: scriptdispatch.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/scriptdispatch.py,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** scriptdispatch.py 20 May 2005 23:27:54 -0000 1.4 --- scriptdispatch.py 26 Nov 2008 09:03:29 -0000 1.4.4.1 *************** *** 38,42 **** func = getattr(self.scriptNamespace, name) if not _is_callable(func): ! raise AttributeError, name # Not a function. realArgs = [] for arg in args: --- 38,42 ---- func = getattr(self.scriptNamespace, name) if not _is_callable(func): ! raise AttributeError(name) # Not a function. realArgs = [] for arg in args: *************** *** 48,52 **** # xxx - todo - work out what code block to pass??? return self.engine.ApplyInScriptedSection(None, func, tuple(realArgs)) ! except COMException, (hr, msg, exc, arg): raise --- 48,53 ---- # xxx - todo - work out what code block to pass??? return self.engine.ApplyInScriptedSection(None, func, tuple(realArgs)) ! except COMException as xxx_todo_changeme: ! (hr, msg, exc, arg) = xxx_todo_changeme.args raise *************** *** 59,66 **** ret = getattr(self.scriptNamespace, name) if _is_callable(ret): ! raise AttributeError, name # Not a property. except AttributeError: raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND) ! except COMException, instance: raise except: --- 60,67 ---- ret = getattr(self.scriptNamespace, name) if _is_callable(ret): ! raise AttributeError(name) # Not a property. except AttributeError: raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND) ! except COMException as instance: raise except: Index: pyscript.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pyscript.py,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** pyscript.py 26 Nov 2008 07:17:39 -0000 1.11.2.1 --- pyscript.py 26 Nov 2008 09:03:29 -0000 1.11.2.2 *************** *** 54,61 **** def __getattr__(self, attr): if attr[1]=="_" and attr[:-1]=="_": ! raise AttributeError, attr rc = self._FindAttribute_(attr) if rc is None: ! raise AttributeError, attr return rc def _Close_(self): --- 54,61 ---- def __getattr__(self, attr): if attr[1]=="_" and attr[:-1]=="_": ! raise AttributeError(attr) rc = self._FindAttribute_(attr) if rc is None: ! raise AttributeError(attr) return rc def _Close_(self): *************** *** 73,77 **** except AttributeError: pass ! raise AttributeError, attr def _FindAttribute_(self, attr): --- 73,77 ---- except AttributeError: pass ! raise AttributeError(attr) def _FindAttribute_(self, attr): *************** *** 84,88 **** # (mainly b/w compat) return getattr(self._scriptEngine_.globalNameSpaceModule, attr) ! # raise AttributeError, attr class NamedScriptAttribute: --- 84,88 ---- # (mainly b/w compat) return getattr(self._scriptEngine_.globalNameSpaceModule, attr) ! # raise AttributeError(attr) class NamedScriptAttribute: *************** *** 104,108 **** if self._scriptItem_.dispatchContainer: return getattr(self._scriptItem_.dispatchContainer,attr) ! raise AttributeError, attr def __setattr__(self, attr, value): # XXX - todo - if a known item, then should call its default --- 104,108 ---- if self._scriptItem_.dispatchContainer: return getattr(self._scriptItem_.dispatchContainer,attr) ! raise AttributeError(attr) def __setattr__(self, attr, value): # XXX - todo - if a known item, then should call its default *************** *** 114,118 **** except AttributeError: pass ! raise AttributeError, attr def _Close_(self): self.__dict__['_scriptItem_'] = None --- 114,118 ---- except AttributeError: pass ! raise AttributeError(attr) def _Close_(self): self.__dict__['_scriptItem_'] = None Index: pydumper.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pydumper.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** pydumper.py 1 Sep 1999 23:12:39 -0000 1.1 --- pydumper.py 26 Nov 2008 09:03:29 -0000 1.1.4.1 *************** *** 48,52 **** policy = None # "win32com.axscript.client.axspolicy.AXScriptPolicy" ! print "Registering COM server%s..." % debug_desc from win32com.server.register import RegisterServer --- 48,52 ---- policy = None # "win32com.axscript.client.axspolicy.AXScriptPolicy" ! print("Registering COM server%s..." % debug_desc) from win32com.server.register import RegisterServer *************** *** 63,67 **** win32com.server.register._set_string(".pysDump", "pysDumpFile") win32com.server.register._set_string("pysDumpFile\\ScriptEngine", languageName) ! print "Dumping Server registered." if __name__=='__main__': --- 63,67 ---- win32com.server.register._set_string(".pysDump", "pysDumpFile") win32com.server.register._set_string("pysDumpFile\\ScriptEngine", languageName) ! print("Dumping Server registered.") if __name__=='__main__': Index: framework.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/framework.py,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -C2 -d -r1.25 -r1.25.2.1 *** framework.py 7 May 2007 02:27:44 -0000 1.25 --- framework.py 26 Nov 2008 09:03:29 -0000 1.25.2.1 *************** *** 79,83 **** # it would be nice to get to the bottom of this, so a warning to # the debug console can't hurt. ! print "WARNING: Ignoring keyboard interrupt from ActiveScripting engine" # If someone else has already redirected, then assume they know what they are doing! if signal.getsignal(signal.SIGINT) == signal.default_int_handler: --- 79,83 ---- # it would be nice to get to the bottom of this, so a warning to # the debug console can't hurt. ! print("WARNING: Ignoring keyboard interrupt from ActiveScripting engine") # If someone else has already redirected, then assume they know what they are doing! if signal.getsignal(signal.SIGINT) == signal.default_int_handler: *************** *** 92,103 **** """ for arg in args: ! print arg, ! print def RaiseAssert(scode, desc): """A debugging function that raises an exception considered an "Assertion". """ ! print "**************** ASSERTION FAILED *******************" ! print desc raise Exception(scode, desc) --- 92,103 ---- """ for arg in args: ! print(arg, end=' ') ! print() def RaiseAssert(scode, desc): """A debugging function that raises an exception considered an "Assertion". """ ! print("**************** ASSERTION FAILED *******************") ! print(desc) raise Exception(scode, desc) *************** *** 270,274 **** if self.flags is not None and self.flags & axscript.SCRIPTITEM_CODEONLY: flagDescs.append("CODE ONLY") ! print " " * level, "Name=", self.name, ", flags=", "/".join(flagDescs), self for subItem in self.subItems.values(): subItem._dump_(level+1) --- 270,274 ---- if self.flags is not None and self.flags & axscript.SCRIPTITEM_CODEONLY: flagDescs.append("CODE ONLY") ! print(" " * level, "Name=", self.name, ", flags=", "/".join(flagDescs), self) for subItem in self.subItems.values(): subItem._dump_(level+1) *************** *** 829,833 **** try: if self.scriptSite: self.scriptSite.OnStateChange(state) ! except pythoncom.com_error, (hr, desc, exc, arg): pass # Ignore all errors here - E_NOTIMPL likely from scriptlets. finally: --- 829,834 ---- try: if self.scriptSite: self.scriptSite.OnStateChange(state) ! except pythoncom.com_error as xxx_todo_changeme: ! (hr, desc, exc, arg) = xxx_todo_changeme.args pass # Ignore all errors here - E_NOTIMPL likely from scriptlets. finally: *************** *** 993,997 **** if __name__=='__main__': ! print "This is a framework class - please use pyscript.py etc" def dumptypeinfo(typeinfo): --- 994,998 ---- if __name__=='__main__': ! print("This is a framework class - please use pyscript.py etc") def dumptypeinfo(typeinfo): *************** *** 999,1003 **** attr = typeinfo.GetTypeAttr() # Loop over all methods ! print "Methods" for j in xrange(attr[6]): fdesc = list(typeinfo.GetFuncDesc(j)) --- 1000,1004 ---- attr = typeinfo.GetTypeAttr() # Loop over all methods ! print("Methods") for j in xrange(attr[6]): fdesc = list(typeinfo.GetFuncDesc(j)) *************** *** 1009,1018 **** doc = typeinfo.GetDocumentation(id) ! print " ", names, "has attr", fdesc # Loop over all variables (ie, properties) ! print "Variables" for j in xrange(attr[7]): fdesc = list(typeinfo.GetVarDesc(j)) names = typeinfo.GetNames(id) ! print " ", names, "has attr", fdesc --- 1010,1019 ---- doc = typeinfo.GetDocumentation(id) ! print(" ", names, "has attr", fdesc) # Loop over all variables (ie, properties) ! print("Variables") for j in xrange(attr[7]): fdesc = list(typeinfo.GetVarDesc(j)) names = typeinfo.GetNames(id) ! print(" ", names, "has attr", fdesc) Index: error.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/error.py,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** error.py 26 Nov 2008 07:17:39 -0000 1.9.2.1 --- error.py 26 Nov 2008 09:03:29 -0000 1.9.2.2 *************** *** 38,42 **** _public_methods_ = ["GetSourceLineText","GetSourcePosition","GetExceptionInfo"] def _query_interface_(self, iid): ! print "IActiveScriptError QI - unknown IID", iid return 0 def _SetExceptionInfo(self, exc): --- 38,42 ---- _public_methods_ = ["GetSourceLineText","GetSourcePosition","GetExceptionInfo"] def _query_interface_(self, iid): ! print("IActiveScriptError QI - unknown IID", iid) return 0 def _SetExceptionInfo(self, exc): *************** *** 182,186 **** bits[i] = bits[i].decode('utf8') ! self.description = ExpandTabs(u''.join(bits)) # Clear tracebacks etc. tb = tb_top = tb_look = None --- 182,186 ---- bits[i] = bits[i].decode('utf8') ! self.description = ExpandTabs(''.join(bits)) # Clear tracebacks etc. tb = tb_top = tb_look = None *************** *** 229,236 **** try: result = scriptingSite.OnScriptError(gateway) ! except pythoncom.com_error, details: ! print "**OnScriptError failed:", details ! print "Exception description:'%s'" % (`exceptionInstance.description`) ! print "Exception text:'%s'" % (`exceptionInstance.linetext`) result = winerror.S_FALSE --- 229,236 ---- try: result = scriptingSite.OnScriptError(gateway) ! except pythoncom.com_error as details: ! print("**OnScriptError failed:", details) ! print("Exception description:'%s'" % (`exceptionInstance.description`)) ! print("Exception text:'%s'" % (`exceptionInstance.linetext`)) result = winerror.S_FALSE Index: pyscript_rexec.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pyscript_rexec.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** pyscript_rexec.py 13 Feb 2005 12:26:33 -0000 1.3 --- pyscript_rexec.py 26 Nov 2008 09:03:29 -0000 1.3.4.1 *************** *** 36,43 **** if __name__=='__main__': ! print "WARNING: By registering this engine, you are giving remote HTML code" ! print "the ability to execute *any* code on your system." ! print ! print "You almost certainly do NOT want to do this." ! print "You have been warned, and are doing this at your own (significant) risk" pyscript.Register(PyScriptRExec) --- 36,43 ---- if __name__=='__main__': ! print("WARNING: By registering this engine, you are giving remote HTML code") ! print("the ability to execute *any* code on your system.") ! print() ! print("You almost certainly do NOT want to do this.") ! print("You have been warned, and are doing this at your own (significant) risk") pyscript.Register(PyScriptRExec) |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:35
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/win32/Demos Modified Files: Tag: py3k NetValidatePasswordPolicy.py Log Message: many more upgrades to py3k syntax Index: NetValidatePasswordPolicy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/NetValidatePasswordPolicy.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** NetValidatePasswordPolicy.py 4 Jun 2008 08:18:55 -0000 1.1 --- NetValidatePasswordPolicy.py 26 Nov 2008 09:03:30 -0000 1.1.2.1 *************** *** 83,98 **** None, val_type, input) except NotImplementedError: ! print "NetValidatePasswordPolicy not implemented on this platform." return 1 ! except win32net.error, exc: ! print "NetValidatePasswordPolicy failed: ", exc return 1 if options.show_fields: ! print "NET_VALIDATE_PERSISTED_FIELDS fields:" pprint(fields) ! print "Result of %r validation is %d: %s" % \ ! (arg, status, win32api.FormatMessage(status).strip()) return 0 --- 83,98 ---- None, val_type, input) except NotImplementedError: ! print("NetValidatePasswordPolicy not implemented on this platform.") return 1 ! except win32net.error as exc: ! print("NetValidatePasswordPolicy failed: ", exc) return 1 if options.show_fields: ! print("NET_VALIDATE_PERSISTED_FIELDS fields:") pprint(fields) ! print("Result of %r validation is %d: %s" % \ ! (arg, status, win32api.FormatMessage(status).strip())) return 0 |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/win32/scripts/VersionStamp Modified Files: Tag: py3k BrandProject.py bulkstamp.py vssutil.py Log Message: many more upgrades to py3k syntax Index: bulkstamp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp/bulkstamp.py,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** bulkstamp.py 24 Oct 2003 07:06:24 -0000 1.6 --- bulkstamp.py 26 Nov 2008 09:03:30 -0000 1.6.4.1 *************** *** 65,72 **** verstamp.stamp(vars, pathname, desc, is_dll=is_dll) numStamped = numStamped + 1 ! except win32api.error, (hr, func, desc): ! print "Could not stamp", pathname, "Error", hr, "-", desc else: ! print 'WARNING: description not provided for:', name # skip branding this - assume already branded or handled elsewhere # print "Stamped", pathname --- 65,73 ---- verstamp.stamp(vars, pathname, desc, is_dll=is_dll) numStamped = numStamped + 1 ! except win32api.error as xxx_todo_changeme: ! (hr, func, desc) = xxx_todo_changeme.args ! print("Could not stamp", pathname, "Error", hr, "-", desc) else: ! print('WARNING: description not provided for:', name) # skip branding this - assume already branded or handled elsewhere # print "Stamped", pathname *************** *** 86,90 **** idx1 = idx2 if idx1 == -1: ! print 'ERROR: bad syntax in description file at line %d.' % (i+1) sys.exit(1) --- 87,91 ---- idx1 = idx2 if idx1 == -1: ! print('ERROR: bad syntax in description file at line %d.' % (i+1)) sys.exit(1) *************** *** 97,107 **** if not retvars.has_key('product'): ! print 'ERROR: description file is missing the product name.' sys.exit(1) if not retvars.has_key('major'): ! print 'ERROR: description file is missing the major version number.' sys.exit(1) if not retvars.has_key('minor'): ! print 'ERROR: description file is missing the minor version number.' sys.exit(1) --- 98,108 ---- if not retvars.has_key('product'): ! print('ERROR: description file is missing the product name.') sys.exit(1) if not retvars.has_key('major'): ! print('ERROR: description file is missing the major version number.') sys.exit(1) if not retvars.has_key('minor'): ! print('ERROR: description file is missing the minor version number.') sys.exit(1) *************** *** 114,118 **** build = string.atoi(build) except ValueError: ! print 'ERROR: build number is not a number: %s' % build sys.exit(1) --- 115,119 ---- build = string.atoi(build) except ValueError: ! print('ERROR: build number is not a number: %s' % build) sys.exit(1) *************** *** 128,136 **** os.path.walk(root, walk, arg) ! print "Stamped %d files." % (numStamped) if __name__ == '__main__': if len(sys.argv) != 4: ! print "ERROR: incorrect invocation. See script's header comments." sys.exit(1) --- 129,137 ---- os.path.walk(root, walk, arg) ! print("Stamped %d files." % (numStamped)) if __name__ == '__main__': if len(sys.argv) != 4: ! print("ERROR: incorrect invocation. See script's header comments.") sys.exit(1) Index: vssutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp/vssutil.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** vssutil.py 2 Sep 1999 00:19:34 -0000 1.1 --- vssutil.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 23,27 **** for item in project.GetVersions(constants.VSSFLAG_RECURSYES): ! print item.VSSItem.Name, item.VersionNumber, item.Action --- 23,27 ---- for item in project.GetVersions(constants.VSSFLAG_RECURSYES): ! print(item.VSSItem.Name, item.VersionNumber, item.Action) *************** *** 45,49 **** except: traceback.print_exc() ! print "Could not substitute", strVal if not didSubst: newFields.append(strVal) --- 45,49 ---- except: traceback.print_exc() ! print("Could not substitute", strVal) if not didSubst: newFields.append(strVal) *************** *** 91,95 **** import win32api if win32api.GetFullPathName(inName)==win32api.GetFullPathName(outName): ! raise RuntimeError, "The input and output filenames can not be the same" sourceSafe=GetSS() project = sourceSafe.VSSItem(projectName) --- 91,95 ---- import win32api if win32api.GetFullPathName(inName)==win32api.GetFullPathName(outName): ! raise RuntimeError("The input and output filenames can not be the same") sourceSafe=GetSS() project = sourceSafe.VSSItem(projectName) *************** *** 100,104 **** break else: ! print "Couldnt find a label in the sourcesafe project!" return # Setup some local helpers for the conversion strings. --- 100,104 ---- break else: ! print("Couldnt find a label in the sourcesafe project!") return # Setup some local helpers for the conversion strings. *************** *** 150,154 **** buildNo = str(buildNo) except ValueError: ! raise error, "The previous label could not be incremented: %s" % (oldBuild) if not auto: --- 150,154 ---- buildNo = str(buildNo) except ValueError: ! raise error("The previous label could not be incremented: %s" % (oldBuild)) if not auto: *************** *** 158,162 **** i.Label(buildNo, "Build %s: %s" % (buildNo,buildDesc)) if auto: ! print "Branded project %s with label %s" % (project, buildNo) return buildNo --- 158,162 ---- i.Label(buildNo, "Build %s: %s" % (buildNo,buildDesc)) if auto: ! print("Branded project %s with label %s" % (project, buildNo)) return buildNo Index: BrandProject.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp/BrandProject.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** BrandProject.py 8 Mar 2000 09:56:02 -0000 1.2 --- BrandProject.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 17,21 **** build = vssutil.MakeNewBuildNo(vssProjectName, buildDesc, auto, bRebrand) if build is None: ! print "Cancelled" return --- 17,21 ---- build = vssutil.MakeNewBuildNo(vssProjectName, buildDesc, auto, bRebrand) if build is None: ! print("Cancelled") return *************** *** 26,31 **** def usage(msg): ! print msg ! print """\ %s Usage: %s [options] vssProject descFile stampPath --- 26,31 ---- def usage(msg): ! print(msg) ! print("""\ %s Usage: %s [options] vssProject descFile stampPath *************** *** 44,48 **** -f infile=outfile - Substitute special VSS labels in the specified text file with the text extracted from VSS. ! """ % (os.path.basename(sys.argv[0]), os.path.basename(sys.argv[0])) sys.exit(1) --- 44,48 ---- -f infile=outfile - Substitute special VSS labels in the specified text file with the text extracted from VSS. ! """ % (os.path.basename(sys.argv[0]), os.path.basename(sys.argv[0]))) sys.exit(1) *************** *** 51,55 **** import getopt opts, args = getopt.getopt(sys.argv[1:], "af:d:r") ! except getopts.error, msg: usage(msg) bAuto = bRebrand = 0 --- 51,55 ---- import getopt opts, args = getopt.getopt(sys.argv[1:], "af:d:r") ! except getopts.error as msg: usage(msg) bAuto = bRebrand = 0 |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/shell/demos Modified Files: Tag: py3k IActiveDesktop.py IShellLinkDataList.py IUniformResourceLocator.py create_link.py dump_link.py explorer_browser.py shellexecuteex.py viewstate.py walk_shell_folders.py Log Message: many more upgrades to py3k syntax Index: create_link.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/create_link.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** create_link.py 22 Sep 2006 04:53:30 -0000 1.1 --- create_link.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 24,28 **** import sys if len(sys.argv)<2: ! print "Usage: %s LinkFile [path [, args[, description[, working_dir]]]]\n\nIf LinkFile does not exist, it will be created using the other args" sys.exit(1) file = sys.argv[1] --- 24,28 ---- import sys if len(sys.argv)<2: ! print("Usage: %s LinkFile [path [, args[, description[, working_dir]]]]\n\nIf LinkFile does not exist, it will be created using the other args") sys.exit(1) file = sys.argv[1] *************** *** 32,36 **** shortcut.load( file ) # now print data... ! print 'Shortcut in file %s to file:\n\t%s\nArguments:\n\t%s\nDescription:\n\t%s\nWorking Directory:\n\t%s\nItemIDs:\n\t<skipped>'%( file, shortcut.GetPath(shell.SLGP_SHORTPATH)[0], --- 32,36 ---- shortcut.load( file ) # now print data... ! print('Shortcut in file %s to file:\n\t%s\nArguments:\n\t%s\nDescription:\n\t%s\nWorking Directory:\n\t%s\nItemIDs:\n\t<skipped>'%( file, shortcut.GetPath(shell.SLGP_SHORTPATH)[0], *************** *** 39,46 **** shortcut.GetWorkingDirectory(), #shortcut.GetIDList(), ! ) else: if len(sys.argv) <3: ! print "Link file does not exist\nYou must supply the path, args, description and working_dir as args" sys.exit(1) # create the shortcut using rest of args... --- 39,46 ---- shortcut.GetWorkingDirectory(), #shortcut.GetIDList(), ! )) else: if len(sys.argv) <3: ! print("Link file does not exist\nYou must supply the path, args, description and working_dir as args") sys.exit(1) # create the shortcut using rest of args... Index: IUniformResourceLocator.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/IUniformResourceLocator.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** IUniformResourceLocator.py 6 Apr 2006 10:50:40 -0000 1.1 --- IUniformResourceLocator.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 21,25 **** temp_dir=win32api.GetTempPath() linkname=win32api.GetTempFileName(temp_dir, 'ish')[0] ! print 'Link:',linkname os.remove(linkname) linkname+='.url' --- 21,25 ---- temp_dir=win32api.GetTempPath() linkname=win32api.GetTempFileName(temp_dir, 'ish')[0] ! print('Link:',linkname) os.remove(linkname) linkname+='.url' *************** *** 34,43 **** property_ids=[(k,v) for k,v in shellcon.__dict__.items() if k.startswith('PID_INTSITE_')] for pname, pval in property_ids: ! print pname, ps.ReadMultiple((pval,))[0] ps=pss.Open(shell.FMTID_Intshcut) property_ids=[(k,v) for k,v in shellcon.__dict__.items() if k.startswith('PID_IS_')] for pname, pval in property_ids: ! print pname, ps.ReadMultiple((pval,))[0] new_sh=InternetShortcut() --- 34,43 ---- property_ids=[(k,v) for k,v in shellcon.__dict__.items() if k.startswith('PID_INTSITE_')] for pname, pval in property_ids: ! print(pname, ps.ReadMultiple((pval,))[0]) ps=pss.Open(shell.FMTID_Intshcut) property_ids=[(k,v) for k,v in shellcon.__dict__.items() if k.startswith('PID_IS_')] for pname, pval in property_ids: ! print(pname, ps.ReadMultiple((pval,))[0]) new_sh=InternetShortcut() Index: viewstate.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/viewstate.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** viewstate.py 16 May 2005 07:53:18 -0000 1.1 --- viewstate.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 10,14 **** template_folder=os.path.split(sys.executable)[0] ! print 'Template folder:', template_folder template_pidl=shell.SHILCreateFromPath(template_folder,0)[0] template_pb=shell.SHGetViewStatePropertyBag(template_pidl, "Shell", shellcon.SHGVSPB_FOLDERNODEFAULTS, pythoncom.IID_IPropertyBag) --- 10,14 ---- template_folder=os.path.split(sys.executable)[0] ! print('Template folder:', template_folder) template_pidl=shell.SHILCreateFromPath(template_folder,0)[0] template_pb=shell.SHGetViewStatePropertyBag(template_pidl, "Shell", shellcon.SHGVSPB_FOLDERNODEFAULTS, pythoncom.IID_IPropertyBag) *************** *** 25,29 **** full_fname=os.path.join(dir_name,fname) if os.path.isdir(full_fname): ! print full_fname pidl=shell.SHILCreateFromPath(full_fname,0)[0] pb=shell.SHGetViewStatePropertyBag(pidl, "Shell", shellcon.SHGVSPB_FOLDERNODEFAULTS, pythoncom.IID_IPropertyBag) --- 25,29 ---- full_fname=os.path.join(dir_name,fname) if os.path.isdir(full_fname): ! print(full_fname) pidl=shell.SHILCreateFromPath(full_fname,0)[0] pb=shell.SHGetViewStatePropertyBag(pidl, "Shell", shellcon.SHGVSPB_FOLDERNODEFAULTS, pythoncom.IID_IPropertyBag) Index: shellexecuteex.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/shellexecuteex.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** shellexecuteex.py 2 Jul 2004 04:17:10 -0000 1.1 --- shellexecuteex.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 4,8 **** def ExplorePIDL(): pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) ! print "The desktop is at", shell.SHGetPathFromIDList(pidl) shell.ShellExecuteEx(fMask=shellcon.SEE_MASK_NOCLOSEPROCESS, nShow=win32con.SW_NORMAL, --- 4,8 ---- def ExplorePIDL(): pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) ! print("The desktop is at", shell.SHGetPathFromIDList(pidl)) shell.ShellExecuteEx(fMask=shellcon.SEE_MASK_NOCLOSEPROCESS, nShow=win32con.SW_NORMAL, *************** *** 10,14 **** lpVerb="explore", lpIDList=pidl) ! print "Done!" if __name__=='__main__': --- 10,14 ---- lpVerb="explore", lpIDList=pidl) ! print("Done!") if __name__=='__main__': Index: dump_link.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/dump_link.py,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** dump_link.py 18 Aug 2008 13:00:39 -0000 1.2 --- dump_link.py 26 Nov 2008 09:03:30 -0000 1.2.2.1 *************** *** 13,33 **** shellLink.Resolve(0, shell.SLR_ANY_MATCH | shell.SLR_NO_UI) fname, findData = shellLink.GetPath(0) ! print "Filename:", fname, ", UNC=", shellLink.GetPath(shell.SLGP_UNCPRIORITY)[0] ! print "Description:", shellLink.GetDescription() ! print "Working Directory:", shellLink.GetWorkingDirectory() ! print "Icon:", shellLink.GetIconLocation() def FavDumper(nothing, path, names): # called by os.path.walk for name in names: ! print name, try: DumpLink(name) except pythoncom.com_error: ! print " - not a link" def DumpFavorites(): favfold = str(shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_FAVORITES)) ! print "Your favourites are at", favfold os.path.walk(favfold, FavDumper, None) --- 13,33 ---- shellLink.Resolve(0, shell.SLR_ANY_MATCH | shell.SLR_NO_UI) fname, findData = shellLink.GetPath(0) ! print("Filename:", fname, ", UNC=", shellLink.GetPath(shell.SLGP_UNCPRIORITY)[0]) ! print("Description:", shellLink.GetDescription()) ! print("Working Directory:", shellLink.GetWorkingDirectory()) ! print("Icon:", shellLink.GetIconLocation()) def FavDumper(nothing, path, names): # called by os.path.walk for name in names: ! print(name, end=' ') try: DumpLink(name) except pythoncom.com_error: ! print(" - not a link") def DumpFavorites(): favfold = str(shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_FAVORITES)) ! print("Your favourites are at", favfold) os.path.walk(favfold, FavDumper, None) *************** *** 38,47 **** if files: for file in files: ! print file DumpLink(file) ! print else: ! print "Can not find", fspec else: ! print "Dumping your favorites folder!" DumpFavorites() --- 38,47 ---- if files: for file in files: ! print(file) DumpLink(file) ! print() else: ! print("Can not find", fspec) else: ! print("Dumping your favorites folder!") DumpFavorites() Index: explorer_browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/explorer_browser.py,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** explorer_browser.py 26 Jul 2008 07:02:34 -0000 1.2 --- explorer_browser.py 26 Nov 2008 09:03:30 -0000 1.2.2.1 *************** *** 17,35 **** def OnNavigationComplete(self, pidl): ! print "OnNavComplete", pidl def OnNavigationFailed(self, pidl): ! print "OnNavigationFailed", pidl def OnNavigationPending(self, pidl): ! print "OnNavigationPending", pidl def OnViewCreated(self, view): ! print "OnViewCreated", view # And if our demo view has been registered, it may well # be that view! try: pyview = unwrap(view) ! print "and look - its a Python implemented view!", pyview except ValueError: pass --- 17,35 ---- def OnNavigationComplete(self, pidl): ! print("OnNavComplete", pidl) def OnNavigationFailed(self, pidl): ! print("OnNavigationFailed", pidl) def OnNavigationPending(self, pidl): ! print("OnNavigationPending", pidl) def OnViewCreated(self, view): ! print("OnViewCreated", view) # And if our demo view has been registered, it may well # be that view! try: pyview = unwrap(view) ! print("and look - its a Python implemented view!", pyview) except ValueError: pass *************** *** 79,87 **** tree = sp.QueryService(shell.IID_INameSpaceTreeControl, shell.IID_INameSpaceTreeControl) ! except pythoncom.com_error, exc: # this should really only fail if no "nav" frame exists... ! print "Strange - failed to get the tree control even though " \ ! "we asked for a EBO_SHOWFRAMES" ! print exc else: # get the IShellItem for the selection. --- 79,87 ---- tree = sp.QueryService(shell.IID_INameSpaceTreeControl, shell.IID_INameSpaceTreeControl) ! except pythoncom.com_error as exc: # this should really only fail if no "nav" frame exists... ! print("Strange - failed to get the tree control even though " \ ! "we asked for a EBO_SHOWFRAMES") ! print(exc) else: # get the IShellItem for the selection. *************** *** 98,106 **** def OnDestroy(self, hwnd, msg, wparam, lparam): ! print "tearing down ExplorerBrowser..." self.eb.Unadvise(self.event_cookie) self.eb.Destroy() self.eb = None ! print "shutting down app..." win32gui.PostQuitMessage(0) --- 98,106 ---- def OnDestroy(self, hwnd, msg, wparam, lparam): ! print("tearing down ExplorerBrowser...") self.eb.Unadvise(self.event_cookie) self.eb.Destroy() self.eb = None ! print("shutting down app...") win32gui.PostQuitMessage(0) Index: IShellLinkDataList.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/IShellLinkDataList.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** IShellLinkDataList.py 6 Apr 2006 10:50:40 -0000 1.1 --- IShellLinkDataList.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 6,10 **** os.remove(linkname) linkname+='.lnk' ! print 'Link name:',linkname ish=pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink) --- 6,10 ---- os.remove(linkname) linkname+='.lnk' ! print('Link name:',linkname) ish=pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink) Index: walk_shell_folders.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/walk_shell_folders.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** walk_shell_folders.py 27 Sep 2005 01:46:35 -0000 1.1 --- walk_shell_folders.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 12,16 **** dn = folder.GetDisplayNameOf(pidl, shellcon.SHGDN_NORMAL) ! print indent, dn if depth: try: --- 12,16 ---- dn = folder.GetDisplayNameOf(pidl, shellcon.SHGDN_NORMAL) ! print(indent, dn) if depth: try: Index: IActiveDesktop.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/IActiveDesktop.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** IActiveDesktop.py 6 Apr 2006 10:50:40 -0000 1.1 --- IActiveDesktop.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 6,10 **** opts=iad.GetDesktopItemOptions() if not (opts['ActiveDesktop'] and opts['EnableComponents']): ! print 'Warning: Enabling Active Desktop' opts['ActiveDesktop']=True opts['EnableComponents']=True --- 6,10 ---- opts=iad.GetDesktopItemOptions() if not (opts['ActiveDesktop'] and opts['EnableComponents']): ! print('Warning: Enabling Active Desktop') opts['ActiveDesktop']=True opts['EnableComponents']=True *************** *** 17,23 **** cnt=iad.GetDesktopItemCount() ! print 'Count:', cnt for i in range(cnt): ! print iad.GetDesktopItem(i) component={ --- 17,23 ---- cnt=iad.GetDesktopItemCount() ! print('Count:', cnt) for i in range(cnt): ! print(iad.GetDesktopItem(i)) component={ |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/shell/demos/servers Modified Files: Tag: py3k column_provider.py context_menu.py copy_hook.py empty_volume_cache.py folder_view.py icon_handler.py shell_view.py Log Message: many more upgrades to py3k syntax Index: column_provider.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/column_provider.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** column_provider.py 6 Nov 2003 06:12:16 -0000 1.1 --- column_provider.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 36,40 **** def Initialize(self, colInit): flags, reserved, name = colInit ! print "ColumnProvider initializing for file", name def GetColumnInfo(self, index): # We support exactly 2 columns - 'pyc size' and 'pyo size' --- 36,40 ---- def Initialize(self, colInit): flags, reserved, name = colInit ! print("ColumnProvider initializing for file", name) def GetColumnInfo(self, index): # We support exactly 2 columns - 'pyc size' and 'pyo size' *************** *** 85,89 **** str(ColumnProvider._reg_clsid_ )) _winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ColumnProvider._reg_desc_) ! print ColumnProvider._reg_desc_, "registration complete." def DllUnregisterServer(): --- 85,89 ---- str(ColumnProvider._reg_clsid_ )) _winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ColumnProvider._reg_desc_) ! print(ColumnProvider._reg_desc_, "registration complete.") def DllUnregisterServer(): *************** *** 93,101 **** "Folder\\ShellEx\\ColumnHandlers\\" + \ str(ColumnProvider._reg_clsid_) ) ! except WindowsError, details: import errno if details.errno != errno.ENOENT: raise ! print ColumnProvider._reg_desc_, "unregistration complete." if __name__=='__main__': --- 93,101 ---- "Folder\\ShellEx\\ColumnHandlers\\" + \ str(ColumnProvider._reg_clsid_) ) ! except WindowsError as details: import errno if details.errno != errno.ENOENT: raise ! print(ColumnProvider._reg_desc_, "unregistration complete.") if __name__=='__main__': Index: copy_hook.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/copy_hook.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** copy_hook.py 8 Oct 2003 08:40:20 -0000 1.2 --- copy_hook.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 27,31 **** # IDNO Prevents the operation on this folder but continues with any other operations that have been approved (for example, a batch copy operation). # IDCANCEL Prevents the current operation and cancels any pending operations. ! print "CopyCallBack", hwnd, func, flags, srcName, srcAttr, destName, destAttr return win32gui.MessageBox(hwnd, "Allow operation?", "CopyHook", win32con.MB_YESNO) --- 27,31 ---- # IDNO Prevents the operation on this folder but continues with any other operations that have been approved (for example, a batch copy operation). # IDCANCEL Prevents the current operation and cancels any pending operations. ! print("CopyCallBack", hwnd, func, flags, srcName, srcAttr, destName, destAttr) return win32gui.MessageBox(hwnd, "Allow operation?", "CopyHook", win32con.MB_YESNO) *************** *** 41,45 **** ShellExtension._reg_desc_) _winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_) ! print ShellExtension._reg_desc_, "registration complete." def DllUnregisterServer(): --- 41,45 ---- ShellExtension._reg_desc_) _winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_) ! print(ShellExtension._reg_desc_, "registration complete.") def DllUnregisterServer(): *************** *** 49,53 **** "directory\\shellex\\CopyHookHandlers\\" + ShellExtension._reg_desc_) ! except WindowsError, details: import errno if details.errno != errno.ENOENT: --- 49,53 ---- "directory\\shellex\\CopyHookHandlers\\" + ShellExtension._reg_desc_) ! except WindowsError as details: import errno if details.errno != errno.ENOENT: *************** *** 57,65 **** "*\\shellex\\CopyHookHandlers\\" + ShellExtension._reg_desc_) ! except WindowsError, details: import errno if details.errno != errno.ENOENT: raise ! print ShellExtension._reg_desc_, "unregistration complete." if __name__=='__main__': --- 57,65 ---- "*\\shellex\\CopyHookHandlers\\" + ShellExtension._reg_desc_) ! except WindowsError as details: import errno if details.errno != errno.ENOENT: raise ! print(ShellExtension._reg_desc_, "unregistration complete.") if __name__=='__main__': Index: empty_volume_cache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/empty_volume_cache.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** empty_volume_cache.py 15 Feb 2007 13:11:02 -0000 1.1 --- empty_volume_cache.py 26 Nov 2008 09:03:30 -0000 1.1.2.1 *************** *** 21,25 **** if not os.path.isfile(ico): ico = None ! print "Can't find python.ico - no icon will be installed" class EmptyVolumeCache: --- 21,25 ---- if not os.path.isfile(ico): ico = None ! print("Can't find python.ico - no icon will be installed") class EmptyVolumeCache: *************** *** 33,37 **** def Initialize(self, hkey, volume, flags): # This should never be called, except on win98. ! print "Unless we are on 98, Initialize call is unexpected!" raise COMException(hresult=winerror.E_NOTIMPL) --- 33,37 ---- def Initialize(self, hkey, volume, flags): # This should never be called, except on win98. ! print("Unless we are on 98, Initialize call is unexpected!") raise COMException(hresult=winerror.E_NOTIMPL) *************** *** 39,46 **** # Must return a tuple of: # (display_name, description, button_name, flags) ! print "InitializeEx called with", hkey, volume, key_name, flags self.volume = volume if flags & shellcon.EVCF_SETTINGSMODE: ! print "We are being run on a schedule" # In this case, "because there is no opportunity for user # feedback, only those files that are extremely safe to clean up --- 39,46 ---- # Must return a tuple of: # (display_name, description, button_name, flags) ! print("InitializeEx called with", hkey, volume, key_name, flags) self.volume = volume if flags & shellcon.EVCF_SETTINGSMODE: ! print("We are being run on a schedule") # In this case, "because there is no opportunity for user # feedback, only those files that are extremely safe to clean up *************** *** 54,61 **** # handler obviously should not delete files that would cause an # application to fail or the user to lose data." ! print "We are being run as we are out of disk-space" else: # This case is not documented - we are guessing :) ! print "We are being run because the user asked" # For the sake of demo etc, we tell the shell to only show us when --- 54,61 ---- # handler obviously should not delete files that would cause an # application to fail or the user to lose data." ! print("We are being run as we are out of disk-space") else: # This case is not documented - we are guessing :) ! print("We are being run because the user asked") # For the sake of demo etc, we tell the shell to only show us when *************** *** 90,94 **** # referenced if total_list is None: ! print "Deleting file", fqn # Should do callback.PurgeProcess - left as an exercise :) os.remove(fqn) --- 90,94 ---- # referenced if total_list is None: ! print("Deleting file", fqn) # Should do callback.PurgeProcess - left as an exercise :) os.remove(fqn) *************** *** 112,125 **** for d in self._GetDirectories(): os.path.walk(d, self._WalkCallback, (callback, total)) ! print "After looking in", d, "we have", total[0], "bytes" ! except pythoncom.error, (hr, msg, exc, arg): # This will be raised by the callback when the user selects 'cancel'. if hr != winerror.E_ABORT: raise # that's the documented error code! ! print "User cancelled the operation" return total[0] def Purge(self, amt_to_free, callback): ! print "Purging", amt_to_free, "bytes..." # we ignore amt_to_free - it is generally what we returned for # GetSpaceUsed --- 112,127 ---- for d in self._GetDirectories(): os.path.walk(d, self._WalkCallback, (callback, total)) ! print("After looking in", d, "we have", total[0], "bytes") ! except pythoncom.error as xxx_todo_changeme: ! # This will be raised by the callback when the user selects 'cancel'. ! (hr, msg, exc, arg) = xxx_todo_changeme.args # This will be raised by the callback when the user selects 'cancel'. if hr != winerror.E_ABORT: raise # that's the documented error code! ! print("User cancelled the operation") return total[0] def Purge(self, amt_to_free, callback): ! print("Purging", amt_to_free, "bytes...") # we ignore amt_to_free - it is generally what we returned for # GetSpaceUsed *************** *** 127,135 **** for d in self._GetDirectories(): os.path.walk(d, self._WalkCallback, (callback, None)) ! except pythoncom.error, (hr, msg, exc, arg): # This will be raised by the callback when the user selects 'cancel'. if hr != winerror.E_ABORT: raise # that's the documented error code! ! print "User cancelled the operation" def ShowProperties(self, hwnd): --- 129,139 ---- for d in self._GetDirectories(): os.path.walk(d, self._WalkCallback, (callback, None)) ! except pythoncom.error as xxx_todo_changeme1: ! # This will be raised by the callback when the user selects 'cancel'. ! (hr, msg, exc, arg) = xxx_todo_changeme1.args # This will be raised by the callback when the user selects 'cancel'. if hr != winerror.E_ABORT: raise # that's the documented error code! ! print("User cancelled the operation") def ShowProperties(self, hwnd): *************** *** 137,141 **** def Deactivate(self): ! print "Deactivate called" return 0 --- 141,145 ---- def Deactivate(self): ! print("Deactivate called") return 0 *************** *** 156,164 **** try: key = _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, kn) ! except WindowsError, details: import errno if details.errno != errno.ENOENT: raise ! print EmptyVolumeCache._reg_desc_, "unregistration complete." if __name__=='__main__': --- 160,168 ---- try: key = _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, kn) ! except WindowsError as details: import errno if details.errno != errno.ENOENT: raise ! print(EmptyVolumeCache._reg_desc_, "unregistration complete.") if __name__=='__main__': Index: folder_view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/folder_view.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** folder_view.py 7 Feb 2008 05:42:01 -0000 1.1 --- folder_view.py 26 Nov 2008 09:03:30 -0000 1.1.2.1 *************** *** 219,223 **** self.cmd.callback(items, bind_ctx) else: ! print "No callback for command ", LoadString(self.cmd.ids) def EnumSubCommands(self): if not self.cmd.children: --- 219,223 ---- self.cmd.callback(items, bind_ctx) else: ! print("No callback for command ", LoadString(self.cmd.ids)) def EnumSubCommands(self): if not self.cmd.children: *************** *** 679,683 **** import _winreg if sys.getwindowsversion()[0] < 6: ! print "This sample only works on Vista" sys.exit(1) --- 679,683 ---- import _winreg if sys.getwindowsversion()[0] < 6: ! print("This sample only works on Vista") sys.exit(1) *************** *** 701,705 **** _winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ContextMenu._reg_clsid_) propsys.PSRegisterPropertySchema(get_schema_fname()) ! print ShellFolder._reg_desc_, "registration complete." def DllUnregisterServer(): --- 701,705 ---- _winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ContextMenu._reg_clsid_) propsys.PSRegisterPropertySchema(get_schema_fname()) ! print(ShellFolder._reg_desc_, "registration complete.") def DllUnregisterServer(): *************** *** 712,722 **** try: _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, path) ! except WindowsError, details: import errno if details.errno != errno.ENOENT: ! print "FAILED to remove %s: %s" % (path, details) propsys.PSUnregisterPropertySchema(get_schema_fname()) ! print ShellFolder._reg_desc_, "unregistration complete." if __name__=='__main__': --- 712,722 ---- try: _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, path) ! except WindowsError as details: import errno if details.errno != errno.ENOENT: ! print("FAILED to remove %s: %s" % (path, details)) propsys.PSUnregisterPropertySchema(get_schema_fname()) ! print(ShellFolder._reg_desc_, "unregistration complete.") if __name__=='__main__': Index: shell_view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/shell_view.py,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** shell_view.py 20 Jul 2008 03:16:25 -0000 1.12 --- shell_view.py 26 Nov 2008 09:03:30 -0000 1.12.2.1 *************** *** 116,123 **** return 0 def ParseDisplayName(self, hwnd, reserved, displayName, attr): ! print "ParseDisplayName", displayName # return cchEaten, pidl, attr def BindToStorage(self, pidl, bc, iid): ! print "BTS", iid, IIDToInterfaceName(iid) def BindToObject(self, pidl, bc, iid): # We may be passed a set of relative PIDLs here - ie --- 116,123 ---- return 0 def ParseDisplayName(self, hwnd, reserved, displayName, attr): ! print("ParseDisplayName", displayName) # return cchEaten, pidl, attr def BindToStorage(self, pidl, bc, iid): ! print("BTS", iid, IIDToInterfaceName(iid)) def BindToObject(self, pidl, bc, iid): # We may be passed a set of relative PIDLs here - ie *************** *** 134,138 **** klass = ShellFolderObject else: ! raise RuntimeError, "What is " + repr(typ) ret = wrap(klass(extra), iid, useDispatcher = (debug>0)) return ret --- 134,138 ---- klass = ShellFolderObject else: ! raise RuntimeError("What is " + repr(typ)) ret = wrap(klass(extra), iid, useDispatcher = (debug>0)) return ret *************** *** 157,161 **** inout, ret = folder.GetUIObjectOf(hwndOwner, [child_pidl], iid, inout, iid) ! except pythoncom.com_error, (hr, desc, exc, arg): raise COMException(hresult=hr) return inout, ret --- 157,162 ---- inout, ret = folder.GetUIObjectOf(hwndOwner, [child_pidl], iid, inout, iid) ! except pythoncom.com_error as xxx_todo_changeme: ! (hr, desc, exc, arg) = xxx_todo_changeme.args raise COMException(hresult=hr) return inout, ret *************** *** 363,367 **** # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print "FileSystemView.CreateViewWindow", prev, settings, browser, rect self.cur_foldersettings = settings self.browser = browser --- 364,368 ---- # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print("FileSystemView.CreateViewWindow", prev, settings, browser, rect) self.cur_foldersettings = settings self.browser = browser *************** *** 391,395 **** try: win32gui.RegisterClass(wc) ! except win32gui.error, details: # Should only happen when this module is reloaded if details[0] != winerror.ERROR_CLASS_ALREADY_EXISTS: --- 392,396 ---- try: win32gui.RegisterClass(wc) ! except win32gui.error as details: # Should only happen when this module is reloaded if details[0] != winerror.ERROR_CLASS_ALREADY_EXISTS: *************** *** 408,412 **** self.hwnd_parent, 0, win32gui.dllhandle, None) win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map) ! print "View 's hwnd is", self.hwnd return self.hwnd --- 409,413 ---- self.hwnd_parent, 0, win32gui.dllhandle, None) win32gui.SetWindowLong(self.hwnd, win32con.GWL_WNDPROC, message_map) ! print("View 's hwnd is", self.hwnd) return self.hwnd *************** *** 473,477 **** def UIActivate(self, activate_state): ! print "OnActivate" def _OnActivate(self, activate_state): --- 474,478 ---- def UIActivate(self, activate_state): ! print("OnActivate") def _OnActivate(self, activate_state): *************** *** 514,518 **** data = win32gui_struct.UnpackMENUITEMINFO(buf) submenu = data[3] ! print "Do someting with the file menu!" def Refresh(self): --- 515,519 ---- data = win32gui_struct.UnpackMENUITEMINFO(buf) submenu = data[3] ! print("Do someting with the file menu!") def Refresh(self): *************** *** 556,560 **** # You would need to locate the index of the item in the shell-view # with that PIDL, then ask the list-view to select it. ! print "Please implement SelectItem for PIDL", pidl def GetItemObject(self, item_num, iid): --- 557,561 ---- # You would need to locate the index of the item in the shell-view # with that PIDL, then ask the list-view to select it. ! print("Please implement SelectItem for PIDL", pidl) def GetItemObject(self, item_num, iid): *************** *** 567,578 **** win32gui.DestroyWindow(self.hwnd) self.hwnd = None ! print "Destroyed view window" # Message handlers. def OnDestroy(self, hwnd, msg, wparam, lparam): ! print "OnDestory" def OnCommand(self, hwnd, msg, wparam, lparam): ! print "OnCommand" def OnNotify(self, hwnd, msg, wparam, lparam): --- 568,579 ---- win32gui.DestroyWindow(self.hwnd) self.hwnd = None ! print("Destroyed view window") # Message handlers. def OnDestroy(self, hwnd, msg, wparam, lparam): ! print("OnDestory") def OnCommand(self, hwnd, msg, wparam, lparam): ! print("OnCommand") def OnNotify(self, hwnd, msg, wparam, lparam): *************** *** 606,610 **** break sel.append(self.children[n][-1:]) ! print "Selection is", sel hmenu = win32gui.CreateMenu() try: --- 607,611 ---- break sel.append(self.children[n][-1:]) ! print("Selection is", sel) hmenu = win32gui.CreateMenu() try: *************** *** 638,642 **** cmd = win32gui.GetMenuDefaultItem(hmenu, False, 0) if cmd == -1: ! print "Oops: _doDefaultActionFor found no default menu" else: ci = 0, self.hwnd_parent, cmd-id_cmd_first, None, None, 0, 0, 0 --- 639,643 ---- cmd = win32gui.GetMenuDefaultItem(hmenu, False, 0) if cmd == -1: ! print("Oops: _doDefaultActionFor found no default menu") else: ci = 0, self.hwnd_parent, cmd-id_cmd_first, None, None, 0, 0, 0 *************** *** 649,653 **** lpVerb="explore", lpIDList=sel[0]) ! print "ShellExecuteEx returned", rv finally: win32gui.DestroyMenu(hmenu) --- 650,654 ---- lpVerb="explore", lpIDList=sel[0]) ! print("ShellExecuteEx returned", rv) finally: win32gui.DestroyMenu(hmenu) *************** *** 668,672 **** spt = win32api.GetCursorPos() if not pidls: ! print "Ignoring background click" return # Get the IContextMenu for the items. --- 669,673 ---- spt = win32api.GetCursorPos() if not pidls: ! print("Ignoring background click") return # Get the IContextMenu for the items. *************** *** 691,695 **** spt[0], spt[1], 0, self.hwnd, None) ! print "TrackPopupMenu returned", sel finally: win32gui.DestroyMenu(hmenu) --- 692,696 ---- spt[0], spt[1], 0, self.hwnd, None) ! print("TrackPopupMenu returned", sel) finally: win32gui.DestroyMenu(hmenu) *************** *** 721,725 **** # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print "ScintillaShellView.CreateViewWindow", prev, settings, browser, rect # Make sure scintilla.dll is loaded. If not, find it on sys.path # (which it generally is for Pythonwin) --- 722,726 ---- # IShellView def CreateViewWindow(self, prev, settings, browser, rect): ! print("ScintillaShellView.CreateViewWindow", prev, settings, browser, rect) # Make sure scintilla.dll is loaded. If not, find it on sys.path # (which it generally is for Pythonwin) *************** *** 735,739 **** break else: ! raise RuntimeError, "Can't find scintilla!" style = win32con.WS_CHILD | win32con.WS_VSCROLL | \ --- 736,740 ---- break else: ! raise RuntimeError("Can't find scintilla!") style = win32con.WS_CHILD | win32con.WS_VSCROLL | \ *************** *** 755,759 **** if self.lineno != None: self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno) ! print "Scintilla's hwnd is", self.hwnd def _SetupLexer(self): --- 756,760 ---- if self.lineno != None: self._SendSci(scintillacon.SCI_GOTOLINE, self.lineno) ! print("Scintilla's hwnd is", self.hwnd) def _SetupLexer(self): *************** *** 795,804 **** def UIActivate(self, activate_state): ! print "OnActivate" def DestroyViewWindow(self): win32gui.DestroyWindow(self.hwnd) self.hwnd = None ! print "Destroyed scintilla window" def TranslateAccelerator(self, msg): --- 796,805 ---- def UIActivate(self, activate_state): ! print("OnActivate") def DestroyViewWindow(self): win32gui.DestroyWindow(self.hwnd) self.hwnd = None ! print("Destroyed scintilla window") def TranslateAccelerator(self, msg): *************** *** 826,830 **** s = struct.pack("i", attr) _winreg.SetValueEx(key, "Attributes", 0, _winreg.REG_BINARY, s) ! print ShellFolderRoot._reg_desc_, "registration complete." def DllUnregisterServer(): --- 827,831 ---- s = struct.pack("i", attr) _winreg.SetValueEx(key, "Attributes", 0, _winreg.REG_BINARY, s) ! print(ShellFolderRoot._reg_desc_, "registration complete.") def DllUnregisterServer(): *************** *** 835,843 **** "Explorer\\Desktop\\Namespace\\" + \ ShellFolderRoot._reg_clsid_) ! except WindowsError, details: import errno if details.errno != errno.ENOENT: raise ! print ShellFolderRoot._reg_desc_, "unregistration complete." if __name__=='__main__': --- 836,844 ---- "Explorer\\Desktop\\Namespace\\" + \ ShellFolderRoot._reg_clsid_) ! except WindowsError as details: import errno if details.errno != errno.ENOENT: raise ! print(ShellFolderRoot._reg_desc_, "unregistration complete.") if __name__=='__main__': Index: icon_handler.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/icon_handler.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** icon_handler.py 7 Oct 2003 02:33:00 -0000 1.1 --- icon_handler.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 20,24 **** ico_files = glob.glob(os.path.join(sys.prefix, "PC", "*.ico")) if not ico_files: ! print "WARNING: Can't find any icon files" # Our shell extension. --- 20,24 ---- ico_files = glob.glob(os.path.join(sys.prefix, "PC", "*.ico")) if not ico_files: ! print("WARNING: Can't find any icon files") # Our shell extension. *************** *** 51,55 **** subkey = _winreg.CreateKey(key, "IconHandler") _winreg.SetValueEx(subkey, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_) ! print ShellExtension._reg_desc_, "registration complete." def DllUnregisterServer(): --- 51,55 ---- subkey = _winreg.CreateKey(key, "IconHandler") _winreg.SetValueEx(subkey, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_) ! print(ShellExtension._reg_desc_, "registration complete.") def DllUnregisterServer(): *************** *** 58,66 **** key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT, "Python.File\\shellex\\IconHandler") ! except WindowsError, details: import errno if details.errno != errno.ENOENT: raise ! print ShellExtension._reg_desc_, "unregistration complete." if __name__=='__main__': --- 58,66 ---- key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT, "Python.File\\shellex\\IconHandler") ! except WindowsError as details: import errno if details.errno != errno.ENOENT: raise ! print(ShellExtension._reg_desc_, "unregistration complete.") if __name__=='__main__': Index: context_menu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/context_menu.py,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** context_menu.py 7 Feb 2008 05:24:20 -0000 1.4 --- context_menu.py 26 Nov 2008 09:03:30 -0000 1.4.2.1 *************** *** 22,30 **** def Initialize(self, folder, dataobj, hkey): ! print "Init", folder, dataobj, hkey self.dataobj = dataobj def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags): ! print "QCM", hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags # Query the items clicked on format_etc = win32con.CF_HDROP, None, 1, -1, pythoncom.TYMED_HGLOBAL --- 22,30 ---- def Initialize(self, folder, dataobj, hkey): ! print("Init", folder, dataobj, hkey) self.dataobj = dataobj def QueryContextMenu(self, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags): ! print("QCM", hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags) # Query the items clicked on format_etc = win32con.CF_HDROP, None, 1, -1, pythoncom.TYMED_HGLOBAL *************** *** 39,54 **** items = [] if (uFlags & 0x000F) == shellcon.CMF_NORMAL: # Check == here, since CMF_NORMAL=0 ! print "CMF_NORMAL..." items.append(msg) elif uFlags & shellcon.CMF_VERBSONLY: ! print "CMF_VERBSONLY..." items.append(msg + " - shortcut") elif uFlags & shellcon.CMF_EXPLORE: ! print "CMF_EXPLORE..." items.append(msg + " - normal file, right-click in Explorer") elif uFlags & CMF_DEFAULTONLY: ! print "CMF_DEFAULTONLY...\r\n" else: ! print "** unknown flags", uFlags win32gui.InsertMenu(hMenu, indexMenu, win32con.MF_SEPARATOR|win32con.MF_BYPOSITION, --- 39,54 ---- items = [] if (uFlags & 0x000F) == shellcon.CMF_NORMAL: # Check == here, since CMF_NORMAL=0 ! print("CMF_NORMAL...") items.append(msg) elif uFlags & shellcon.CMF_VERBSONLY: ! print("CMF_VERBSONLY...") items.append(msg + " - shortcut") elif uFlags & shellcon.CMF_EXPLORE: ! print("CMF_EXPLORE...") items.append(msg + " - normal file, right-click in Explorer") elif uFlags & CMF_DEFAULTONLY: ! print("CMF_DEFAULTONLY...\r\n") else: ! print("** unknown flags", uFlags) win32gui.InsertMenu(hMenu, indexMenu, win32con.MF_SEPARATOR|win32con.MF_BYPOSITION, *************** *** 82,86 **** subkey2 = _winreg.CreateKey(subkey, "PythonSample") _winreg.SetValueEx(subkey2, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_) ! print ShellExtension._reg_desc_, "registration complete." def DllUnregisterServer(): --- 82,86 ---- subkey2 = _winreg.CreateKey(subkey, "PythonSample") _winreg.SetValueEx(subkey2, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_) ! print(ShellExtension._reg_desc_, "registration complete.") def DllUnregisterServer(): *************** *** 89,97 **** key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT, "Python.File\\shellex\\ContextMenuHandlers\\PythonSample") ! except WindowsError, details: import errno if details.errno != errno.ENOENT: raise ! print ShellExtension._reg_desc_, "unregistration complete." if __name__=='__main__': --- 89,97 ---- key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT, "Python.File\\shellex\\ContextMenuHandlers\\PythonSample") ! except WindowsError as details: import errno if details.errno != errno.ENOENT: raise ! print(ShellExtension._reg_desc_, "unregistration complete.") if __name__=='__main__': |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/win32/scripts In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/win32/scripts Modified Files: Tag: py3k backupEventLog.py killProcName.py rasutil.py regsetup.py setup_d.py Log Message: many more upgrades to py3k syntax Index: regsetup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/regsetup.py,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -C2 -d -r1.15 -r1.15.2.1 *** regsetup.py 30 May 2008 23:14:17 -0000 1.15 --- regsetup.py 26 Nov 2008 09:03:30 -0000 1.15.2.1 *************** *** 13,17 **** os.stat(fname) return 1 ! except os.error, details: return 0 --- 13,17 ---- os.stat(fname) return 1 ! except os.error as details: return 0 *************** *** 54,58 **** ret = os.path.abspath(pathLook) return ret, ret ! raise error, "The package %s can not be located" % packageName def FindHelpPath(helpFile, helpDesc, searchPaths): --- 54,58 ---- ret = os.path.abspath(pathLook) return ret, ret ! raise error("The package %s can not be located" % packageName) def FindHelpPath(helpFile, helpDesc, searchPaths): *************** *** 78,82 **** if FileExists(os.path.join( pathLook, helpFile)): return os.path.abspath(pathLook) ! raise error, "The help file %s can not be located" % helpFile def FindAppPath(appName, knownFileName, searchPaths): --- 78,82 ---- if FileExists(os.path.join( pathLook, helpFile)): return os.path.abspath(pathLook) ! raise error("The help file %s can not be located" % helpFile) def FindAppPath(appName, knownFileName, searchPaths): *************** *** 98,102 **** # Found it return os.path.abspath(pathLook) ! raise error, "The file %s can not be located for application %s" % (knownFileName, appName) def FindPythonExe(exeAlias, possibleRealNames, searchPaths): --- 98,102 ---- # Found it return os.path.abspath(pathLook) ! raise error("The file %s can not be located for application %s" % (knownFileName, appName)) def FindPythonExe(exeAlias, possibleRealNames, searchPaths): *************** *** 161,165 **** import win32ui, win32con except ImportError: ! raise error, "Need to locate the file %s, but the win32ui module is not available\nPlease run the program again, passing as a parameter the path to this file." % fileName # Display a common dialog to locate the file. flags=win32con.OFN_FILEMUSTEXIST --- 161,165 ---- import win32ui, win32con except ImportError: ! raise error("Need to locate the file %s, but the win32ui module is not available\nPlease run the program again, passing as a parameter the path to this file." % fileName) # Display a common dialog to locate the file. flags=win32con.OFN_FILEMUSTEXIST *************** *** 169,173 **** dlg.SetOFNTitle("Locate " + fileName) if dlg.DoModal() <> win32con.IDOK: ! raise KeyboardInterrupt, "User cancelled the process" retPath = dlg.GetPathName() return os.path.abspath(retPath) --- 169,173 ---- dlg.SetOFNTitle("Locate " + fileName) if dlg.DoModal() <> win32con.IDOK: ! raise KeyboardInterrupt("User cancelled the process") retPath = dlg.GetPathName() return os.path.abspath(retPath) *************** *** 215,219 **** libPath = LocatePath("os.py", searchPaths) if libPath is None: ! raise error, "The core Python library could not be located." corePath = None --- 215,219 ---- libPath = LocatePath("os.py", searchPaths) if libPath is None: ! raise error("The core Python library could not be located.") corePath = None *************** *** 226,230 **** corePath = LocatePath("unicodedata%s.pyd" % suffix, searchPaths) if corePath is None: ! raise error, "The core Python path could not be located." installPath = os.path.abspath(os.path.join(libPath, "..")) --- 226,230 ---- corePath = LocatePath("unicodedata%s.pyd" % suffix, searchPaths) if corePath is None: ! raise error("The core Python path could not be located.") installPath = os.path.abspath(os.path.join(libPath, "..")) *************** *** 242,246 **** """ import regutil, string ! if not packageName: raise error, "A package name must be supplied" corePaths = string.split(regutil.GetRegisteredNamedPath(None),";") if not searchPaths: searchPaths = corePaths --- 242,246 ---- """ import regutil, string ! if not packageName: raise error("A package name must be supplied") corePaths = string.split(regutil.GetRegisteredNamedPath(None),";") if not searchPaths: searchPaths = corePaths *************** *** 253,261 **** regutil.RegisterNamedPath(registryAppName, pathAdd) return pathLook ! except error, details: ! print "*** The %s package could not be registered - %s" % (packageName, details) ! print "*** Please ensure you have passed the correct paths on the command line." ! print "*** - For packages, you should pass a path to the packages parent directory," ! print "*** - and not the package directory itself..." --- 253,261 ---- regutil.RegisterNamedPath(registryAppName, pathAdd) return pathLook ! except error as details: ! print("*** The %s package could not be registered - %s" % (packageName, details)) ! print("*** Please ensure you have passed the correct paths on the command line.") ! print("*** - For packages, you should pass a path to the packages parent directory,") ! print("*** - and not the package directory itself...") *************** *** 275,280 **** if pathLook: paths.append(pathLook) ! except error, details: ! print "*** ", details return --- 275,280 ---- if pathLook: paths.append(pathLook) ! except error as details: ! print("*** ", details) return *************** *** 298,303 **** try: pathLook = FindHelpPath(helpFile, helpDesc, searchPaths) ! except error, details: ! print "*** ", details return # print "%s found at %s" % (helpFile, pathLook) --- 298,303 ---- try: pathLook = FindHelpPath(helpFile, helpDesc, searchPaths) ! except error as details: ! print("*** ", details) return # print "%s found at %s" % (helpFile, pathLook) *************** *** 322,326 **** installPath, corePaths = LocatePythonCore(searchPaths) # Register the core Pythonpath. ! print corePaths regutil.RegisterNamedPath(None, string.join(corePaths,";")) --- 322,326 ---- installPath, corePaths = LocatePythonCore(searchPaths) # Register the core Pythonpath. ! print(corePaths) regutil.RegisterNamedPath(None, string.join(corePaths,";")) *************** *** 440,444 **** if __name__=='__main__': if len(sys.argv)>1 and sys.argv[1] in ['/?','-?','-help','-h']: ! print usage elif len(sys.argv)==1 or not sys.argv[1][0] in ['/','-']: # No args, or useful args. --- 440,444 ---- if __name__=='__main__': if len(sys.argv)>1 and sys.argv[1] in ['/?','-?','-help','-h']: ! print(usage) elif len(sys.argv)==1 or not sys.argv[1][0] in ['/','-']: # No args, or useful args. *************** *** 460,464 **** searchPath.append("..\\..\\pcbuild") ! print "Attempting to setup/repair the Python core" SetupCore(searchPath) --- 460,464 ---- searchPath.append("..\\..\\pcbuild") ! print("Attempting to setup/repair the Python core") SetupCore(searchPath) *************** *** 466,470 **** FindRegisterHelpFile("PyWin32.chm", searchPath, "Pythonwin Reference") # Check the registry. ! print "Registration complete - checking the registry..." import regcheck regcheck.CheckRegistry() --- 466,470 ---- FindRegisterHelpFile("PyWin32.chm", searchPath, "Pythonwin Reference") # Check the registry. ! print("Registration complete - checking the registry...") import regcheck regcheck.CheckRegistry() *************** *** 478,502 **** for o,a in opts: if o=='--description': ! print description if o=='--examples': ! print examples if o=='--shell': ! print "Registering the Python core." RegisterShellInfo(searchPaths) if o=='-p': ! print "Registering package", a FindRegisterPackage(a,None,searchPaths) if o in ['--upackage', '--uapp']: import regutil ! print "Unregistering application/package", a regutil.UnregisterNamedPath(a) if o=='-a': import regutil path = string.join(searchPaths,";") ! print "Registering application", a,"to path",path regutil.RegisterNamedPath(a,path) if o=='-c': if not len(searchPaths): ! raise error, "-c option must provide at least one additional path" import win32api, regutil currentPaths = string.split(regutil.GetRegisteredNamedPath(None),";") --- 478,502 ---- for o,a in opts: if o=='--description': ! print(description) if o=='--examples': ! print(examples) if o=='--shell': ! print("Registering the Python core.") RegisterShellInfo(searchPaths) if o=='-p': ! print("Registering package", a) FindRegisterPackage(a,None,searchPaths) if o in ['--upackage', '--uapp']: import regutil ! print("Unregistering application/package", a) regutil.UnregisterNamedPath(a) if o=='-a': import regutil path = string.join(searchPaths,";") ! print("Registering application", a,"to path",path) regutil.RegisterNamedPath(a,path) if o=='-c': if not len(searchPaths): ! raise error("-c option must provide at least one additional path") import win32api, regutil currentPaths = string.split(regutil.GetRegisteredNamedPath(None),";") *************** *** 506,511 **** currentPaths.append(newPath) if len(currentPaths)<>oldLen: ! print "Registering %d new core paths" % (len(currentPaths)-oldLen) regutil.RegisterNamedPath(None,string.join(currentPaths,";")) else: ! print "All specified paths are already registered." --- 506,511 ---- currentPaths.append(newPath) if len(currentPaths)<>oldLen: ! print("Registering %d new core paths" % (len(currentPaths)-oldLen)) regutil.RegisterNamedPath(None,string.join(currentPaths,";")) else: ! print("All specified paths are already registered.") Index: setup_d.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/setup_d.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** setup_d.py 4 Jun 2001 05:58:38 -0000 1.1 --- setup_d.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 11,43 **** def usage_and_die(rc): ! print ! print "This script is designed to copy and register the Python debug" ! print "binaries. It looks for pythonxx_d.dll, pythoncomxx_d.dll etc," ! print "and installs them to work correctly with Python debug builds." ! print ! print "You will generally find this script in the. zip file that" ! print "included these _d files. Please run this script from" ! print "that directory" sys.exit(rc) if win32api.__file__.find("_d") > 0: ! print "This scripts appears to be running a DEBUG version of Python." ! print "Please run it using a normal release build (python.exe)" usage_and_die(1) try: import pythoncom ! except ImportError, details: ! print "Could not import the release version of pythoncom" ! print "The error details are: %s" % (details,) ! print "Please correct this error and rerun the script" usage_and_die(2) try: import pywintypes ! except ImportError, details: ! print "Could not import the release version of pywintypes" ! print "The error details are: %s" % (details,) ! print "Please correct this error and rerun the script" usage_and_die(2) --- 11,43 ---- def usage_and_die(rc): ! print() ! print("This script is designed to copy and register the Python debug") ! print("binaries. It looks for pythonxx_d.dll, pythoncomxx_d.dll etc,") ! print("and installs them to work correctly with Python debug builds.") ! print() ! print("You will generally find this script in the. zip file that") ! print("included these _d files. Please run this script from") ! print("that directory") sys.exit(rc) if win32api.__file__.find("_d") > 0: ! print("This scripts appears to be running a DEBUG version of Python.") ! print("Please run it using a normal release build (python.exe)") usage_and_die(1) try: import pythoncom ! except ImportError as details: ! print("Could not import the release version of pythoncom") ! print("The error details are: %s" % (details,)) ! print("Please correct this error and rerun the script") usage_and_die(2) try: import pywintypes ! except ImportError as details: ! print("Could not import the release version of pywintypes") ! print("The error details are: %s" % (details,)) ! print("Please correct this error and rerun the script") usage_and_die(2) *************** *** 46,58 **** if not os.path.isfile(src): src = os.path.join( os.path.split(sys.argv[0])[0], src) ! print "Can not find %s or %s to copy" % (os.path.abspath(orig_src), os.path.abspath(src)) return 0 try: shutil.copy(src, dest) ! print "Copied %s -> %s" % (src, dest) return 1 except: ! print "Error copying '%s' -> '%s'" % (src, dest) ! print str(sys.exc_info[1]) usage_and_die(3) --- 46,58 ---- if not os.path.isfile(src): src = os.path.join( os.path.split(sys.argv[0])[0], src) ! print("Can not find %s or %s to copy" % (os.path.abspath(orig_src), os.path.abspath(src))) return 0 try: shutil.copy(src, dest) ! print("Copied %s -> %s" % (src, dest)) return 1 except: ! print("Error copying '%s' -> '%s'" % (src, dest)) ! print(str(sys.exc_info[1])) usage_and_die(3) *************** *** 65,74 **** key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "Software\\Python\\PythonCore\\%s\\Modules\\%s" % (sys.winver, mod_name)) except _winreg.error: ! print "Could not find the existing '%s' module registered in the registry" % (mod_name,) usage_and_die(4) # Create the debug key. sub_key = _winreg.CreateKey(key, "Debug") _winreg.SetValue(sub_key, None, _winreg.REG_SZ, dll_name) ! print "Registered '%s' in the registry" % (dll_name,) def _domodule(mod_name, release_mod_filename): --- 65,74 ---- key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, "Software\\Python\\PythonCore\\%s\\Modules\\%s" % (sys.winver, mod_name)) except _winreg.error: ! print("Could not find the existing '%s' module registered in the registry" % (mod_name,)) usage_and_die(4) # Create the debug key. sub_key = _winreg.CreateKey(key, "Debug") _winreg.SetValue(sub_key, None, _winreg.REG_SZ, dll_name) ! print("Registered '%s' in the registry" % (dll_name,)) def _domodule(mod_name, release_mod_filename): *************** *** 89,91 **** _domodule("pywintypes", pywintypes.__file__) ! print "System _d files were setup." \ No newline at end of file --- 89,91 ---- _domodule("pywintypes", pywintypes.__file__) ! print("System _d files were setup.") Index: rasutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/rasutil.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** rasutil.py 16 Oct 2000 05:33:04 -0000 1.2 --- rasutil.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 20,33 **** for info in win32ras.EnumConnections(): if string.lower(info[1])==string.lower(rasEntryName): ! print "Already connected to", rasEntryName return 0, info[0] dial_params, have_pw = win32ras.GetEntryDialParams(None, rasEntryName) if not have_pw: ! print "Error: The password is not saved for this connection" ! print "Please connect manually selecting the 'save password' option and try again" sys.exit(1) ! print "Connecting to", rasEntryName, "..." retryCount = numRetries while retryCount > 0: --- 20,33 ---- for info in win32ras.EnumConnections(): if string.lower(info[1])==string.lower(rasEntryName): ! print("Already connected to", rasEntryName) return 0, info[0] dial_params, have_pw = win32ras.GetEntryDialParams(None, rasEntryName) if not have_pw: ! print("Error: The password is not saved for this connection") ! print("Please connect manually selecting the 'save password' option and try again") sys.exit(1) ! print("Connecting to", rasEntryName, "...") retryCount = numRetries while retryCount > 0: *************** *** 36,40 **** bValid = 1 break ! print "Retrying..." win32api.Sleep(5000) retryCount = retryCount - 1 --- 36,40 ---- bValid = 1 break ! print("Retrying...") win32api.Sleep(5000) retryCount = retryCount - 1 *************** *** 66,71 **** def Usage(why): ! print why ! print usage sys.exit(1) --- 66,71 ---- def Usage(why): ! print(why) ! print(usage) sys.exit(1) *************** *** 74,78 **** try: opts, args = getopt.getopt(sys.argv[1:], "r:c:d:") ! except getopt.error, why: Usage(why) retries = 5 --- 74,78 ---- try: opts, args = getopt.getopt(sys.argv[1:], "r:c:d:") ! except getopt.error as why: Usage(why) retries = 5 Index: backupEventLog.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/backupEventLog.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** backupEventLog.py 2 Sep 1999 00:19:32 -0000 1.1 --- backupEventLog.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 23,35 **** try: hlog = win32evtlog.OpenEventLog(None, logType) ! except win32evtlogutil.error, details: ! print "Could not open the event log", details return try: if win32evtlog.GetNumberOfEventLogRecords(hlog)==0: ! print "No records in event log %s - not backed up" % logType return win32evtlog.ClearEventLog(hlog, fname) ! print "Backed up %s log to %s" % (logType, fname) finally: win32evtlog.CloseEventLog(hlog) --- 23,35 ---- try: hlog = win32evtlog.OpenEventLog(None, logType) ! except win32evtlogutil.error as details: ! print("Could not open the event log", details) return try: if win32evtlog.GetNumberOfEventLogRecords(hlog)==0: ! print("No records in event log %s - not backed up" % logType) return win32evtlog.ClearEventLog(hlog, fname) ! print("Backed up %s log to %s" % (logType, fname)) finally: win32evtlog.CloseEventLog(hlog) Index: killProcName.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/killProcName.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** killProcName.py 21 Nov 1999 02:47:03 -0000 1.2 --- killProcName.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 48,56 **** result = killProcName(procname) if result: ! print result ! print "Dumping all processes..." win32pdhutil.ShowAllProcesses() else: ! print "Killed %s" % procname else: ! print "Usage: killProcName.py procname ..." --- 48,56 ---- result = killProcName(procname) if result: ! print(result) ! print("Dumping all processes...") win32pdhutil.ShowAllProcesses() else: ! print("Killed %s" % procname) else: ! print("Usage: killProcName.py procname ...") |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/win32/test Modified Files: Tag: py3k handles.py test_exceptions.py test_win32inet.py test_win32trace.py testall.py Log Message: many more upgrades to py3k syntax Index: test_win32inet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32inet.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** test_win32inet.py 12 Jun 2004 13:40:34 -0000 1.1 --- test_win32inet.py 26 Nov 2008 09:03:31 -0000 1.1.4.1 *************** *** 47,51 **** hftp = FtpCommand(hcon, True, FTP_TRANSFER_TYPE_ASCII, 'NLST', 0) except error: ! print "Error info is", InternetGetLastResponseInfo() InternetReadFile(hftp, 2048) hftp.Close() --- 47,51 ---- hftp = FtpCommand(hcon, True, FTP_TRANSFER_TYPE_ASCII, 'NLST', 0) except error: ! print("Error info is", InternetGetLastResponseInfo()) InternetReadFile(hftp, 2048) hftp.Close() Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/testall.py,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** testall.py 26 Nov 2008 07:17:39 -0000 1.6.2.1 --- testall.py 26 Nov 2008 09:03:31 -0000 1.6.2.2 *************** *** 34,38 **** if rc: base = os.path.basename(self.argv[1]) ! raise AssertionError, "%s failed with exit code %s. Output is:\n%s" % (base, rc, output) def get_demo_tests(): --- 34,38 ---- if rc: base = os.path.basename(self.argv[1]) ! raise AssertionError("%s failed with exit code %s. Output is:\n%s" % (base, rc, output)) def get_demo_tests(): *************** *** 46,50 **** continue if base in ok_exceptions: ! print "Ack - can't handle test %s - can't catch specific exceptions" % (base,) continue argv = (sys.executable, os.path.join(demo_dir, base+".py")) + \ --- 46,50 ---- continue if base in ok_exceptions: ! print("Ack - can't handle test %s - can't catch specific exceptions" % (base,)) continue argv = (sys.executable, os.path.join(demo_dir, base+".py")) + \ *************** *** 73,77 **** __import__(base) except ImportError: ! print "FAILED to import", name raise num += 1 --- 73,77 ---- __import__(base) except ImportError: ! print("FAILED to import", name) raise num += 1 *************** *** 92,98 **** try: mod = __import__(base) ! except ImportError, why: ! print "FAILED to import test module" ! print why continue if hasattr(mod, "suite"): --- 92,98 ---- try: mod = __import__(base) ! except ImportError as why: ! print("FAILED to import test module") ! print(why) continue if hasattr(mod, "suite"): Index: test_win32trace.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32trace.py,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** test_win32trace.py 6 Mar 2005 23:55:59 -0000 1.5 --- test_win32trace.py 26 Nov 2008 09:03:31 -0000 1.5.4.1 *************** *** 18,23 **** win32trace.TermRead() win32trace.TermWrite() ! raise RuntimeError, "An existing win32trace reader appears to be " \ ! "running - please stop this process and try again" class TestInitOps(unittest.TestCase): --- 18,23 ---- win32trace.TermRead() win32trace.TermWrite() ! raise RuntimeError("An existing win32trace reader appears to be " \ ! "running - please stop this process and try again") class TestInitOps(unittest.TestCase): Index: handles.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.py,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** handles.py 30 Oct 2007 09:53:32 -0000 1.4 --- handles.py 26 Nov 2008 09:03:30 -0000 1.4.2.1 *************** *** 27,31 **** try: f1(invalidate) ! except ZeroDivisionError, exc: raise IOError("raise 2") --- 27,31 ---- try: f1(invalidate) ! except ZeroDivisionError as exc: raise IOError("raise 2") Index: test_exceptions.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_exceptions.py,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** test_exceptions.py 7 Oct 2008 11:35:36 -0000 1.2.2.4 --- test_exceptions.py 26 Nov 2008 09:03:30 -0000 1.2.2.5 *************** *** 18,22 **** try: win32api.CloseHandle(1) ! except win32api.error, exc: return exc self.fail("Didn't get invalid-handle exception.") --- 18,22 ---- try: win32api.CloseHandle(1) ! except win32api.error as exc: return exc self.fail("Didn't get invalid-handle exception.") *************** *** 42,46 **** win32api.CloseHandle(1) self.fail("expected exception!") ! except win32api.error, (werror, func, msg): self.failUnlessEqual(werror, winerror.ERROR_INVALID_HANDLE) self.failUnlessEqual(func, "CloseHandle") --- 42,47 ---- win32api.CloseHandle(1) self.fail("expected exception!") ! except win32api.error as xxx_todo_changeme: ! (werror, func, msg) = xxx_todo_changeme.args self.failUnlessEqual(werror, winerror.ERROR_INVALID_HANDLE) self.failUnlessEqual(func, "CloseHandle") *************** *** 89,93 **** raise pywintypes.error() self.fail("Expected exception") ! except pywintypes.error, exc: self.failUnlessEqual(exc.args, ()) self.failUnlessEqual(exc.winerror, None) --- 90,94 ---- raise pywintypes.error() self.fail("Expected exception") ! except pywintypes.error as exc: self.failUnlessEqual(exc.args, ()) self.failUnlessEqual(exc.winerror, None) *************** *** 99,103 **** raise pywintypes.error("foo") self.fail("Expected exception") ! except pywintypes.error, exc: assert exc.args[0] == "foo" # 'winerror' always args[0] --- 100,104 ---- raise pywintypes.error("foo") self.fail("Expected exception") ! except pywintypes.error as exc: assert exc.args[0] == "foo" # 'winerror' always args[0] *************** *** 110,114 **** raise pywintypes.error("foo", "bar", "you", "never", "kn", 0) self.fail("Expected exception") ! except pywintypes.error, exc: self.failUnlessEqual(exc.args[0], "foo") self.failUnlessEqual(exc.args[-1], 0) --- 111,115 ---- raise pywintypes.error("foo", "bar", "you", "never", "kn", 0) self.fail("Expected exception") ! except pywintypes.error as exc: self.failUnlessEqual(exc.args[0], "foo") self.failUnlessEqual(exc.args[-1], 0) *************** *** 121,125 **** try: pythoncom.StgOpenStorage("foo", None, 0) ! except pythoncom.com_error, exc: return exc self.fail("Didn't get storage exception.") --- 122,126 ---- try: pythoncom.StgOpenStorage("foo", None, 0) ! except pythoncom.com_error as exc: return exc self.fail("Didn't get storage exception.") *************** *** 181,185 **** raise pywintypes.com_error() self.fail("Expected exception") ! except pywintypes.com_error, exc: self.failUnlessEqual(exc.args, ()) self.failUnlessEqual(exc.hresult, None) --- 182,186 ---- raise pywintypes.com_error() self.fail("Expected exception") ! except pywintypes.com_error as exc: self.failUnlessEqual(exc.args, ()) self.failUnlessEqual(exc.hresult, None) *************** *** 192,196 **** raise pywintypes.com_error("foo") self.fail("Expected exception") ! except pywintypes.com_error, exc: self.failUnlessEqual(exc.args[0], "foo") self.failUnlessEqual(exc.hresult, "foo") --- 193,197 ---- raise pywintypes.com_error("foo") self.fail("Expected exception") ! except pywintypes.com_error as exc: self.failUnlessEqual(exc.args[0], "foo") self.failUnlessEqual(exc.hresult, "foo") *************** *** 203,207 **** raise pywintypes.com_error("foo", "bar", "you", "never", "kn", 0) self.fail("Expected exception") ! except pywintypes.com_error, exc: self.failUnlessEqual(exc.args[0], "foo") self.failUnlessEqual(exc.args[-1], 0) --- 204,208 ---- raise pywintypes.com_error("foo", "bar", "you", "never", "kn", 0) self.fail("Expected exception") ! except pywintypes.com_error as exc: self.failUnlessEqual(exc.args[0], "foo") self.failUnlessEqual(exc.args[-1], 0) |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/authorization/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/authorization/demos Modified Files: Tag: py3k EditSecurity.py EditServiceSecurity.py Log Message: many more upgrades to py3k syntax Index: EditServiceSecurity.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/authorization/demos/EditServiceSecurity.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** EditServiceSecurity.py 26 Jul 2006 03:12:53 -0000 1.1 --- EditServiceSecurity.py 26 Nov 2008 09:03:29 -0000 1.1.4.1 *************** *** 75,79 **** if (objecttype is not None) and (objecttype!=IID_NULL): ## Not relevent for services ! raise NotImplementedError, "Object type is not supported" ## ???? for some reason, the DACL for a service will not retain ACCESS_SYSTEM_SECURITY in an ACE ???? --- 75,79 ---- if (objecttype is not None) and (objecttype!=IID_NULL): ## Not relevent for services ! raise NotImplementedError("Object type is not supported") ## ???? for some reason, the DACL for a service will not retain ACCESS_SYSTEM_SECURITY in an ACE ???? Index: EditSecurity.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/authorization/demos/EditSecurity.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** EditSecurity.py 16 Mar 2006 22:53:08 -0000 1.1 --- EditSecurity.py 26 Nov 2008 09:03:29 -0000 1.1.4.1 *************** *** 77,81 **** ## Should not be true for file objects. Usually only used with DS objects that support security for ## their properties ! raise NotImplementedError, "Object type is not supported" if os.path.isdir(self.FileName): --- 77,81 ---- ## Should not be true for file objects. Usually only used with DS objects that support security for ## their properties ! raise NotImplementedError("Object type is not supported") if os.path.isdir(self.FileName): *************** *** 129,133 **** temp_dir=win32api.GetTempPath() dir_name=win32api.GetTempFileName(temp_dir,'isi')[0] ! print dir_name os.remove(dir_name) os.mkdir(dir_name) --- 129,133 ---- temp_dir=win32api.GetTempPath() dir_name=win32api.GetTempFileName(temp_dir,'isi')[0] ! print(dir_name) os.remove(dir_name) os.mkdir(dir_name) |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/adsi Modified Files: Tag: py3k __init__.py Log Message: many more upgrades to py3k syntax Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/__init__.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** __init__.py 27 May 2005 07:08:30 -0000 1.2 --- __init__.py 26 Nov 2008 09:03:29 -0000 1.2.4.1 *************** *** 53,60 **** return self.__GetIndex(index) def __GetIndex(self, index): ! if type(index)!=type(0): raise TypeError, "Only integer indexes are supported for enumerators" if index != self.index + 1: # Index requested out of sequence. ! raise ValueError, "You must index this object sequentially" self.index = index result = ADsEnumerateNext(self._oleobj_, 1) --- 53,60 ---- return self.__GetIndex(index) def __GetIndex(self, index): ! if type(index)!=type(0): raise TypeError("Only integer indexes are supported for enumerators") if index != self.index + 1: # Index requested out of sequence. ! raise ValueError("You must index this object sequentially") self.index = index result = ADsEnumerateNext(self._oleobj_, 1) *************** *** 64,68 **** self.index = -1 self._oleobj_ = ADsBuildEnumerator(self._cont_) # a PyIADsEnumVARIANT ! raise IndexError, "list index out of range" class ADSIDispatch(win32com.client.CDispatch): --- 64,68 ---- self.index = -1 self._oleobj_ = ADsBuildEnumerator(self._cont_) # a PyIADsEnumVARIANT ! raise IndexError("list index out of range") class ADSIDispatch(win32com.client.CDispatch): |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/win32/scripts/ce In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/win32/scripts/ce Modified Files: Tag: py3k pysynch.py Log Message: many more upgrades to py3k syntax Index: pysynch.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/ce/pysynch.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** pysynch.py 8 Mar 2000 09:57:54 -0000 1.2 --- pysynch.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 15,19 **** def print_error(api_exc, msg): hr, fn, errmsg = api_exc ! print "%s - %s(%d)" % (msg, errmsg, hr) def GetFileAttributes(file, local=1): --- 15,19 ---- def print_error(api_exc, msg): hr, fn, errmsg = api_exc ! print("%s - %s(%d)" % (msg, errmsg, hr)) def GetFileAttributes(file, local=1): *************** *** 99,103 **** try: opts, args = getopt.getopt(args, "rv") ! except getopt.error, details: raise InvalidUsage(details) for o, v in opts: --- 99,103 ---- try: opts, args = getopt.getopt(args, "rv") ! except getopt.error as details: raise InvalidUsage(details) for o, v in opts: *************** *** 122,126 **** if not isdir(dest, not bToDevice): ! print "%s does not indicate a directory" files = [] # List of FQ (from_name, to_name) --- 122,126 ---- if not isdir(dest, not bToDevice): ! print("%s does not indicate a directory") files = [] # List of FQ (from_name, to_name) *************** *** 133,137 **** new = BuildFileList(spec, 1, bRecurse, _copyfilter, bMaintainDir) if not new: ! print "Warning: '%s' did not match any files" % (spec) files = files + new --- 133,137 ---- new = BuildFileList(spec, 1, bRecurse, _copyfilter, bMaintainDir) if not new: ! print("Warning: '%s' did not match any files" % (spec)) files = files + new *************** *** 139,145 **** dest_name = os.path.join(dest, dest_info) size = src_info[5] ! print "Size=", size if bVerbose: ! print full_src, "->", dest_name,"- ", dialog.SetText(dest_name) dialog.Set(0, size/1024) --- 139,145 ---- dest_name = os.path.join(dest, dest_info) size = src_info[5] ! print("Size=", size) if bVerbose: ! print(full_src, "->", dest_name,"- ", end=' ') dialog.SetText(dest_name) dialog.Set(0, size/1024) *************** *** 147,154 **** num_bytes = num_bytes + bytes if bVerbose: ! print bytes, "bytes" num_files = num_files + 1 dialog.Close() ! print "%d files copied (%d bytes)" % (num_files, num_bytes) def _dirfilter(*args): --- 147,154 ---- num_bytes = num_bytes + bytes if bVerbose: ! print(bytes, "bytes") num_files = num_files + 1 dialog.Close() ! print("%d files copied (%d bytes)" % (num_files, num_bytes)) def _dirfilter(*args): *************** *** 162,166 **** try: opts, args = getopt.getopt(args, "r") ! except getopt.error, details: raise InvalidUsage(details) for o, v in opts: --- 162,166 ---- try: opts, args = getopt.getopt(args, "r") ! except getopt.error as details: raise InvalidUsage(details) for o, v in opts: *************** *** 168,172 **** bRecurse=1 for arg in args: ! print "Directory of WCE:%s" % arg files = BuildFileList(arg, 0, bRecurse, _dirfilter, None) total_size=0 --- 168,172 ---- bRecurse=1 for arg in args: ! print("Directory of WCE:%s" % arg) files = BuildFileList(arg, 0, bRecurse, _dirfilter, None) total_size=0 *************** *** 175,181 **** attr_string = " " if info[0] & win32con.FILE_ATTRIBUTE_DIRECTORY: attr_string = "<DIR>" ! print "%s %s %10d %s" % (date_str, attr_string, info[5], rel_name) total_size = total_size + info[5] ! print " " * 14 + "%3d files, %10d bytes" % (len(files), total_size) def run(args): --- 175,181 ---- attr_string = " " if info[0] & win32con.FILE_ATTRIBUTE_DIRECTORY: attr_string = "<DIR>" ! print("%s %s %10d %s" % (date_str, attr_string, info[5], rel_name)) total_size = total_size + info[5] ! print(" " * 14 + "%3d files, %10d bytes" % (len(files), total_size)) def run(args): *************** *** 199,209 **** try: wincerapi.CeDeleteFile(arg) ! print "Deleted: %s" % arg ! except win32api.error, details: print_error(details, "Error deleting '%s'" % arg) def DumpCommands(): ! print "%-10s - %s" % ("Command", "Description") ! print "%-10s - %s" % ("-------", "-----------") for name, item in globals().items(): if type(item)==type(DumpCommands): --- 199,209 ---- try: wincerapi.CeDeleteFile(arg) ! print("Deleted: %s" % arg) ! except win32api.error as details: print_error(details, "Error deleting '%s'" % arg) def DumpCommands(): ! print("%-10s - %s" % ("Command", "Description")) ! print("%-10s - %s" % ("-------", "-----------")) for name, item in globals().items(): if type(item)==type(DumpCommands): *************** *** 211,222 **** if doc: lines = string.split(doc, "\n") ! print "%-10s - %s" % (name, lines[0]) for line in lines[1:]: if line: ! print " " * 8, line def main(): if len(sys.argv)<2: ! print "You must specify a command!" DumpCommands() return --- 211,222 ---- if doc: lines = string.split(doc, "\n") ! print("%-10s - %s" % (name, lines[0])) for line in lines[1:]: if line: ! print(" " * 8, line) def main(): if len(sys.argv)<2: ! print("You must specify a command!") DumpCommands() return *************** *** 224,228 **** fn = globals().get(command) if fn is None: ! print "Unknown command:", command DumpCommands() return --- 224,228 ---- fn = globals().get(command) if fn is None: ! print("Unknown command:", command) DumpCommands() return *************** *** 231,245 **** try: verinfo = wincerapi.CeGetVersionEx() ! print "Connected to device, CE version %d.%d %s" % (verinfo[0], verinfo[1], verinfo[4]) try: fn(sys.argv[2:]) ! except InvalidUsage, msg: ! print "Invalid syntax -", msg ! print fn.__doc__ finally: try: wincerapi.CeRapiUninit() ! except win32api.error, details: print_error(details, "Error disconnecting") --- 231,245 ---- try: verinfo = wincerapi.CeGetVersionEx() ! print("Connected to device, CE version %d.%d %s" % (verinfo[0], verinfo[1], verinfo[4])) try: fn(sys.argv[2:]) ! except InvalidUsage as msg: ! print("Invalid syntax -", msg) ! print(fn.__doc__) finally: try: wincerapi.CeRapiUninit() ! except win32api.error as details: print_error(details, "Error disconnecting") |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/shell/test Modified Files: Tag: py3k testSHFileOperation.py testShellFolder.py Log Message: many more upgrades to py3k syntax Index: testSHFileOperation.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/test/testSHFileOperation.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** testSHFileOperation.py 6 Apr 2006 10:54:36 -0000 1.2 --- testSHFileOperation.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 31,35 **** for old_fname, new_fname in NameMappings: ! print 'Old:',old_fname, 'New:', new_fname assert len(NameMappings)==file_cnt testSHFileOperation(10) --- 31,35 ---- for old_fname, new_fname in NameMappings: ! print('Old:',old_fname, 'New:', new_fname) assert len(NameMappings)==file_cnt testSHFileOperation(10) Index: testShellFolder.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/test/testShellFolder.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** testShellFolder.py 31 Oct 2003 06:58:48 -0000 1.2 --- testShellFolder.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 3,7 **** sf = shell.SHGetDesktopFolder() ! print "Shell Folder is", sf names = [] --- 3,7 ---- sf = shell.SHGetDesktopFolder() ! print("Shell Folder is", sf) names = [] *************** *** 16,21 **** num += 1 if num != len(names): ! print "Should have got the same number of names!?" ! print "Found", len(names), "items on the desktop" for name in names: ! print name --- 16,21 ---- num += 1 if num != len(names): ! print("Should have got the same number of names!?") ! print("Found", len(names), "items on the desktop") for name in names: ! print(name) |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/wince/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/wince/Lib Modified Files: Tag: py3k ceshell.py Log Message: many more upgrades to py3k syntax Index: ceshell.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/wince/Lib/ceshell.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** ceshell.py 8 Jul 2001 05:10:09 -0000 1.3 --- ceshell.py 26 Nov 2008 09:03:31 -0000 1.3.4.1 *************** *** 106,110 **** def __del__(self): ! print "InteractiveManager dieing" def write(self, text): --- 106,110 ---- def __del__(self): ! print("InteractiveManager dieing") def write(self, text): *************** *** 409,414 **** try: file = open(fname, mode) ! except IOError, (code, why): ! print "python: can't open %s: %s\n" % (fname, why) bKeepOpen = 1 file = None --- 409,415 ---- try: file = open(fname, mode) ! except IOError as xxx_todo_changeme: ! (code, why) = xxx_todo_changeme.args ! print("python: can't open %s: %s\n" % (fname, why)) bKeepOpen = 1 file = None |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:34
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/propsys/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/propsys/test Modified Files: Tag: py3k testpropsys.py Log Message: many more upgrades to py3k syntax Index: testpropsys.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/propsys/test/testpropsys.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** testpropsys.py 22 Jan 2008 12:22:14 -0000 1.1 --- testpropsys.py 26 Nov 2008 09:03:30 -0000 1.1.2.1 *************** *** 1,4 **** from win32com.propsys import propsys, pscon ! print "propsys was imported (sorry - that is the extent of the tests," ! print "but see the shell folder_view demo, which uses this module)" # that's all folks! \ No newline at end of file --- 1,4 ---- from win32com.propsys import propsys, pscon ! print("propsys was imported (sorry - that is the extent of the tests,") ! print("but see the shell folder_view demo, which uses this module)") # that's all folks! \ No newline at end of file |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/ifilter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/ifilter Modified Files: Tag: py3k ifiltercon.py Log Message: many more upgrades to py3k syntax Index: ifiltercon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/ifilter/ifiltercon.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** ifiltercon.py 20 May 2005 23:22:59 -0000 1.2 --- ifiltercon.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 27,31 **** CHUNK_EOC = 4 ! NOT_AN_ERROR = 0x00080000L FILTER_E_END_OF_CHUNKS = -2147215616 FILTER_E_NO_MORE_TEXT = -2147215615 --- 27,31 ---- CHUNK_EOC = 4 ! NOT_AN_ERROR = 0x00080000 FILTER_E_END_OF_CHUNKS = -2147215616 FILTER_E_NO_MORE_TEXT = -2147215615 |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com/server In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32com/server Modified Files: Tag: py3k connect.py dispatcher.py policy.py register.py util.py Log Message: many more upgrades to py3k syntax Index: policy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/policy.py,v retrieving revision 1.23.2.1 retrieving revision 1.23.2.2 diff -C2 -d -r1.23.2.1 -r1.23.2.2 *** policy.py 26 Nov 2008 07:17:39 -0000 1.23.2.1 --- policy.py 26 Nov 2008 09:03:29 -0000 1.23.2.2 *************** *** 191,205 **** regSpec % clsid) except win32api.error: ! raise error, "The object is not correctly registered - %s key can not be read" % (regSpec % clsid) myob = call_func(classSpec) self._wrap_(myob) try: return pythoncom.WrapObject(self, reqIID) ! except pythoncom.com_error, (hr, desc, exc, arg): from win32com.util import IIDToInterfaceName desc = "The object '%r' was created, but does not support the " \ "interface '%s'(%s): %s" \ % (myob, IIDToInterfaceName(reqIID), reqIID, desc) ! raise pythoncom.com_error, (hr, desc, exc, arg) --- 191,206 ---- regSpec % clsid) except win32api.error: ! raise error("The object is not correctly registered - %s key can not be read" % (regSpec % clsid)) myob = call_func(classSpec) self._wrap_(myob) try: return pythoncom.WrapObject(self, reqIID) ! except pythoncom.com_error as xxx_todo_changeme: ! (hr, desc, exc, arg) = xxx_todo_changeme.args from win32com.util import IIDToInterfaceName desc = "The object '%r' was created, but does not support the " \ "interface '%s'(%s): %s" \ % (myob, IIDToInterfaceName(reqIID), reqIID, desc) ! raise pythoncom.com_error(hr, desc, exc, arg) *************** *** 330,334 **** """ # Base classes should override this method (and not call the base) ! raise error, "This class does not provide _invokeex_ semantics" def _DeleteMemberByName_(self, name, fdex): --- 331,335 ---- """ # Base classes should override this method (and not call the base) ! raise error("This class does not provide _invokeex_ semantics") def _DeleteMemberByName_(self, name, fdex): *************** *** 469,473 **** MappedWrapPolicy._wrap_(self, ob) if not hasattr(ob, '_public_methods_') and not hasattr(ob, "_typelib_guid_"): ! raise error, "Object does not support DesignatedWrapPolicy, as it does not have either _public_methods_ or _typelib_guid_ attributes." # Copy existing _dispid_to_func_ entries to _name_to_dispid_ --- 470,474 ---- MappedWrapPolicy._wrap_(self, ob) if not hasattr(ob, '_public_methods_') and not hasattr(ob, "_typelib_guid_"): ! raise error("Object does not support DesignatedWrapPolicy, as it does not have either _public_methods_ or _typelib_guid_ attributes.") # Copy existing _dispid_to_func_ entries to _name_to_dispid_ *************** *** 489,493 **** self._dispid_to_get_[dispid] = name else: ! raise ValueError, "unexpected invkind: %d (%s)" % (invkind,name) # look for reserved methods --- 490,494 ---- self._dispid_to_get_[dispid] = name else: ! raise ValueError("unexpected invkind: %d (%s)" % (invkind,name)) # look for reserved methods *************** *** 584,592 **** try: return func(*args) ! except TypeError, v: # Particularly nasty is "wrong number of args" type error # This helps you see what 'func' and 'args' actually is if str(v).find("arguments")>=0: ! print "** TypeError %s calling function %r(%r)" % (v, func, args) raise --- 585,593 ---- try: return func(*args) ! except TypeError as v: # Particularly nasty is "wrong number of args" type error # This helps you see what 'func' and 'args' actually is if str(v).find("arguments")>=0: ! print("** TypeError %s calling function %r(%r)" % (v, func, args)) raise *************** *** 669,673 **** BasicWrapPolicy._wrap_(self, object) if not hasattr(self._obj_, '_dynamic_'): ! raise error, "Object does not support Dynamic COM Policy" self._next_dynamic_ = self._min_dynamic_ = 1000 self._dyn_dispid_to_name_ = {DISPID_VALUE:'_value_', DISPID_NEWENUM:'_NewEnum' } --- 670,674 ---- BasicWrapPolicy._wrap_(self, object) if not hasattr(self._obj_, '_dynamic_'): ! raise error("Object does not support Dynamic COM Policy") self._next_dynamic_ = self._min_dynamic_ = 1000 self._dyn_dispid_to_name_ = {DISPID_VALUE:'_value_', DISPID_NEWENUM:'_NewEnum' } Index: connect.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/connect.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** connect.py 11 Nov 2000 04:00:45 -0000 1.2 --- connect.py 26 Nov 2008 09:03:29 -0000 1.2.4.1 *************** *** 57,65 **** try: apply(broadcaster, (interface,)+extraArgs) ! except pythoncom.com_error, details: self._OnNotifyFail(interface, details) def _OnNotifyFail(self, interface, details): ! print "Ignoring COM error to connection - %s" % (`details`) --- 57,65 ---- try: apply(broadcaster, (interface,)+extraArgs) ! except pythoncom.com_error as details: self._OnNotifyFail(interface, details) def _OnNotifyFail(self, interface, details): ! print("Ignoring COM error to connection - %s" % (`details`)) Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/util.py,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** util.py 7 Aug 2007 06:38:11 -0000 1.6 --- util.py 26 Nov 2008 09:03:29 -0000 1.6.2.1 *************** *** 146,150 **** try: return self.data[args[0]] ! except IndexError, desc: raise COMException(scode=winerror.DISP_E_BADINDEX, desc=str(desc)) --- 146,150 ---- try: return self.data[args[0]] ! except IndexError as desc: raise COMException(scode=winerror.DISP_E_BADINDEX, desc=str(desc)) *************** *** 161,165 **** try: del self.data[index] ! except IndexError, desc: raise COMException(scode=winerror.DISP_E_BADINDEX, desc=str(desc)) --- 161,165 ---- try: del self.data[index] ! except IndexError as desc: raise COMException(scode=winerror.DISP_E_BADINDEX, desc=str(desc)) Index: register.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/register.py,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** register.py 10 Feb 2008 13:27:13 -0000 1.21 --- register.py 26 Nov 2008 09:03:29 -0000 1.21.2.1 *************** *** 45,51 **** try: win32api.RegDeleteKey(base, path) ! except win32api.error, (code, fn, msg): if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, msg) def recurse_delete_key(path, base=win32con.HKEY_CLASSES_ROOT): --- 45,52 ---- try: win32api.RegDeleteKey(base, path) ! except win32api.error as xxx_todo_changeme: ! (code, fn, msg) = xxx_todo_changeme.args if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, msg) def recurse_delete_key(path, base=win32con.HKEY_CLASSES_ROOT): *************** *** 56,62 **** try: h = win32api.RegOpenKey(base, path) ! except win32api.error, (code, fn, msg): if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, msg) else: # parent key found and opened successfully. do some work, making sure --- 57,64 ---- try: h = win32api.RegOpenKey(base, path) ! except win32api.error as xxx_todo_changeme2: ! (code, fn, msg) = xxx_todo_changeme2.args if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, msg) else: # parent key found and opened successfully. do some work, making sure *************** *** 67,73 **** try: subkeyname = win32api.RegEnumKey(h, 0) ! except win32api.error, (code, fn, msg): if code != winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error, (code, fn, msg) break recurse_delete_key(path + '\\' + subkeyname, base) --- 69,76 ---- try: subkeyname = win32api.RegEnumKey(h, 0) ! except win32api.error as xxx_todo_changeme1: ! (code, fn, msg) = xxx_todo_changeme1.args if code != winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error(code, fn, msg) break recurse_delete_key(path + '\\' + subkeyname, base) *************** *** 111,115 **** if not os.path.exists(exeName): if mustfind: ! raise RuntimeError, "Can not locate the program '%s'" % exeBaseName return None return exeName --- 114,118 ---- if not os.path.exists(exeName): if mustfind: ! raise RuntimeError("Can not locate the program '%s'" % exeBaseName) return None return exeName *************** *** 132,136 **** os.stat(pyfile) except os.error: ! raise RuntimeError, "Can not locate the Python module 'win32com.server.%s'" % baseName return pyfile --- 135,139 ---- os.stat(pyfile) except os.error: ! raise RuntimeError("Can not locate the Python module 'win32com.server.%s'" % baseName) return pyfile *************** *** 176,180 **** ### Certain policies do not require a "class name", just the policy itself. if not pythonInstString and not policy: ! raise TypeError, 'You must specify either the Python Class or Python Policy which implement the COM object.' keyNameRoot = "CLSID\\%s" % str(clsid) --- 179,183 ---- ### Certain policies do not require a "class name", just the policy itself. if not pythonInstString and not policy: ! raise TypeError('You must specify either the Python Class or Python Policy which implement the COM object.') keyNameRoot = "CLSID\\%s" % str(clsid) *************** *** 205,209 **** dllName = win32api.GetModuleFileName(sys.frozendllhandle) else: ! raise RuntimeError, "We appear to have a frozen DLL, but I don't know the DLL to use" else: # Normal case - running from .py file, so register pythoncom's DLL. --- 208,212 ---- dllName = win32api.GetModuleFileName(sys.frozendllhandle) else: ! raise RuntimeError("We appear to have a frozen DLL, but I don't know the DLL to use") else: # Normal case - running from .py file, so register pythoncom's DLL. *************** *** 402,406 **** except (IndexError, win32api.error): # Can't find the script file - the user must explicitely set the _reg_... attribute. ! raise TypeError, "Can't locate the script hosting the COM object - please set _reg_class_spec_ in your object" spec = moduleName + "." + cls.__name__ --- 405,409 ---- except (IndexError, win32api.error): # Can't find the script file - the user must explicitely set the _reg_... attribute. ! raise TypeError("Can't locate the script hosting the COM object - please set _reg_class_spec_ in your object") spec = moduleName + "." + cls.__name__ *************** *** 415,419 **** addPyComCat, dispatcherSpec, clsctx, addnPath) if not quiet: ! print 'Registered:', progID or spec, debuggingDesc # Register the typelibrary if tlb_filename: --- 418,422 ---- addPyComCat, dispatcherSpec, clsctx, addnPath) if not quiet: ! print('Registered:', progID or spec, debuggingDesc) # Register the typelibrary if tlb_filename: *************** *** 422,426 **** pythoncom.RegisterTypeLib(typelib, tlb_filename) if not quiet: ! print 'Registered type library:', tlb_filename extra = flags.get('finalize_register') if extra: --- 425,429 ---- pythoncom.RegisterTypeLib(typelib, tlb_filename) if not quiet: ! print('Registered type library:', tlb_filename) extra = flags.get('finalize_register') if extra: *************** *** 438,447 **** UnregisterServer(clsid, progID, verProgID, customKeys) if not quiet: ! print 'Unregistered:', progID or str(clsid) if unregister_typelib: tlb_guid = _get(cls, "_typelib_guid_") if tlb_guid is None: # I guess I could load the typelib, but they need the GUID anyway. ! print "Have typelib filename, but no GUID - can't unregister" else: major, minor = _get(cls, "_typelib_version_", (1,0)) --- 441,450 ---- UnregisterServer(clsid, progID, verProgID, customKeys) if not quiet: ! print('Unregistered:', progID or str(clsid)) if unregister_typelib: tlb_guid = _get(cls, "_typelib_guid_") if tlb_guid is None: # I guess I could load the typelib, but they need the GUID anyway. ! print("Have typelib filename, but no GUID - can't unregister") else: major, minor = _get(cls, "_typelib_version_", (1,0)) *************** *** 450,454 **** pythoncom.UnRegisterTypeLib(tlb_guid, major, minor, lcid) if not quiet: ! print 'Unregistered type library' except pythoncom.com_error: pass --- 453,457 ---- pythoncom.UnRegisterTypeLib(tlb_guid, major, minor, lcid) if not quiet: ! print('Unregistered type library') except pythoncom.com_error: pass *************** *** 486,490 **** else: RegisterClasses(*classes, **flags) ! except win32api.error, exc: # If we are on xp+ and have "access denied", retry using # ShellExecuteEx with 'runas' verb to force elevation (vista) and/or --- 489,493 ---- else: RegisterClasses(*classes, **flags) ! except win32api.error as exc: # If we are on xp+ and have "access denied", retry using # ShellExecuteEx with 'runas' verb to force elevation (vista) and/or *************** *** 499,503 **** if not flags['quiet']: ! print "Requesting elevation and retrying..." new_params = " ".join(['"' + a + '"' for a in sys.argv]) # specifying the parent means the dialog is centered over our window, --- 502,506 ---- if not flags['quiet']: ! print("Requesting elevation and retrying...") new_params = " ".join(['"' + a + '"' for a in sys.argv]) # specifying the parent means the dialog is centered over our window, *************** *** 524,533 **** if exit_code: # Even if quiet you get to see this error. ! print "Error: registration failed (exit code %s)." % exit_code ! print "Please re-execute this command from an elevated command-prompt" ! print "to see details about the error." else: if not flags['quiet']: ! print "Elevated process succeeded." def RegisterPyComCategory(): --- 527,536 ---- if exit_code: # Even if quiet you get to see this error. ! print("Error: registration failed (exit code %s)." % exit_code) ! print("Please re-execute this command from an elevated command-prompt") ! print("to see details about the error.") else: if not flags['quiet']: ! print("Elevated process succeeded.") def RegisterPyComCategory(): Index: dispatcher.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/dispatcher.py,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** dispatcher.py 12 Apr 2005 04:28:44 -0000 1.6 --- dispatcher.py 26 Nov 2008 09:03:29 -0000 1.6.4.1 *************** *** 135,140 **** else: for arg in args[:-1]: ! print arg, ! print args[-1] class DispatcherTrace(DispatcherBase): --- 135,140 ---- else: for arg in args[:-1]: ! print(arg, end=' ') ! print(args[-1]) class DispatcherTrace(DispatcherBase): *************** *** 231,237 **** #import pywin.debugger pywin.debugger.brk() ! print "The DispatcherWin32dbg dispatcher is deprecated!" ! print "Please let me know if this is a problem." ! print "Uncomment the relevant lines in dispatcher.py to re-enable" # DEBUGGER Note - You can either: # * Hit Run and wait for a (non Exception class) exception to occur! --- 231,237 ---- #import pywin.debugger pywin.debugger.brk() ! print("The DispatcherWin32dbg dispatcher is deprecated!") ! print("Please let me know if this is a problem.") ! print("Uncomment the relevant lines in dispatcher.py to re-enable") # DEBUGGER Note - You can either: # * Hit Run and wait for a (non Exception class) exception to occur! |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/mapi/demos Modified Files: Tag: py3k mapisend.py Log Message: many more upgrades to py3k syntax Index: mapisend.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/demos/mapisend.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** mapisend.py 24 Sep 2004 04:03:52 -0000 1.2 --- mapisend.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 *************** *** 45,49 **** #check for errors if mapitags.PROP_TYPE(tag) == mapitags.PT_ERROR: ! raise TypeError,'got PT_ERROR instead of PT_BINARY: %s'%eid outboxfolder = msgstore.OpenEntry(eid,None,mapi.MAPI_BEST_ACCESS) --- 45,49 ---- #check for errors if mapitags.PROP_TYPE(tag) == mapitags.PT_ERROR: ! raise TypeError('got PT_ERROR instead of PT_BINARY: %s'%eid) outboxfolder = msgstore.OpenEntry(eid,None,mapi.MAPI_BEST_ACCESS) |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/ifilter/demo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/ifilter/demo Modified Files: Tag: py3k filterDemo.py Log Message: many more upgrades to py3k syntax Index: filterDemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/ifilter/demo/filterDemo.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** filterDemo.py 22 Jun 2004 00:53:54 -0000 1.1 --- filterDemo.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 78,82 **** propName = '%s:%s' % attr ! except pythoncom.com_error, e: if e[0] == FILTER_E_END_OF_CHUNKS: # we have read all the chunks --- 78,82 ---- propName = '%s:%s' % attr ! except pythoncom.com_error as e: if e[0] == FILTER_E_END_OF_CHUNKS: # we have read all the chunks *************** *** 115,119 **** self.Close() ! except pythoncom.com_error, e: self._trace("ERROR processing file", e) raise --- 115,119 ---- self.Close() ! except pythoncom.com_error as e: self._trace("ERROR processing file", e) raise *************** *** 130,134 **** try: self.f = ifilter.BindIFilterFromStorage(self.stg) ! except pythoncom.com_error, e: if e[0] == -2147467262: # 0x80004002: # no interface, try the load interface (this happens for some MSoft files) self.f = ifilter.LoadIFilter(fileName) --- 130,134 ---- try: self.f = ifilter.BindIFilterFromStorage(self.stg) ! except pythoncom.com_error as e: if e[0] == -2147467262: # 0x80004002: # no interface, try the load interface (this happens for some MSoft files) self.f = ifilter.LoadIFilter(fileName) *************** *** 147,151 **** try: body_chunks.append(self.f.GetText()) ! except pythoncom.com_error, e: if e[0] in [FILTER_E_NO_MORE_TEXT, FILTER_E_NO_MORE_TEXT, FILTER_E_NO_TEXT]: break --- 147,151 ---- try: body_chunks.append(self.f.GetText()) ! except pythoncom.com_error as e: if e[0] in [FILTER_E_NO_MORE_TEXT, FILTER_E_NO_MORE_TEXT, FILTER_E_NO_TEXT]: break *************** *** 160,164 **** try: pss = self.stg.QueryInterface(pythoncom.IID_IPropertySetStorage ) ! except pythoncom.com_error, e: self._trace('No Property information could be retrieved', e) return --- 160,164 ---- try: pss = self.stg.QueryInterface(pythoncom.IID_IPropertySetStorage ) ! except pythoncom.com_error as e: self._trace('No Property information could be retrieved', e) return *************** *** 185,189 **** ret = ' '.join([str(arg) for arg in args]) try: ! print ret except IOError: pass --- 185,189 ---- ret = ' '.join([str(arg) for arg in args]) try: ! print(ret) except IOError: pass *************** *** 191,211 **** def _usage(): import os ! print "Usage: %s filename [verbose [dumpbody]]" % (os.path.basename(sys.argv[0]),) ! print ! print "Where:-" ! print "filename = name of the file to extract text & properties from" ! print "verbose = 1=debug output, 0=no debug output (default=0)" ! print "dumpbody = 1=print text content, 0=don't print content (default=1)" ! print ! print "e.g. to dump a word file called spam.doc go:- filterDemo.py spam.doc" ! print ! print "by default .htm, .txt, .doc, .dot, .xls, .xlt, .ppt are supported" ! print "you can filter .pdf's by downloading adobes ifilter component. " ! print "(currently found at http://download.adobe.com/pub/adobe/acrobat/win/all/ifilter50.exe)." ! print "ifilters for other filetypes are also available." ! print ! print "This extension is only supported on win2000 & winXP - because thats the only" ! print "place the ifilter stuff is supported. For more info on the API check out " ! print "MSDN under ifilters" --- 191,211 ---- def _usage(): import os ! print("Usage: %s filename [verbose [dumpbody]]" % (os.path.basename(sys.argv[0]),))) ! print() ! print("Where:-") ! print("filename = name of the file to extract text & properties from") ! print("verbose = 1=debug output, 0=no debug output (default=0)") ! print("dumpbody = 1=print text content, 0=don't print content (default=1)") ! print() ! print("e.g. to dump a word file called spam.doc go:- filterDemo.py spam.doc") ! print() ! print("by default .htm, .txt, .doc, .dot, .xls, .xlt, .ppt are supported") ! print("you can filter .pdf's by downloading adobes ifilter component. ") ! print("(currently found at http://download.adobe.com/pub/adobe/acrobat/win/all/ifilter50.exe).") ! print("ifilters for other filetypes are also available.") ! print() ! print("This extension is only supported on win2000 & winXP - because thats the only") ! print("place the ifilter stuff is supported. For more info on the API check out ") ! print("MSDN under ifilters") *************** *** 232,253 **** if bDumpBody: ! print "Body" ch = ' '.join(propMap.get('body', [])) try: ! print ch except UnicodeError: ! print ch.encode('iso8859-1','ignore') ! print "Properties" for propName, propValue in propMap.items(): ! print propName,":", if propName == 'body': ! print "<%s length: %d>" % (propName, reduce(operator.add, [len(p) for p in propValue]),) elif type(propValue) == type([]): ! print for pv in propValue: ! print pv else: ! print propValue ! print ! \ No newline at end of file --- 232,252 ---- if bDumpBody: ! print("Body") ch = ' '.join(propMap.get('body', [])) try: ! print(ch) except UnicodeError: ! print(ch.encode('iso8859-1','ignore')) ! print("Properties") for propName, propValue in propMap.items(): ! print(propName,":", end=' ') if propName == 'body': ! print("<%s length: %d>" % (propName, reduce(operator.add, [len(p) for p in propValue]),)) elif type(propValue) == type([]): ! print() for pv in propValue: ! print(pv) else: ! print(propValue) ! print() |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/mapi Modified Files: Tag: py3k mapiutil.py Log Message: many more upgrades to py3k syntax Index: mapiutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/mapiutil.py,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** mapiutil.py 23 Oct 2008 09:45:16 -0000 1.5.4.1 --- mapiutil.py 26 Nov 2008 09:03:30 -0000 1.5.4.2 *************** *** 121,125 **** type_tag = _MapiTypeMap.get(type(val)) if type_tag is None: ! raise ValueError, "Don't know what to do with '%r' ('%s')" % (val, type(val)) prop = mapitags.PROP_TAG( type_tag, mapitags.PROP_ID(propIds[0])) if val is None: --- 121,125 ---- type_tag = _MapiTypeMap.get(type(val)) if type_tag is None: ! raise ValueError("Don't know what to do with '%r' ('%s')" % (val, type(val))) prop = mapitags.PROP_TAG( type_tag, mapitags.PROP_ID(propIds[0])) if val is None: *************** *** 159,163 **** tagType = mapitags.PT_SYSTIME else: ! raise ValueError, "The type of object %s(%s) can not be written" % (`val`,type_val) key = mapitags.PROP_TAG(tagType, mapitags.PROP_ID(newIds[newIdNo])) newIdNo = newIdNo + 1 --- 159,163 ---- tagType = mapitags.PT_SYSTIME else: ! raise ValueError("The type of object %s(%s) can not be written" % (`val`,type_val)) key = mapitags.PROP_TAG(tagType, mapitags.PROP_ID(newIds[newIdNo])) newIdNo = newIdNo + 1 |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com/servers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32com/servers Modified Files: Tag: py3k PythonTools.py interp.py perfmon.py Log Message: many more upgrades to py3k syntax Index: interp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/interp.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** interp.py 18 Dec 2002 04:20:58 -0000 1.2 --- interp.py 26 Nov 2008 09:03:29 -0000 1.2.4.1 *************** *** 50,53 **** if __name__=='__main__': ! print "Registering COM server..." Register() --- 50,53 ---- if __name__=='__main__': ! print("Registering COM server...") Register() Index: PythonTools.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/PythonTools.py,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** PythonTools.py 21 Aug 2000 03:46:55 -0000 1.3 --- PythonTools.py 26 Nov 2008 09:03:29 -0000 1.3.4.1 *************** *** 30,38 **** verprogid = "Python.Tools.1" if "--unregister" in sys.argv: ! print "Unregistering..." UnregisterServer(clsid, progid, verprogid) ! print "Unregistered OK" else: ! print "Registering COM server..." RegisterServer(clsid, "win32com.servers.PythonTools.Tools", --- 30,38 ---- verprogid = "Python.Tools.1" if "--unregister" in sys.argv: ! print("Unregistering...") UnregisterServer(clsid, progid, verprogid) ! print("Unregistered OK") else: ! print("Registering COM server...") RegisterServer(clsid, "win32com.servers.PythonTools.Tools", *************** *** 40,42 **** progid, verprogid) ! print "Class registered." --- 40,42 ---- progid, verprogid) ! print("Class registered.") Index: perfmon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/perfmon.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** perfmon.py 1 Sep 1999 23:02:02 -0000 1.1 --- perfmon.py 26 Nov 2008 09:03:29 -0000 1.1.4.1 *************** *** 18,27 **** try: return win32pdhutil.GetPerformanceAttributes(object, counter, instance, machine=machine) ! except win32pdhutil.error, (rc, fn, desc): raise exception.Exception(desc=desc) ! except TypeError, desc: raise exception.Exception(desc=desc,scode=winerror.DISP_E_TYPEMISMATCH) if __name__=='__main__': ! print "Registering COM server..." register.UseCommandLine(PerfMonQuery) --- 18,28 ---- try: return win32pdhutil.GetPerformanceAttributes(object, counter, instance, machine=machine) ! except win32pdhutil.error as xxx_todo_changeme: ! (rc, fn, desc) = xxx_todo_changeme.args raise exception.Exception(desc=desc) ! except TypeError as desc: raise exception.Exception(desc=desc,scode=winerror.DISP_E_TYPEMISMATCH) if __name__=='__main__': ! print("Registering COM server...") register.UseCommandLine(PerfMonQuery) |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com/makegw In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32com/makegw Modified Files: Tag: py3k makegw.py makegwparse.py Log Message: many more upgrades to py3k syntax Index: makegw.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegw.py,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** makegw.py 25 Apr 2007 03:32:05 -0000 1.9 --- makegw.py 26 Nov 2008 09:03:29 -0000 1.9.2.1 *************** *** 207,211 **** codeCobjects = codeCobjects + "\t%s;\n" % (comArgDeclString) argsCOM = argsCOM + ", " + comArgName ! except makegwparse.error_not_supported, why: f.write('// *** The input argument %s of type "%s" was not processed ***\n// Please check the conversion function is appropriate and exists!\n' % (arg.name, arg.raw_type)) --- 207,211 ---- codeCobjects = codeCobjects + "\t%s;\n" % (comArgDeclString) argsCOM = argsCOM + ", " + comArgName ! except makegwparse.error_not_supported as why: f.write('// *** The input argument %s of type "%s" was not processed ***\n// Please check the conversion function is appropriate and exists!\n' % (arg.name, arg.raw_type)) *************** *** 254,258 **** codeVarsPass = codeVarsPass + ", " + argCvt.GetBuildValueArg() codeDecl = codeDecl + argCvt.DeclareParseArgTupleInputConverter() ! except makegwparse.error_not_supported, why: f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why)) continue --- 254,258 ---- codeVarsPass = codeVarsPass + ", " + argCvt.GetBuildValueArg() codeDecl = codeDecl + argCvt.DeclareParseArgTupleInputConverter() ! except makegwparse.error_not_supported as why: f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why)) continue *************** *** 387,391 **** codePre = codePre + argCvt.GetBuildForGatewayPreCode() codePost = codePost + argCvt.GetBuildForGatewayPostCode() ! except makegwparse.error_not_supported, why: f.write('// *** The input argument %s of type "%s" was not processed ***\n// - Please ensure this conversion function exists, and is appropriate\n// - %s\n' % (arg.name, arg.raw_type, why)) f.write('\tPyObject *ob%s = PyObject_From%s(%s);\n' % (arg.name, arg.type, arg.name)) --- 387,391 ---- codePre = codePre + argCvt.GetBuildForGatewayPreCode() codePost = codePost + argCvt.GetBuildForGatewayPostCode() ! except makegwparse.error_not_supported as why: f.write('// *** The input argument %s of type "%s" was not processed ***\n// - Please ensure this conversion function exists, and is appropriate\n// - %s\n' % (arg.name, arg.raw_type, why)) f.write('\tPyObject *ob%s = PyObject_From%s(%s);\n' % (arg.name, arg.type, arg.name)) *************** *** 430,434 **** codePost = codePost + argCvt.GetParsePostCode() needConversion = needConversion or argCvt.NeedUSES_CONVERSION() ! except makegwparse.error_not_supported, why: f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why)) --- 430,434 ---- codePost = codePost + argCvt.GetParsePostCode() needConversion = needConversion or argCvt.NeedUSES_CONVERSION() ! except makegwparse.error_not_supported as why: f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why)) Index: makegwparse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** makegwparse.py 27 Jul 2008 06:44:59 -0000 1.13 --- makegwparse.py 26 Nov 2008 09:03:29 -0000 1.13.2.1 *************** *** 58,62 **** else: return "?? (%d)" % (dif,) ! raise error_not_supported, "Can't indirect this far - please fix me :-)" def GetIndirectedArgName(self, indirectFrom, indirectionTo): #print 'get:',self.arg.name, indirectFrom,self._GetDeclaredIndirection() + self.builtinIndirection, indirectionTo, self.arg.indirectionLevel --- 58,62 ---- else: return "?? (%d)" % (dif,) ! raise error_not_supported("Can't indirect this far - please fix me :-)") def GetIndirectedArgName(self, indirectFrom, indirectionTo): #print 'get:',self.arg.name, indirectFrom,self._GetDeclaredIndirection() + self.builtinIndirection, indirectionTo, self.arg.indirectionLevel *************** *** 126,130 **** def _GetDeclaredIndirection(self): return self.arg.indirectionLevel ! print 'declared:', self.arg.name, self.gatewayMode if self.gatewayMode: return self.arg.indirectionLevel --- 126,130 ---- def _GetDeclaredIndirection(self): return self.arg.indirectionLevel ! print('declared:', self.arg.name, self.gatewayMode) if self.gatewayMode: return self.arg.indirectionLevel *************** *** 586,590 **** return ArgFormatterInterface(arg, 0, 1) ! raise error_not_supported, "The type '%s' (%s) is unknown." % (arg.type, arg.name) --- 586,590 ---- return ArgFormatterInterface(arg, 0, 1) ! raise error_not_supported("The type '%s' (%s) is unknown." % (arg.type, arg.name)) *************** *** 647,651 **** if VERBOSE: ! print " Arg %s of type %s%s (%s)" % (self.name, self.type, "*" * self.indirectionLevel, self.inout) def HasAttribute(self, typ): --- 647,651 ---- if VERBOSE: ! print(" Arg %s of type %s%s (%s)" % (self.name, self.type, "*" * self.indirectionLevel, self.inout)) def HasAttribute(self, typ): *************** *** 692,700 **** if self.result != "HRESULT": if self.result=="DWORD": # DWORD is for old old stuff? ! print "Warning: Old style interface detected - compilation errors likely!" else: ! print "Method %s - Only HRESULT return types are supported." % self.name # raise error_not_supported, if VERBOSE: ! print " Method %s %s(" % (self.result, self.name) while 1: arg = Argument(self.good_interface_names) --- 692,700 ---- if self.result != "HRESULT": if self.result=="DWORD": # DWORD is for old old stuff? ! print("Warning: Old style interface detected - compilation errors likely!") else: ! print("Method %s - Only HRESULT return types are supported." % self.name) # raise error_not_supported, if VERBOSE: ! print(" Method %s %s(" % (self.result, self.name)) while 1: arg = Argument(self.good_interface_names) *************** *** 719,723 **** self.base = mo.group(3) if VERBOSE: ! print "Interface %s : public %s" % (self.name, self.base) def BuildMethods(self, file): --- 719,723 ---- self.base = mo.group(3) if VERBOSE: ! print("Interface %s : public %s" % (self.name, self.base)) def BuildMethods(self, file): *************** *** 747,751 **** if mo: name = mo.group(2) ! print name AllConverters[name] = (ArgFormatterInterface, 0, 1) if name==interfaceName: --- 747,751 ---- if mo: name = mo.group(2) ! print(name) AllConverters[name] = (ArgFormatterInterface, 0, 1) if name==interfaceName: *************** *** 769,773 **** except re.error: traceback.print_exc() ! print "The interface could not be built, as the regular expression failed!" def test(): f=open("d:\\msdev\\include\\objidl.h") --- 769,773 ---- except re.error: traceback.print_exc() ! print("The interface could not be built, as the regular expression failed!") def test(): f=open("d:\\msdev\\include\\objidl.h") *************** *** 780,784 **** res=r.search(text,0) if res==-1: ! print "** Not found" else: ! print "%d\n%s\n%s\n%s\n%s" % (res, r.group(1), r.group(2), r.group(3), r.group(4)) --- 780,784 ---- res=r.search(text,0) if res==-1: ! print("** Not found") else: ! print("%d\n%s\n%s\n%s\n%s" % (res, r.group(1), r.group(2), r.group(3), r.group(4))) |
From: Mark H. <mha...@us...> - 2008-11-26 09:03:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/axscript/test Modified Files: Tag: py3k leakTest.py testHost.py testHost4Dbg.py Log Message: many more upgrades to py3k syntax Index: testHost4Dbg.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/testHost4Dbg.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** testHost4Dbg.py 1 Sep 1999 23:12:51 -0000 1.1 --- testHost4Dbg.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 12,16 **** def OnScriptError(self, error): ! print "An error occurred in the Script Code" exc = error.GetExceptionInfo() try: --- 12,16 ---- def OnScriptError(self, error): ! print("An error occurred in the Script Code") exc = error.GetExceptionInfo() try: *************** *** 19,28 **** text = "<unknown>" context, line, char = error.GetSourcePosition() ! print "Exception: %s (line %d)\n%s\n%s^\n%s" % (exc[1], line, text, " " * (char-1), exc[2]) class ObjectModel: _public_methods_ = [ 'echo', 'msgbox' ] def echo(self, *args): ! print string.join(map(str, args)) def msgbox(self, *args): msg = string.join(map(str, args)) --- 19,28 ---- text = "<unknown>" context, line, char = error.GetSourcePosition() ! print("Exception: %s (line %d)\n%s\n%s^\n%s" % (exc[1], line, text, " " * (char-1), exc[2])) class ObjectModel: _public_methods_ = [ 'echo', 'msgbox' ] def echo(self, *args): ! print(string.join(map(str, args))) def msgbox(self, *args): msg = string.join(map(str, args)) *************** *** 55,60 **** pyEngine.Start() # Actually run the Python code vbEngine.Start() # Actually run the VB code ! except pythoncom.com_error, details: ! print "Script failed: %s (0x%x)" % (details[1], details[0]) # Now run the code expected to fail! # try: --- 55,60 ---- pyEngine.Start() # Actually run the Python code vbEngine.Start() # Actually run the VB code ! except pythoncom.com_error as details: ! print("Script failed: %s (0x%x)" % (details[1], details[0])) # Now run the code expected to fail! # try: *************** *** 74,76 **** win32com.axdebug.util._dump_wrapped() sys.exc_type = sys.exc_value = sys.exc_traceback = None ! print pythoncom._GetInterfaceCount(),"com objects still alive" --- 74,76 ---- win32com.axdebug.util._dump_wrapped() sys.exc_type = sys.exc_value = sys.exc_traceback = None ! print(pythoncom._GetInterfaceCount(),"com objects still alive") Index: testHost.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/testHost.py,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** testHost.py 26 Nov 2008 07:17:39 -0000 1.5.2.1 --- testHost.py 26 Nov 2008 09:03:30 -0000 1.5.2.2 *************** *** 24,28 **** if not verbose: return ! print " >Exception:", exc[1] try: st = error.GetSourceLineText() --- 24,28 ---- if not verbose: return ! print(" >Exception:", exc[1]) try: st = error.GetSourceLineText() *************** *** 32,36 **** text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2] for line in text.splitlines(): ! print " >" + line class MyCollection(util.Collection): --- 32,36 ---- text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2] for line in text.splitlines(): ! print(" >" + line) class MyCollection(util.Collection): *************** *** 52,63 **** if self.verbose: for arg in args: ! print arg, ! print def fail(self, *args): ! print "**** fail() called ***" for arg in args: ! print arg, ! print self.fail_called = 1 # self._connect_server_.Broadcast(last) --- 52,63 ---- if self.verbose: for arg in args: ! print(arg, end=' ') ! print() def fail(self, *args): ! print("**** fail() called ***") for arg in args: ! print(arg, end=' ') ! print() self.fail_called = 1 # self._connect_server_.Broadcast(last) Index: leakTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/leakTest.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** leakTest.py 18 Dec 2002 11:57:23 -0000 1.1 --- leakTest.py 26 Nov 2008 09:03:30 -0000 1.1.4.1 *************** *** 12,16 **** exc = error.GetExceptionInfo() context, line, char = error.GetSourcePosition() ! print " >Exception:", exc[1] try: st = error.GetSourceLineText() --- 12,16 ---- exc = error.GetExceptionInfo() context, line, char = error.GetSourcePosition() ! print(" >Exception:", exc[1]) try: st = error.GetSourceLineText() *************** *** 20,28 **** text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2] for line in string.split(text,"\n"): ! print " >" + line class MyCollection(util.Collection): def _NewEnum(self): ! print "Making new Enumerator" return util.Collection._NewEnum(self) --- 20,28 ---- text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2] for line in string.split(text,"\n"): ! print(" >" + line) class MyCollection(util.Collection): def _NewEnum(self): ! print("Making new Enumerator") return util.Collection._NewEnum(self) *************** *** 40,45 **** if self.verbose: for arg in args: ! print arg, ! print # self._connect_server_.Broadcast(last) --- 40,45 ---- if self.verbose: for arg in args: ! print(arg, end=' ') ! print() # self._connect_server_.Broadcast(last) *************** *** 117,121 **** engine.eScript.SetScriptState(axscript.SCRIPTSTATE_UNINITIALIZED) engine.eScript.SetScriptSite(util.wrap(site)) ! print "restarting" engine.Start() # all done! --- 117,121 ---- engine.eScript.SetScriptState(axscript.SCRIPTSTATE_UNINITIALIZED) engine.eScript.SetScriptSite(util.wrap(site)) ! print("restarting") engine.Start() # all done! *************** *** 128,139 **** try: ob.hello("Goober") ! except pythoncom.com_error, exc: ! print "***** Calling 'hello' failed", exc return if echoer.last != "Goober": ! print "***** Function call didnt set value correctly", `echoer.last` if str(ob.prop) != "Property Value": ! print "***** Property Value not correct - ", `ob.prop` ob.testcollection() --- 128,139 ---- try: ob.hello("Goober") ! except pythoncom.com_error as exc: ! print("***** Calling 'hello' failed", exc) return if echoer.last != "Goober": ! print("***** Function call didnt set value correctly", `echoer.last`) if str(ob.prop) != "Property Value": ! print("***** Property Value not correct - ", `ob.prop`) ob.testcollection() *************** *** 142,151 **** result = engine.eParse.ParseScriptText("1+1", None, None, None, 0, 0, axscript.SCRIPTTEXT_ISEXPRESSION) if result != 2: ! print "Engine could not evaluate '1+1' - said the result was", result def dotestall(): for i in xrange(10): TestEngine("Python", PyScript) ! print sys.gettotalrefcount() ## print "Testing Exceptions" ## try: --- 142,151 ---- result = engine.eParse.ParseScriptText("1+1", None, None, None, 0, 0, axscript.SCRIPTTEXT_ISEXPRESSION) if result != 2: ! print("Engine could not evaluate '1+1' - said the result was", result) def dotestall(): for i in xrange(10): TestEngine("Python", PyScript) ! print(sys.gettotalrefcount()) ## print "Testing Exceptions" ## try: *************** *** 158,162 **** dotestall() pythoncom.CoUninitialize() ! print "AXScript Host worked correctly - %d/%d COM objects left alive." % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount()) if __name__ == '__main__': --- 158,162 ---- dotestall() pythoncom.CoUninitialize() ! print("AXScript Host worked correctly - %d/%d COM objects left alive." % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount())) if __name__ == '__main__': |
From: Mark H. <mha...@us...> - 2008-11-26 08:56:41
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19784/test Modified Files: test_win32trace.py testall.py Log Message: modernize syntax: all remaining raise statements in win32/* upgraded Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/testall.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testall.py 14 Nov 2008 00:22:25 -0000 1.7 --- testall.py 26 Nov 2008 08:56:33 -0000 1.8 *************** *** 34,38 **** if rc: base = os.path.basename(self.argv[1]) ! raise AssertionError, "%s failed with exit code %s. Output is:\n%s" % (base, rc, output) def get_demo_tests(): --- 34,38 ---- if rc: base = os.path.basename(self.argv[1]) ! raise AssertionError("%s failed with exit code %s. Output is:\n%s" % (base, rc, output)) def get_demo_tests(): Index: test_win32trace.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32trace.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_win32trace.py 6 Mar 2005 23:55:59 -0000 1.5 --- test_win32trace.py 26 Nov 2008 08:56:33 -0000 1.6 *************** *** 18,23 **** win32trace.TermRead() win32trace.TermWrite() ! raise RuntimeError, "An existing win32trace reader appears to be " \ ! "running - please stop this process and try again" class TestInitOps(unittest.TestCase): --- 18,23 ---- win32trace.TermRead() win32trace.TermWrite() ! raise RuntimeError("An existing win32trace reader appears to be " \ ! "running - please stop this process and try again") class TestInitOps(unittest.TestCase): |
From: Mark H. <mha...@us...> - 2008-11-26 08:56:40
|
Update of /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19784/scripts/VersionStamp Modified Files: vssutil.py Log Message: modernize syntax: all remaining raise statements in win32/* upgraded Index: vssutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp/vssutil.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** vssutil.py 2 Sep 1999 00:19:34 -0000 1.1 --- vssutil.py 26 Nov 2008 08:56:33 -0000 1.2 *************** *** 91,95 **** import win32api if win32api.GetFullPathName(inName)==win32api.GetFullPathName(outName): ! raise RuntimeError, "The input and output filenames can not be the same" sourceSafe=GetSS() project = sourceSafe.VSSItem(projectName) --- 91,95 ---- import win32api if win32api.GetFullPathName(inName)==win32api.GetFullPathName(outName): ! raise RuntimeError("The input and output filenames can not be the same") sourceSafe=GetSS() project = sourceSafe.VSSItem(projectName) *************** *** 150,154 **** buildNo = str(buildNo) except ValueError: ! raise error, "The previous label could not be incremented: %s" % (oldBuild) if not auto: --- 150,154 ---- buildNo = str(buildNo) except ValueError: ! raise error("The previous label could not be incremented: %s" % (oldBuild)) if not auto: |