pywin32-checkins Mailing List for Python for Windows Extensions (Page 43)
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-12-04 07:28:51
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4381/Pythonwin/pywin/framework Modified Files: Tag: py3k intpyapp.py scriptutils.py startup.py Log Message: merge more various changes from the trunk Index: intpyapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpyapp.py,v retrieving revision 1.11.2.4 retrieving revision 1.11.2.5 diff -C2 -d -r1.11.2.4 -r1.11.2.5 *** intpyapp.py 27 Nov 2008 11:31:03 -0000 1.11.2.4 --- intpyapp.py 4 Dec 2008 07:28:46 -0000 1.11.2.5 *************** *** 292,296 **** for module in modules: try: ! exec("import "+module) except: # Catch em all, else the app itself dies! 'ImportError: traceback.print_exc() --- 292,296 ---- for module in modules: try: ! __import__(module) except: # Catch em all, else the app itself dies! 'ImportError: traceback.print_exc() Index: startup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/startup.py,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -C2 -d -r1.4.2.2 -r1.4.2.3 *** startup.py 26 Nov 2008 07:17:38 -0000 1.4.2.2 --- startup.py 4 Dec 2008 07:28:46 -0000 1.4.2.3 *************** *** 34,38 **** # scripts when running under a GUI environment. ! moduleName = "intpyapp" sys.appargvoffset = 0 sys.appargv = sys.argv[:] --- 34,38 ---- # scripts when running under a GUI environment. ! moduleName = "pywin.framework.intpyapp" sys.appargvoffset = 0 sys.appargv = sys.argv[:] *************** *** 46,51 **** sys.argv = newargv ! # Import the module that runs our interactive app. ! from . import intpyapp try: --- 46,51 ---- sys.argv = newargv ! # Import the application module. ! __import__(moduleName) try: Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.18.2.2 retrieving revision 1.18.2.3 diff -C2 -d -r1.18.2.2 -r1.18.2.3 *** scriptutils.py 26 Nov 2008 07:17:38 -0000 1.18.2.2 --- scriptutils.py 4 Dec 2008 07:28:46 -0000 1.18.2.3 *************** *** 381,385 **** modName, modExt = os.path.splitext(modName) newPath = None ! for key, mod in sys.modules.iteritems(): if hasattr(mod, '__file__'): fname = mod.__file__ --- 381,385 ---- modName, modExt = os.path.splitext(modName) newPath = None ! for key, mod in sys.modules.items(): if hasattr(mod, '__file__'): fname = mod.__file__ *************** *** 459,466 **** def RunTabNanny(filename): ! try: ! import cStringIO as io ! except ImportError: ! import io tabnanny = FindTabNanny() if tabnanny is None: --- 459,463 ---- def RunTabNanny(filename): ! import io as io tabnanny = FindTabNanny() if tabnanny is None: |
From: Mark H. <mha...@us...> - 2008-12-04 07:23:52
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/ifilter/demo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4132/com/win32comext/ifilter/demo Modified Files: filterDemo.py Log Message: move to dictionary iterators where possible Index: filterDemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/ifilter/demo/filterDemo.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** filterDemo.py 26 Nov 2008 08:39:33 -0000 1.2 --- filterDemo.py 4 Dec 2008 07:23:46 -0000 1.3 *************** *** 240,244 **** print "Properties" ! for propName, propValue in propMap.items(): print propName,":", if propName == 'body': --- 240,244 ---- print "Properties" ! for propName, propValue in propMap.iteritems(): print propName,":", if propName == 'body': |
From: Mark H. <mha...@us...> - 2008-12-04 07:23:52
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4132/com/win32comext/axdebug Modified Files: documents.py util.py Log Message: move to dictionary iterators where possible Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/util.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** util.py 26 Nov 2008 08:39:33 -0000 1.4 --- util.py 4 Dec 2008 07:23:46 -0000 1.5 *************** *** 53,57 **** from win32com.server.util import unwrap print "Wrapped items:" ! for key, items in all_wrapped.items(): print key, try: --- 53,57 ---- from win32com.server.util import unwrap print "Wrapped items:" ! for key, items in all_wrapped.iteritems(): print key, try: Index: documents.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/documents.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** documents.py 26 Nov 2008 08:39:33 -0000 1.3 --- documents.py 4 Dec 2008 07:23:46 -0000 1.4 *************** *** 113,117 **** def Close(self): ! for cc, node in self.ccsAndNodes.values(): try: # Must close the node before closing the provider --- 113,117 ---- def Close(self): ! for cc, node in self.ccsAndNodes.itervalues(): try: # Must close the node before closing the provider |
From: Mark H. <mha...@us...> - 2008-12-04 07:23:52
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4132/com/win32comext/adsi/demos Modified Files: search.py test.py Log Message: move to dictionary iterators where possible Index: search.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/demos/search.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** search.py 31 May 2005 12:43:16 -0000 1.3 --- search.py 4 Dec 2008 07:23:46 -0000 1.4 *************** *** 11,15 **** # convert integer type to the 'typename' as known in the headerfiles. if not ADsTypeNameMap: ! for n, v in adsicon.__dict__.items(): if n.startswith("ADSTYPE_"): ADsTypeNameMap[v] = n --- 11,15 ---- # convert integer type to the 'typename' as known in the headerfiles. if not ADsTypeNameMap: ! for n, v in adsicon.__dict__.iteritems(): if n.startswith("ADSTYPE_"): ADsTypeNameMap[v] = n Index: test.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/demos/test.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test.py 24 Sep 2004 07:31:16 -0000 1.1 --- test.py 4 Dec 2008 07:23:46 -0000 1.2 *************** *** 124,128 **** # Fill a map with VT_ datatypes, to give us better names: vt_map = {} ! for name, val in pythoncom.__dict__.items(): if name[:3] == "VT_": vt_map[val] = name --- 124,128 ---- # Fill a map with VT_ datatypes, to give us better names: vt_map = {} ! for name, val in pythoncom.__dict__.iteritems(): if name[:3] == "VT_": vt_map[val] = name *************** *** 206,210 **** import getopt, traceback tests = [] ! for ob in globals().values(): if type(ob)==type(main) and ob.__doc__: tests.append(ob) --- 206,210 ---- import getopt, traceback tests = [] ! for ob in globals().itervalues(): if type(ob)==type(main) and ob.__doc__: tests.append(ob) |
From: Mark H. <mha...@us...> - 2008-12-04 07:23:52
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/server In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4132/com/win32comext/axscript/server Modified Files: axsite.py Log Message: move to dictionary iterators where possible Index: axsite.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/server/axsite.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** axsite.py 4 Dec 2008 04:22:31 -0000 1.5 --- axsite.py 4 Dec 2008 07:23:46 -0000 1.6 *************** *** 64,68 **** self.lcid = lcid self.objModel = { } ! for name, object in objModel.items(): # Gregs code did string.lower this - I think that is callers job if he wants! self.objModel[name] = object --- 64,68 ---- self.lcid = lcid self.objModel = { } ! for name, object in objModel.iteritems(): # Gregs code did string.lower this - I think that is callers job if he wants! self.objModel[name] = object |
From: Mark H. <mha...@us...> - 2008-12-04 07:23:52
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/bits/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4132/com/win32comext/bits/test Modified Files: show_all_jobs.py test_bits.py Log Message: move to dictionary iterators where possible Index: show_all_jobs.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/bits/test/show_all_jobs.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** show_all_jobs.py 12 Feb 2008 00:10:57 -0000 1.2 --- show_all_jobs.py 4 Dec 2008 07:23:46 -0000 1.3 *************** *** 4,12 **** states = dict([(val, (name[13:])) ! for name, val in vars(bits).items() if name.startswith('BG_JOB_STATE_')]) job_types = dict([(val, (name[12:])) ! for name, val in vars(bits).items() if name.startswith('BG_JOB_TYPE_')]) --- 4,12 ---- states = dict([(val, (name[13:])) ! for name, val in vars(bits).iteritems() if name.startswith('BG_JOB_STATE_')]) job_types = dict([(val, (name[12:])) ! for name, val in vars(bits).iteritems() if name.startswith('BG_JOB_TYPE_')]) Index: test_bits.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/bits/test/test_bits.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_bits.py 12 Feb 2008 00:10:57 -0000 1.2 --- test_bits.py 4 Dec 2008 07:23:46 -0000 1.3 *************** *** 10,14 **** job_name = 'bits-pywin32-test' states = dict([(val, (name[13:])) ! for name, val in vars(bits).items() if name.startswith('BG_JOB_STATE_')]) --- 10,14 ---- job_name = 'bits-pywin32-test' states = dict([(val, (name[13:])) ! for name, val in vars(bits).iteritems() if name.startswith('BG_JOB_STATE_')]) |
From: Mark H. <mha...@us...> - 2008-12-04 07:22:24
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4045 Modified Files: eventLogDemo.py win32gui_taskbar.py Log Message: remove use of 'import *' Index: win32gui_taskbar.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_taskbar.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** win32gui_taskbar.py 3 Oct 2008 01:03:56 -0000 1.10 --- win32gui_taskbar.py 4 Dec 2008 07:22:19 -0000 1.11 *************** *** 1,12 **** # Creates a task-bar icon. Run from Python.exe to see the # messages printed. ! from win32api import * ! from win32gui import * ! import win32con import sys, os class MainWindow: def __init__(self): ! msg_TaskbarRestart = RegisterWindowMessage("TaskbarCreated"); message_map = { msg_TaskbarRestart: self.OnRestart, --- 1,11 ---- # Creates a task-bar icon. Run from Python.exe to see the # messages printed. ! import win32api, win32gui ! import win32con, winerror import sys, os class MainWindow: def __init__(self): ! msg_TaskbarRestart = win32gui.RegisterWindowMessage("TaskbarCreated"); message_map = { msg_TaskbarRestart: self.OnRestart, *************** *** 16,24 **** } # Register the Window class. ! wc = WNDCLASS() ! hinst = wc.hInstance = GetModuleHandle(None) wc.lpszClassName = "PythonTaskbarDemo" wc.style = win32con.CS_VREDRAW | win32con.CS_HREDRAW; ! wc.hCursor = LoadCursor( 0, win32con.IDC_ARROW ) wc.hbrBackground = win32con.COLOR_WINDOW wc.lpfnWndProc = message_map # could also specify a wndproc. --- 15,23 ---- } # Register the Window class. ! wc = win32gui.WNDCLASS() ! hinst = wc.hInstance = win32api.GetModuleHandle(None) wc.lpszClassName = "PythonTaskbarDemo" wc.style = win32con.CS_VREDRAW | win32con.CS_HREDRAW; ! wc.hCursor = win32api.LoadCursor( 0, win32con.IDC_ARROW ) wc.hbrBackground = win32con.COLOR_WINDOW wc.lpfnWndProc = message_map # could also specify a wndproc. *************** *** 33,44 **** # Create the Window. style = win32con.WS_OVERLAPPED | win32con.WS_SYSMENU ! self.hwnd = CreateWindow( classAtom, "Taskbar Demo", style, \ 0, 0, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, \ 0, 0, hinst, None) ! UpdateWindow(self.hwnd) self._DoCreateIcons() def _DoCreateIcons(self): # Try and find a custom icon ! hinst = GetModuleHandle(None) iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "pyc.ico" )) if not os.path.isfile(iconPathName): --- 32,43 ---- # Create the Window. style = win32con.WS_OVERLAPPED | win32con.WS_SYSMENU ! self.hwnd = win32gui.CreateWindow( wc.lpszClassName, "Taskbar Demo", style, \ 0, 0, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, \ 0, 0, hinst, None) ! win32gui.UpdateWindow(self.hwnd) self._DoCreateIcons() def _DoCreateIcons(self): # Try and find a custom icon ! hinst = win32api.GetModuleHandle(None) iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "pyc.ico" )) if not os.path.isfile(iconPathName): *************** *** 50,63 **** if os.path.isfile(iconPathName): icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE ! hicon = LoadImage(hinst, iconPathName, win32con.IMAGE_ICON, 0, 0, icon_flags) else: print "Can't find a Python icon file - using default" ! hicon = LoadIcon(0, win32con.IDI_APPLICATION) ! flags = NIF_ICON | NIF_MESSAGE | NIF_TIP nid = (self.hwnd, 0, flags, win32con.WM_USER+20, hicon, "Python Demo") try: ! Shell_NotifyIcon(NIM_ADD, nid) ! except error: # This is common when windows is starting, and this code is hit # before the taskbar has been created. --- 49,62 ---- if os.path.isfile(iconPathName): icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE ! hicon = win32gui.LoadImage(hinst, iconPathName, win32con.IMAGE_ICON, 0, 0, icon_flags) else: print "Can't find a Python icon file - using default" ! hicon = win32gui.LoadIcon(0, win32con.IDI_APPLICATION) ! flags = win32gui.NIF_ICON | win32gui.NIF_MESSAGE | win32gui.NIF_TIP nid = (self.hwnd, 0, flags, win32con.WM_USER+20, hicon, "Python Demo") try: ! win32gui.Shell_NotifyIcon(win32gui.NIM_ADD, nid) ! except win32gui.error: # This is common when windows is starting, and this code is hit # before the taskbar has been created. *************** *** 71,76 **** def OnDestroy(self, hwnd, msg, wparam, lparam): nid = (self.hwnd, 0) ! Shell_NotifyIcon(NIM_DELETE, nid) ! PostQuitMessage(0) # Terminate the app. def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): --- 70,75 ---- def OnDestroy(self, hwnd, msg, wparam, lparam): nid = (self.hwnd, 0) ! win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid) ! win32gui.PostQuitMessage(0) # Terminate the app. def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): *************** *** 79,98 **** elif lparam==win32con.WM_LBUTTONDBLCLK: print "You double-clicked me - goodbye" ! DestroyWindow(self.hwnd) elif lparam==win32con.WM_RBUTTONUP: print "You right clicked me." ! menu = CreatePopupMenu() ! AppendMenu( menu, win32con.MF_STRING, 1023, "Display Dialog") ! AppendMenu( menu, win32con.MF_STRING, 1024, "Say Hello") ! AppendMenu( menu, win32con.MF_STRING, 1025, "Exit program" ) ! pos = GetCursorPos() # See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/menus_0hdi.asp ! SetForegroundWindow(self.hwnd) ! TrackPopupMenu(menu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None) ! PostMessage(self.hwnd, win32con.WM_NULL, 0, 0) return 1 def OnCommand(self, hwnd, msg, wparam, lparam): ! id = LOWORD(wparam) if id == 1023: import win32gui_dialog --- 78,97 ---- elif lparam==win32con.WM_LBUTTONDBLCLK: print "You double-clicked me - goodbye" ! win32gui.DestroyWindow(self.hwnd) elif lparam==win32con.WM_RBUTTONUP: print "You right clicked me." ! menu = win32gui.CreatePopupMenu() ! win32gui.AppendMenu( menu, win32con.MF_STRING, 1023, "Display Dialog") ! win32gui.AppendMenu( menu, win32con.MF_STRING, 1024, "Say Hello") ! win32gui.AppendMenu( menu, win32con.MF_STRING, 1025, "Exit program" ) ! pos = win32gui.GetCursorPos() # See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/menus_0hdi.asp ! win32gui.SetForegroundWindow(self.hwnd) ! win32gui.TrackPopupMenu(menu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None) ! win32gui.PostMessage(self.hwnd, win32con.WM_NULL, 0, 0) return 1 def OnCommand(self, hwnd, msg, wparam, lparam): ! id = win32api.LOWORD(wparam) if id == 1023: import win32gui_dialog *************** *** 102,106 **** elif id == 1025: print "Goodbye" ! DestroyWindow(self.hwnd) else: print "Unknown command -", id --- 101,105 ---- elif id == 1025: print "Goodbye" ! win32gui.DestroyWindow(self.hwnd) else: print "Unknown command -", id *************** *** 108,112 **** def main(): w=MainWindow() ! PumpMessages() if __name__=='__main__': --- 107,111 ---- def main(): w=MainWindow() ! win32gui.PumpMessages() if __name__=='__main__': Index: eventLogDemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/eventLogDemo.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** eventLogDemo.py 7 Jun 2003 02:08:45 -0000 1.5 --- eventLogDemo.py 4 Dec 2008 07:22:19 -0000 1.6 *************** *** 1,7 **** ! import win32evtlog, traceback ! import win32api, win32con import win32security # To translate NT Sids to account names. ! from win32evtlogutil import * def ReadLog(computer, logType="Application", dumpEachRecord = 0): --- 1,7 ---- ! import win32evtlog ! import win32api import win32security # To translate NT Sids to account names. ! import win32evtlogutil def ReadLog(computer, logType="Application", dumpEachRecord = 0): *************** *** 18,22 **** for object in objects: # get it for testing purposes, but dont print it. ! msg = SafeFormatMessage(object, logType).encode("mbcs") if object.Sid is not None: try: --- 18,22 ---- for object in objects: # get it for testing purposes, but dont print it. ! msg = win32evtlogutil.SafeFormatMessage(object, logType) if object.Sid is not None: try: *************** *** 41,45 **** win32evtlog.CloseEventLog(h) ! def Usage(): print "Writes an event to the event log." print "-w : Dont write any test records." --- 41,45 ---- win32evtlog.CloseEventLog(h) ! def usage(): print "Writes an event to the event log." print "-w : Dont write any test records." *************** *** 74,78 **** computer = val if opt in ['-h', '-?']: ! Usage() return if opt=='-r': --- 74,78 ---- computer = val if opt in ['-h', '-?']: ! usage() return if opt=='-r': *************** *** 83,89 **** verbose = verbose + 1 if do_write: ! ReportEvent(logType, 2, strings=["The message text for event 2"], data = "Raw\0Data") ! ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_WARNING_TYPE, strings=["A warning"], data = "Raw\0Data") ! ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_INFORMATION_TYPE, strings=["An info"], data = "Raw\0Data") print "Successfully wrote 3 records to the log" --- 83,89 ---- verbose = verbose + 1 if do_write: ! win32evtlogutil.ReportEvent(logType, 2, strings=["The message text for event 2"], data = "Raw\0Data") ! win32evtlogutil.ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_WARNING_TYPE, strings=["A warning"], data = "Raw\0Data") ! win32evtlogutil.ReportEvent(logType, 1, eventType=win32evtlog.EVENTLOG_INFORMATION_TYPE, strings=["An info"], data = "Raw\0Data") print "Successfully wrote 3 records to the log" |
From: Mark H. <mha...@us...> - 2008-12-04 07:21:56
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3979 Modified Files: win32gui_menu.py Log Message: Show that GetMenuInfo() and GetMenuState appear to get the same incorrect state info for some menu items Index: win32gui_menu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** win32gui_menu.py 27 Nov 2008 11:11:11 -0000 1.10 --- win32gui_menu.py 4 Dec 2008 07:21:50 -0000 1.11 *************** *** 250,254 **** rc = CheckMenuRadioItem(self.sub_menu, 1004, 1005, id, win32con.MF_BYCOMMAND) ! # Now get the info via GetMenuItemInfo and check the new state buf, extras = EmptyMENUITEMINFO() win32gui.GetMenuItemInfo(self.sub_menu, id, False, buf) --- 250,258 ---- rc = CheckMenuRadioItem(self.sub_menu, 1004, 1005, id, win32con.MF_BYCOMMAND) ! # Get and check the new state - first the simple way... ! new_state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND) ! if new_state & win32con.MF_CHECKED != check_flags: ! raise RuntimeError("The new item didn't get the new checked state!") ! # Now the long-winded way via GetMenuItemInfo... buf, extras = EmptyMENUITEMINFO() win32gui.GetMenuItemInfo(self.sub_menu, id, False, buf) |
From: Mark H. <mha...@us...> - 2008-12-04 07:07:11
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3167/com/win32comext/mapi Modified Files: mapiutil.py Log Message: move to dict iterators and modern type checking Index: mapiutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/mapiutil.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mapiutil.py 27 Nov 2008 03:53:25 -0000 1.8 --- mapiutil.py 4 Dec 2008 07:07:04 -0000 1.9 *************** *** 4,9 **** ListType=list IntType=int ! StringType=str ! from pywintypes import UnicodeType, TimeType import pythoncom import mapi, mapitags --- 4,8 ---- ListType=list IntType=int ! from pywintypes import TimeType import pythoncom import mapi, mapitags *************** *** 12,16 **** def GetPropTagName(pt): if not prTable: ! for name, value in mapitags.__dict__.items(): if name[:3] == 'PR_': # Store both the full ID (including type) and just the ID. --- 11,15 ---- def GetPropTagName(pt): if not prTable: ! for name, value in mapitags.__dict__.iteritems(): if name[:3] == 'PR_': # Store both the full ID (including type) and just the ID. *************** *** 38,42 **** def GetScodeString(hr): if not mapiErrorTable: ! for name, value in mapi.__dict__.items(): if name[:7] in ['MAPI_E_', 'MAPI_W_']: mapiErrorTable[value] = name --- 37,41 ---- def GetScodeString(hr): if not mapiErrorTable: ! for name, value in mapi.__dict__.iteritems(): if name[:7] in ['MAPI_E_', 'MAPI_W_']: mapiErrorTable[value] = name *************** *** 48,52 **** """Given a mapi type flag, return a string description of the type""" if not ptTable: ! for name, value in mapitags.__dict__.items(): if name[:3] == 'PT_': ptTable[value] = name --- 47,51 ---- """Given a mapi type flag, return a string description of the type""" if not ptTable: ! for name, value in mapitags.__dict__.iteritems(): if name[:3] == 'PT_': ptTable[value] = name *************** *** 142,147 **** newProps = [] # First pass over the properties we should get IDs for. ! for key, val in propDict.items(): ! if type(key) in [StringType, UnicodeType]: newProps.append((mapi.PS_PUBLIC_STRINGS, key)) # Query for the new IDs --- 141,146 ---- newProps = [] # First pass over the properties we should get IDs for. ! for key, val in propDict.iteritems(): ! if type(key) in [str, unicode]: newProps.append((mapi.PS_PUBLIC_STRINGS, key)) # Query for the new IDs *************** *** 149,156 **** newIdNo = 0 newProps = [] ! for key, val in propDict.items(): ! if type(key) in [StringType, UnicodeType]: type_val=type(val) ! if type_val in [StringType, pywintypes.UnicodeType]: tagType = mapitags.PT_UNICODE elif type_val==IntType: --- 148,155 ---- newIdNo = 0 newProps = [] ! for key, val in propDict.iteritems(): ! if type(key) in [str, unicode]: type_val=type(val) ! if type_val in [str, unicode]: tagType = mapitags.PT_UNICODE elif type_val==IntType: |
From: Mark H. <mha...@us...> - 2008-12-04 07:05:49
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3054/com/win32comext/axdebug Modified Files: expressions.py Log Message: py3k friendly; don't check for 'has_key' to see if dictlike Index: expressions.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/expressions.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** expressions.py 18 Jun 2006 13:18:26 -0000 1.5 --- expressions.py 4 Dec 2008 07:05:45 -0000 1.6 *************** *** 70,78 **** def MakeEnumDebugProperty(object, dwFieldSpec, nRadix, iid, stackFrame = None): name_vals = [] ! if hasattr(object, "has_key"): # If it is a dict. ! name_vals = object.items() dictionary = object elif hasattr(object, "__dict__"): #object with dictionary, module ! name_vals = object.__dict__.items() dictionary = object.__dict__ infos = [] --- 70,78 ---- def MakeEnumDebugProperty(object, dwFieldSpec, nRadix, iid, stackFrame = None): name_vals = [] ! if hasattr(object, "items") and hasattr(object, "keys"): # If it is a dict. ! name_vals = object.iteritems() dictionary = object elif hasattr(object, "__dict__"): #object with dictionary, module ! name_vals = object.__dict__.iteritems() dictionary = object.__dict__ infos = [] |
From: Mark H. <mha...@us...> - 2008-12-04 07:05:00
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2952/com/win32comext/adsi/demos Modified Files: scp.py Log Message: correct assertion our param isn't a string Index: scp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/demos/scp.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scp.py 31 May 2005 12:44:34 -0000 1.3 --- scp.py 4 Dec 2008 07:04:56 -0000 1.4 *************** *** 43,47 **** import optparse, textwrap import traceback - import types verbose = 1 --- 43,46 ---- *************** *** 198,202 **** operation, # Add, replace, or delete SPNs ): ! assert spns not in types.StringTypes and hasattr(spns, "__iter__"), \ "spns must be a sequence of strings (got %r)" % spns # Bind to a domain controller. --- 197,201 ---- operation, # Add, replace, or delete SPNs ): ! assert type(spns) not in [str, unicode] and hasattr(spns, "__iter__"), \ "spns must be a sequence of strings (got %r)" % spns # Bind to a domain controller. |
From: Mark H. <mha...@us...> - 2008-12-04 07:03:44
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2796/com/win32com/client Modified Files: genpy.py Log Message: fix recent regression; correct check for _enum_ in self.__dict__ Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** genpy.py 4 Dec 2008 05:22:38 -0000 1.62 --- genpy.py 4 Dec 2008 07:03:39 -0000 1.63 *************** *** 513,517 **** print >> stream, '\tdef __getitem__(self, index):' print >> stream, '\t\t"Allow this class to be accessed as a collection"' ! print >> stream, "\t\tif '_enum' not in self.__dict__:" print >> stream, "\t\t\tself.__dict__['_enum_'] = self._NewEnum()" print >> stream, "\t\treturn self._enum_.__getitem__(index)" --- 513,517 ---- print >> stream, '\tdef __getitem__(self, index):' print >> stream, '\t\t"Allow this class to be accessed as a collection"' ! print >> stream, "\t\tif '_enum_' not in self.__dict__:" print >> stream, "\t\t\tself.__dict__['_enum_'] = self._NewEnum()" print >> stream, "\t\treturn self._enum_.__getitem__(index)" |
From: Mark H. <mha...@us...> - 2008-12-04 07:03:00
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2716/Pythonwin/pywin/scintilla Modified Files: config.py keycodes.py Log Message: modernize syntax: use list comps instead of map/lambda Index: config.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/config.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** config.py 27 Nov 2008 03:53:25 -0000 1.7 --- config.py 4 Dec 2008 07:02:55 -0000 1.8 *************** *** 59,63 **** def find_config_files(): ! return map( lambda x: os.path.split(x)[1], map( lambda x: os.path.splitext(x)[0], glob.glob(os.path.join(pywin.__path__[0], "*.cfg")))) class ConfigManager: --- 59,65 ---- def find_config_files(): ! return [os.path.split(x)[1] ! for x in [os.path.splitext(x)[0] for x in glob.glob(os.path.join(pywin.__path__[0], "*.cfg"))] ! ] class ConfigManager: Index: keycodes.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/keycodes.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** keycodes.py 27 Nov 2008 03:53:25 -0000 1.6 --- keycodes.py 4 Dec 2008 07:02:55 -0000 1.7 *************** *** 31,35 **** def _fillmap(): # Pull the VK_names from win32con ! names = filter(lambda entry: entry[:3]=="VK_", win32con.__dict__.keys()) for name in names: n = name[3:].lower() --- 31,35 ---- def _fillmap(): # Pull the VK_names from win32con ! names = [entry for entry in win32con.__dict__ if entry.startswith("VK_")] for name in names: n = name[3:].lower() |
From: Mark H. <mha...@us...> - 2008-12-04 07:01:11
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2512/win32/Demos Modified Files: cerapi.py Log Message: remove unused imports Index: cerapi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/cerapi.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cerapi.py 3 Feb 2003 00:30:29 -0000 1.2 --- cerapi.py 4 Dec 2008 07:01:06 -0000 1.3 *************** *** 10,14 **** import sys import getopt - from repr import repr --- 10,13 ---- |
From: Mark H. <mha...@us...> - 2008-12-04 07:01:11
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2512/com/win32comext/axdebug Modified Files: stackframe.py Log Message: remove unused imports Index: stackframe.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/stackframe.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stackframe.py 18 Jun 2006 13:18:26 -0000 1.4 --- stackframe.py 4 Dec 2008 07:01:06 -0000 1.5 *************** *** 8,12 **** import pythoncom from win32com.server.exception import COMException - import repr, string from util import trace --- 8,11 ---- |
From: Mark H. <mha...@us...> - 2008-12-04 07:00:28
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2444/Pythonwin/pywin/mfc Modified Files: dialog.py Log Message: tweaks to locals named 'thread', 'window' or 'dialog' to be 2to3-friendly Index: dialog.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/dialog.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dialog.py 27 Nov 2008 09:42:41 -0000 1.8 --- dialog.py 4 Dec 2008 07:00:21 -0000 1.9 *************** *** 221,228 **** # uses a simple dialog to return a string object. if title is None: title=win32ui.GetMainFrame().GetWindowText() ! class DlgSimpleInput(Dialog): def __init__(self, prompt, defValue, title ): self.title=title ! Dialog.__init__(self, win32ui.IDD_SIMPLE_INPUT) self.AddDDX(win32ui.IDC_EDIT1,'result') self.AddDDX(win32ui.IDC_PROMPT1, 'prompt') --- 221,230 ---- # uses a simple dialog to return a string object. if title is None: title=win32ui.GetMainFrame().GetWindowText() ! # 2to3 insists on converting 'Dialog.__init__' to 'tkinter.dialog...' ! DlgBaseClass = Dialog ! class DlgSimpleInput(DlgBaseClass): def __init__(self, prompt, defValue, title ): self.title=title ! DlgBaseClass.__init__(self, win32ui.IDD_SIMPLE_INPUT) self.AddDDX(win32ui.IDC_EDIT1,'result') self.AddDDX(win32ui.IDC_PROMPT1, 'prompt') *************** *** 231,235 **** def OnInitDialog(self): self.SetWindowText(self.title) ! return Dialog.OnInitDialog(self) dlg=DlgSimpleInput( prompt, defValue, title) --- 233,237 ---- def OnInitDialog(self): self.SetWindowText(self.title) ! return DlgBaseClass.OnInitDialog(self) dlg=DlgSimpleInput( prompt, defValue, title) |
From: Mark H. <mha...@us...> - 2008-12-04 07:00:27
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2444/Pythonwin/pywin/Demos Modified Files: threadedgui.py Log Message: tweaks to locals named 'thread', 'window' or 'dialog' to be 2to3-friendly Index: threadedgui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/threadedgui.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** threadedgui.py 2 Oct 2008 11:13:28 -0000 1.4 --- threadedgui.py 4 Dec 2008 07:00:21 -0000 1.5 *************** *** 9,12 **** --- 9,13 ---- from pywin.mfc import window, docview, thread + from pywin.mfc.thread import WinThread *************** *** 104,112 **** ! class TestThread(thread.WinThread): def __init__(self, parentWindow): self.parentWindow = parentWindow self.child = None ! thread.WinThread.__init__(self) def InitInstance(self): rect = self.parentWindow.GetClientRect() --- 105,113 ---- ! class TestThread(WinThread): def __init__(self, parentWindow): self.parentWindow = parentWindow self.child = None ! WinThread.__init__(self) def InitInstance(self): rect = self.parentWindow.GetClientRect() *************** *** 116,120 **** self.child.Create("FontDemo", win32con.WS_CHILD | win32con.WS_VISIBLE, rect, self.parentWindow) self.SetMainFrame(self.child) ! return thread.WinThread.InitInstance(self) def ExitInstance(self): --- 117,121 ---- self.child.Create("FontDemo", win32con.WS_CHILD | win32con.WS_VISIBLE, rect, self.parentWindow) self.SetMainFrame(self.child) ! return WinThread.InitInstance(self) def ExitInstance(self): |
From: Mark H. <mha...@us...> - 2008-12-04 07:00:27
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2444/win32/test Modified Files: test_win32trace.py Log Message: tweaks to locals named 'thread', 'window' or 'dialog' to be 2to3-friendly Index: test_win32trace.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32trace.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_win32trace.py 26 Nov 2008 08:56:33 -0000 1.6 --- test_win32trace.py 4 Dec 2008 07:00:21 -0000 1.7 *************** *** 309,318 **** threads = [WriterThread() for each in range(threadCount)] win32trace.InitWrite() ! for thread in threads: ! thread.start() ! for thread in threads: ! thread.join() ! for thread in threads: ! if not thread.verifyWritten(): sys.exit(-1) --- 309,318 ---- threads = [WriterThread() for each in range(threadCount)] win32trace.InitWrite() ! for t in threads: ! t.start() ! for t in threads: ! t.join() ! for t in threads: ! if not t.verifyWritten(): sys.exit(-1) |
From: Mark H. <mha...@us...> - 2008-12-04 06:56:47
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2209 Modified Files: pywin32_postinstall.py Log Message: let 2to3 handle module name differences Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** pywin32_postinstall.py 26 Nov 2008 08:39:32 -0000 1.28 --- pywin32_postinstall.py 4 Dec 2008 06:56:36 -0000 1.29 *************** *** 4,11 **** # and creates a pth file import os, sys, glob, shutil, time ! try: ! import _winreg as winreg ! except ImportError: ! import winreg # Send output somewhere so it can be found if necessary... --- 4,8 ---- # and creates a pth file import os, sys, glob, shutil, time ! import _winreg as winreg # Send output somewhere so it can be found if necessary... |
From: Mark H. <mha...@us...> - 2008-12-04 06:56:40
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2209/Pythonwin/pywin/framework Modified Files: scriptutils.py Log Message: let 2to3 handle module name differences Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** scriptutils.py 14 Nov 2008 00:22:25 -0000 1.20 --- scriptutils.py 4 Dec 2008 06:56:36 -0000 1.21 *************** *** 454,461 **** def RunTabNanny(filename): ! try: ! import cStringIO as io ! except ImportError: ! import io tabnanny = FindTabNanny() if tabnanny is None: --- 454,458 ---- def RunTabNanny(filename): ! import cStringIO as io tabnanny = FindTabNanny() if tabnanny is None: |
From: Mark H. <mha...@us...> - 2008-12-04 06:56:40
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2209/com/win32com/client Modified Files: gencache.py Log Message: let 2to3 handle module name differences Index: gencache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** gencache.py 14 Nov 2008 00:22:25 -0000 1.33 --- gencache.py 4 Dec 2008 06:56:36 -0000 1.34 *************** *** 49,56 **** demandGeneratedTypeLibraries = {} ! try: ! import cPickle as pickle ! except ImportError: ! import pickle def __init__(): --- 49,53 ---- demandGeneratedTypeLibraries = {} ! import cPickle as pickle def __init__(): *************** *** 77,84 **** # Load the dictionary from a .zip file if that is where we live. if hasattr(win32com, "__loader__"): ! try: ! import cStringIO as io ! except ImportError: ! import io loader = win32com.__loader__ arc_path = loader.archive --- 74,78 ---- # Load the dictionary from a .zip file if that is where we live. if hasattr(win32com, "__loader__"): ! import cStringIO as io loader = win32com.__loader__ arc_path = loader.archive |
From: Mark H. <mha...@us...> - 2008-12-04 06:56:40
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2209/com/win32com/test Modified Files: util.py Log Message: let 2to3 handle module name differences Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** util.py 4 Dec 2008 05:23:49 -0000 1.14 --- util.py 4 Dec 2008 06:56:36 -0000 1.15 *************** *** 9,19 **** import win32com import logging ! try: # try py2x imports first ! import _winreg ! import cStringIO as StringIO ! except ImportError: ! # py3k imports ! import winreg as _winreg ! import io as StringIO def CheckClean(): --- 9,14 ---- import win32com import logging ! import _winreg ! import cStringIO as StringIO def CheckClean(): |
From: Mark H. <mha...@us...> - 2008-12-04 05:23:53
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29642/com/win32com/test Modified Files: util.py Log Message: use py3k-friendly imports Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** util.py 26 Nov 2008 08:52:32 -0000 1.13 --- util.py 4 Dec 2008 05:23:49 -0000 1.14 *************** *** 1,4 **** import sys, os - import _winreg import win32api import tempfile --- 1,3 ---- *************** *** 7,14 **** import pythoncom import winerror - import cStringIO as StringIO from pythoncom import _GetInterfaceCount, _GetGatewayCount import win32com import logging def CheckClean(): --- 6,19 ---- import pythoncom import winerror from pythoncom import _GetInterfaceCount, _GetGatewayCount import win32com import logging + try: # try py2x imports first + import _winreg + import cStringIO as StringIO + except ImportError: + # py3k imports + import winreg as _winreg + import io as StringIO def CheckClean(): |
From: Mark H. <mha...@us...> - 2008-12-04 05:23:20
|
Update of /cvsroot/pywin32/pywin32/com/win32com/servers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29578/com/win32com/servers Modified Files: dictionary.py Log Message: make string check py3k-friendly and same as interp.py Index: dictionary.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/dictionary.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dictionary.py 4 Dec 2008 03:18:32 -0000 1.5 --- dictionary.py 4 Dec 2008 05:23:15 -0000 1.6 *************** *** 74,82 **** key = args[0] ! if type(key) == unicode: ! pass ! elif type(key) == str: ! key = unicode(key) ! else: ### the nArgErr thing should be 0-based, not reversed... sigh raise COMException(desc="Key must be a string", scode=winerror.DISP_E_TYPEMISMATCH) --- 74,78 ---- key = args[0] ! if type(exp) not in [str, unicode]: ### the nArgErr thing should be 0-based, not reversed... sigh raise COMException(desc="Key must be a string", scode=winerror.DISP_E_TYPEMISMATCH) |
From: Mark H. <mha...@us...> - 2008-12-04 05:22:43
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29519/com/win32com/client Modified Files: genpy.py Log Message: s/not x in y/x not in y/ in generated code Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** genpy.py 4 Dec 2008 03:18:32 -0000 1.61 --- genpy.py 4 Dec 2008 05:22:38 -0000 1.62 *************** *** 513,517 **** print >> stream, '\tdef __getitem__(self, index):' print >> stream, '\t\t"Allow this class to be accessed as a collection"' ! print >> stream, "\t\tif not '_enum' in self.__dict__:" print >> stream, "\t\t\tself.__dict__['_enum_'] = self._NewEnum()" print >> stream, "\t\treturn self._enum_.__getitem__(index)" --- 513,517 ---- print >> stream, '\tdef __getitem__(self, index):' print >> stream, '\t\t"Allow this class to be accessed as a collection"' ! print >> stream, "\t\tif '_enum' not in self.__dict__:" print >> stream, "\t\t\tself.__dict__['_enum_'] = self._NewEnum()" print >> stream, "\t\treturn self._enum_.__getitem__(index)" |