pywin32-checkins Mailing List for Python for Windows Extensions (Page 37)
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-11 05:45:26
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29773 Modified Files: Tag: py3k CHANGES.txt Log Message: merge more .py changes from the trunk (via 2to3) Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.26.2.6 retrieving revision 1.26.2.7 diff -C2 -d -r1.26.2.6 -r1.26.2.7 *** CHANGES.txt 11 Dec 2008 04:13:35 -0000 1.26.2.6 --- CHANGES.txt 11 Dec 2008 05:45:21 -0000 1.26.2.7 *************** *** 22,26 **** * Pythonwin updates from Rémi Paucher; enter completes auto-complete in the editor and interactive windows, auto-complete should now work on French ! keyboards. * Lots of work to better support unicode, py3k and 64bits from Roger. --- 22,26 ---- * Pythonwin updates from Rémi Paucher; enter completes auto-complete in the editor and interactive windows, auto-complete should now work on French ! keyboards. (XXX - some of this was reverted - update!) * Lots of work to better support unicode, py3k and 64bits from Roger. |
From: Mark H. <mha...@us...> - 2008-12-11 05:45:26
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29773/com/win32com/client Modified Files: Tag: py3k gencache.py Log Message: merge more .py changes from the trunk (via 2to3) Index: gencache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v retrieving revision 1.32.2.5 retrieving revision 1.32.2.6 diff -C2 -d -r1.32.2.5 -r1.32.2.6 *** gencache.py 9 Dec 2008 13:10:15 -0000 1.32.2.5 --- gencache.py 11 Dec 2008 05:45:21 -0000 1.32.2.6 *************** *** 74,81 **** # 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 io as io loader = win32com.__loader__ arc_path = loader.archive |
From: Mark H. <mha...@us...> - 2008-12-11 05:45:26
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29773/Pythonwin/pywin/scintilla Modified Files: Tag: py3k bindings.py Log Message: merge more .py changes from the trunk (via 2to3) Index: bindings.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/bindings.py,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** bindings.py 6 Dec 2008 01:48:26 -0000 1.5.2.3 --- bindings.py 11 Dec 2008 05:45:21 -0000 1.5.2.4 *************** *** 169,177 **** # (XXX - which do not work :-( event = self.keymap.get( keyinfo ) - #Enable autoexpand an autocompletion on French keyborads - if keyinfo == (190, 16): - event = "KeyDot" - elif keyinfo == (222, 0): - event = "<<expand-word>>" if event is None: ## if key == 220: # Dead key --- 169,172 ---- |
From: Mark H. <mha...@us...> - 2008-12-11 05:45:26
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29773/Pythonwin/pywin/framework/editor/color Modified Files: Tag: py3k coloreditor.py Log Message: merge more .py changes from the trunk (via 2to3) Index: coloreditor.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color/coloreditor.py,v retrieving revision 1.13.2.2 retrieving revision 1.13.2.3 diff -C2 -d -r1.13.2.2 -r1.13.2.3 *** coloreditor.py 2 Sep 2008 20:41:37 -0000 1.13.2.2 --- coloreditor.py 11 Dec 2008 05:45:21 -0000 1.13.2.3 *************** *** 335,338 **** --- 335,339 ---- # Handle auto-complete first. if self.SCIAutoCActive(): + self.SCIAutoCComplete() self.SCIAutoCCancel() # Call the IDLE event. |
From: Mark H. <mha...@us...> - 2008-12-11 05:45:26
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29773/Pythonwin/pywin/framework Modified Files: Tag: py3k interact.py Log Message: merge more .py changes from the trunk (via 2to3) Index: interact.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/interact.py,v retrieving revision 1.17.2.3 retrieving revision 1.17.2.4 diff -C2 -d -r1.17.2.3 -r1.17.2.4 *** interact.py 6 Dec 2008 01:48:26 -0000 1.17.2.3 --- interact.py 11 Dec 2008 05:45:21 -0000 1.17.2.4 *************** *** 547,551 **** win32clipboard.OpenClipboard() try: ! win32clipboard.SetClipboardData(win32clipboard.CF_UNICODETEXT, out_code) finally: win32clipboard.CloseClipboard() --- 547,551 ---- win32clipboard.OpenClipboard() try: ! win32clipboard.SetClipboardData(win32clipboard.CF_UNICODETEXT, str(out_code)) finally: win32clipboard.CloseClipboard() |
From: Mark H. <mha...@us...> - 2008-12-11 05:13:14
|
Update of /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28610/win32/scripts/VersionStamp Modified Files: bulkstamp.py Log Message: Move to exception attributes Index: bulkstamp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/VersionStamp/bulkstamp.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** bulkstamp.py 4 Dec 2008 03:38:20 -0000 1.9 --- bulkstamp.py 11 Dec 2008 05:13:07 -0000 1.10 *************** *** 64,69 **** 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 --- 64,69 ---- verstamp.stamp(vars, pathname, desc, is_dll=is_dll) numStamped = numStamped + 1 ! except win32api.error, exc: ! print "Could not stamp", pathname, "Error", exc.winerror, "-", exc.strerror else: print 'WARNING: description not provided for:', name |
From: Mark H. <mha...@us...> - 2008-12-11 05:13:14
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28610/win32/Lib Modified Files: win32evtlogutil.py win32serviceutil.py Log Message: Move to exception attributes Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** win32serviceutil.py 27 Nov 2008 05:58:17 -0000 1.30 --- win32serviceutil.py 11 Dec 2008 05:13:07 -0000 1.31 *************** *** 354,360 **** 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) --- 354,360 ---- try: status = win32service.ControlService(hs, win32service.SERVICE_CONTROL_STOP) ! except pywintypes.error, exc: ! if exc.winerror!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise for i in range(waitSecs): status = win32service.QueryServiceStatus(hs) *************** *** 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): --- 407,414 ---- try: StopService(serviceName, machine) ! except pywintypes.error, exc: # Allow only "service not running" error ! if exc.winerror!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise # Give it a few goes, as the service may take time to stop for i in range(waitSeconds): *************** *** 416,421 **** StartService(serviceName, args, machine) break ! except pywintypes.error, (hr, name, msg): ! if hr!=winerror.ERROR_SERVICE_ALREADY_RUNNING: raise win32api.Sleep(1000) --- 416,421 ---- StartService(serviceName, args, machine) break ! except pywintypes.error, exc: ! if exc.winerror!=winerror.ERROR_SERVICE_ALREADY_RUNNING: raise win32api.Sleep(1000) *************** *** 573,578 **** if waitSecs: WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) ! except win32service.error, (hr, fn, msg): ! print "Error starting service: %s" % msg elif arg=="restart": --- 573,578 ---- if waitSecs: WaitForServiceStatus(serviceName, win32service.SERVICE_RUNNING, waitSecs) ! except win32service.error, exc: ! print "Error starting service: %s" % exc.strerror elif arg=="restart": *************** *** 639,647 **** 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. --- 639,647 ---- customOptionHandler(*(opts,)) print "Service installed" ! except win32service.error, exc: ! if exc.winerror==winerror.ERROR_SERVICE_EXISTS: arg = "update" # Fall through to the "update" param! else: ! print "Error installing service: %s (%d)" % (exc.strerror, exc.winerror) err = hr except ValueError, msg: # Can be raised by custom option handler. *************** *** 682,687 **** customOptionHandler(*(opts,)) print "Service updated" ! except win32service.error, (hr, fn, msg): ! print "Error changing service configuration: %s (%d)" % (msg,hr) err = hr --- 682,687 ---- customOptionHandler(*(opts,)) print "Service updated" ! except win32service.error, exc: ! print "Error changing service configuration: %s (%d)" % (exc.strerror,exc.winerror) err = hr *************** *** 692,697 **** RemoveService(serviceName) print "Service removed" ! except win32service.error, (hr, fn, msg): ! print "Error removing service: %s (%d)" % (msg,hr) err = hr elif arg=="stop": --- 692,697 ---- RemoveService(serviceName) print "Service removed" ! except win32service.error, exc: ! print "Error removing service: %s (%d)" % (exc.strerror,exc.winerror) err = hr elif arg=="stop": *************** *** 703,708 **** else: StopService(serviceName) ! except win32service.error, (hr, fn, msg): ! print "Error stopping service: %s (%d)" % (msg,hr) err = hr if not knownArg: --- 703,708 ---- else: StopService(serviceName) ! except win32service.error, exc: ! print "Error stopping service: %s (%d)" % (exc.strerror,exc.winerror) err = hr if not knownArg: Index: win32evtlogutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32evtlogutil.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32evtlogutil.py 27 Nov 2008 05:58:17 -0000 1.11 --- win32evtlogutil.py 11 Dec 2008 05:13:07 -0000 1.12 *************** *** 60,65 **** 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, exc: ! if exc.winerror != winerror.ERROR_FILE_NOT_FOUND: raise |
From: Mark H. <mha...@us...> - 2008-12-11 05:13:11
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28610/win32/test Modified Files: test_exceptions.py Log Message: Move to exception attributes Index: test_exceptions.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_exceptions.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_exceptions.py 7 Oct 2008 11:28:10 -0000 1.5 --- test_exceptions.py 11 Dec 2008 05:13:07 -0000 1.6 *************** *** 42,50 **** win32api.CloseHandle(1) self.fail("expected exception!") ! except win32api.error, (werror, func, msg): ! self.failUnlessEqual(werror, winerror.ERROR_INVALID_HANDLE) ! self.failUnlessEqual(func, "CloseHandle") expected_msg = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() ! self.failUnlessEqual(msg, expected_msg) def testAsStr(self): --- 42,50 ---- win32api.CloseHandle(1) self.fail("expected exception!") ! except win32api.error, exc: ! self.failUnlessEqual(exc.winerror, winerror.ERROR_INVALID_HANDLE) ! self.failUnlessEqual(exc.funcname, "CloseHandle") expected_msg = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() ! self.failUnlessEqual(exc.strerror, expected_msg) def testAsStr(self): |
From: Mark H. <mha...@us...> - 2008-12-11 05:12:45
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28578/win32/test Modified Files: test_win32wnet.py Log Message: int attributes always exactly int, and fix string checks Index: test_win32wnet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32wnet.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_win32wnet.py 10 Dec 2008 11:13:51 -0000 1.2 --- test_win32wnet.py 11 Dec 2008 05:12:39 -0000 1.3 *************** *** 57,61 **** val = getattr(item, attr) if typ is int: ! self.failUnless(type(val) in (int, int), "Attr %r has value %r" % (attr, val)) new_val = val + 1 --- 57,61 ---- val = getattr(item, attr) if typ is int: ! self.failUnless(type(val) in (int,), "Attr %r has value %r" % (attr, val)) new_val = val + 1 *************** *** 63,67 **** if val is not None: # on py2k, must be string or unicode. py3k must be string or bytes. ! self.failUnless(type(val) in (str, str), "Attr %r has value %r" % (attr, val)) new_val = val + " new value" --- 63,67 ---- if val is not None: # on py2k, must be string or unicode. py3k must be string or bytes. ! self.failUnless(type(val) in (str, unicode), "Attr %r has value %r" % (attr, val)) new_val = val + " new value" |
From: Mark H. <mha...@us...> - 2008-12-11 05:12:01
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28532/win32/test Modified Files: test_win32file.py Log Message: Avoid local variable called 'thread' to be 2to3 friendly Index: test_win32file.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32file.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_win32file.py 11 Dec 2008 00:23:48 -0000 1.18 --- test_win32file.py 11 Dec 2008 05:11:57 -0000 1.19 *************** *** 230,237 **** win32file.CreateIoCompletionPort(handle, port, 1, 0) ! thread = threading.Thread(target=self._IOCPServerThread, args=(handle,port, test_overlapped_death)) # hrmph - markh is seeing failures here on x64 - and a hang! ! thread.setDaemon(True) # avoid hanging entire test suite on failure. ! thread.start() try: time.sleep(0.1) # let thread do its thing. --- 230,237 ---- win32file.CreateIoCompletionPort(handle, port, 1, 0) ! t = threading.Thread(target=self._IOCPServerThread, args=(handle,port, test_overlapped_death)) # hrmph - markh is seeing failures here on x64 - and a hang! ! t.setDaemon(True) # avoid hanging entire test suite on failure. ! t.start() try: time.sleep(0.1) # let thread do its thing. *************** *** 244,249 **** finally: handle.Close() ! thread.join(3) ! self.failIf(thread.isAlive(), "thread didn't finish") def testCompletionPortsNonQueuedBadReference(self): --- 244,249 ---- finally: handle.Close() ! t.join(3) ! self.failIf(t.isAlive(), "thread didn't finish") def testCompletionPortsNonQueuedBadReference(self): *************** *** 405,410 **** flags) print "got", changes ! except 'xx': ! xx changes.extend(changes) --- 405,410 ---- flags) print "got", changes ! except: ! raise changes.extend(changes) |
From: Mark H. <mha...@us...> - 2008-12-11 05:10:23
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28498/win32/src Modified Files: win32profilemodule.cpp Log Message: Update to PYWIN_MODULE_* macros Index: win32profilemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32profilemodule.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32profilemodule.cpp 15 Aug 2007 08:04:37 -0000 1.3 --- win32profilemodule.cpp 11 Dec 2008 05:10:18 -0000 1.4 *************** *** 463,478 **** ! ! extern "C" __declspec(dllexport) void ! initwin32profile(void) { ! PyObject *dict, *module; ! PyWinGlobals_Ensure(); ! module = Py_InitModule("win32profile", win32profile_functions); ! if (module==NULL) ! return; ! dict = PyModule_GetDict(module); ! if (dict==NULL) ! return; // PROFILEINFO flags --- 463,470 ---- ! PYWIN_MODULE_INIT_FUNC(win32profile) { ! PYWIN_MODULE_INIT_PREPARE(win32profile, win32profile_functions, ! "Interface to the User Profile Api."); // PROFILEINFO flags *************** *** 488,492 **** hmodule=GetModuleHandle(L"Userenv.dll"); if (hmodule==NULL) ! hmodule = LoadLibrary(L"Userenv.dll"); if (hmodule!=NULL){ pfnDeleteProfile=(DeleteProfilefunc)GetProcAddress(hmodule,"DeleteProfileW"); --- 480,484 ---- hmodule=GetModuleHandle(L"Userenv.dll"); if (hmodule==NULL) ! hmodule = LoadLibrary(L"Userenv.dll"); if (hmodule!=NULL){ pfnDeleteProfile=(DeleteProfilefunc)GetProcAddress(hmodule,"DeleteProfileW"); *************** *** 500,503 **** pfnUnloadUserProfile=(UnloadUserProfilefunc)GetProcAddress(hmodule,"UnloadUserProfile"); } ! } ! --- 492,496 ---- pfnUnloadUserProfile=(UnloadUserProfilefunc)GetProcAddress(hmodule,"UnloadUserProfile"); } ! PYWIN_MODULE_INIT_RETURN_SUCCESS; ! } ! |
From: Mark H. <mha...@us...> - 2008-12-11 05:09:56
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28441/win32/src Modified Files: win32gui.i Log Message: Fix error using IsBadStringPtr() in UNICODE builds. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** win32gui.i 11 Dec 2008 00:25:40 -0000 1.121 --- win32gui.i 11 Dec 2008 05:09:51 -0000 1.122 *************** *** 1611,1615 **** } // This should probably be in a __try just in case. ! if (IsBadStringPtr(addr, (DWORD_PTR)-1)) { PyErr_SetString(PyExc_ValueError, "The value is not a valid null-terminated string"); return NULL; --- 1611,1615 ---- } // This should probably be in a __try just in case. ! if (IsBadStringPtrA(addr, (DWORD_PTR)-1)) { PyErr_SetString(PyExc_ValueError, "The value is not a valid null-terminated string"); return NULL; |
From: Mark H. <mha...@us...> - 2008-12-11 05:09:07
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28413/win32/src Modified Files: win32apimodule.cpp Log Message: add win32api.GetKeyboardLayout() Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** win32apimodule.cpp 11 Dec 2008 00:25:40 -0000 1.93 --- win32apimodule.cpp 11 Dec 2008 05:09:00 -0000 1.94 *************** *** 5838,5841 **** --- 5838,5853 ---- } + // @pymethod int|win32api|GetKeyboardLayout|retrieves the active input locale identifier (formerly called the keyboard layout) for the specified thread. + // @comm If the idThread parameter is zero, the input locale identifier for the active thread is returned. + PyObject *PyGetKeyboardLayout(PyObject *self, PyObject *args) + { + int tid = 0; + // @pyparm int|threadId|0| + if (!PyArg_ParseTuple(args,"|i:GetKeyboardLayout", &tid)) + return NULL; + HKL hkl = ::GetKeyboardLayout((DWORD)tid); + return PyWinLong_FromVoidPtr(hkl); + } + // @pymethod (int,..)|win32api|GetKeyboardLayoutList|Returns a sequence of all locale ids currently loaded PyObject *PyGetKeyboardLayoutList(PyObject *self, PyObject *args) *************** *** 5852,5856 **** buflen=GetKeyboardLayoutList(buflen, buf); if (buflen==0) ! PyWin_SetAPIError("GetKeyboardLayout"); else{ ret=PyTuple_New(buflen); --- 5864,5868 ---- buflen=GetKeyboardLayoutList(buflen, buf); if (buflen==0) ! PyWin_SetAPIError("GetKeyboardLayoutList"); else{ ret=PyTuple_New(buflen); *************** *** 6036,6039 **** --- 6048,6052 ---- {"GetFullPathName", PyGetFullPathName,1}, // @pymeth GetFullPathName|Returns the full path of a (possibly relative) path {"GetHandleInformation", PyGetHandleInformation,1}, // @pymeth GetHandleInformation|Retrieves a handle's flags. + {"GetKeyboardLayout", PyGetKeyboardLayout, 1}, // @pymeth GetKeyboardLayout|Retrieves the active input locale identifier {"GetKeyboardLayoutList", PyGetKeyboardLayoutList, 1}, // @pymeth GetKeyboardLayoutList|Returns a sequence of all locale ids in the system {"GetKeyboardState", PyGetKeyboardState, 1}, // @pymeth GetKeyboardState|Retrieves the status of the 256 virtual keys on the keyboard. |
From: Mark H. <mha...@us...> - 2008-12-11 05:09:06
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28413 Modified Files: CHANGES.txt Log Message: add win32api.GetKeyboardLayout() Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** CHANGES.txt 11 Dec 2008 05:02:54 -0000 1.37 --- CHANGES.txt 11 Dec 2008 05:09:00 -0000 1.38 *************** *** 63,67 **** * win32com.shell gets support for IContextMenu2 and IContextMenu3 ! * add win32api.GetNativeSystemInfo() Since build 211: --- 63,67 ---- * win32com.shell gets support for IContextMenu2 and IContextMenu3 ! * add win32api.GetNativeSystemInfo(), win32api.GetKeyboardLayout() Since build 211: |
From: Mark H. <mha...@us...> - 2008-12-11 05:03:00
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27956/pythonwin/pywin/scintilla Modified Files: bindings.py Log Message: revert some of the French keyboard changes due to conflicts with US keyboard Index: bindings.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/bindings.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** bindings.py 4 Dec 2008 12:45:51 -0000 1.7 --- bindings.py 11 Dec 2008 05:02:54 -0000 1.8 *************** *** 172,180 **** # (XXX - which do not work :-( event = self.keymap.get( keyinfo ) - #Enable autoexpand an autocompletion on French keyborads - if keyinfo == (190, 16): - event = "KeyDot" - elif keyinfo == (222, 0): - event = "<<expand-word>>" if event is None: ## if key == 220: # Dead key --- 172,175 ---- |
From: Mark H. <mha...@us...> - 2008-12-11 05:03:00
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27956 Modified Files: CHANGES.txt Log Message: revert some of the French keyboard changes due to conflicts with US keyboard Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** CHANGES.txt 10 Dec 2008 11:13:51 -0000 1.36 --- CHANGES.txt 11 Dec 2008 05:02:54 -0000 1.37 *************** *** 22,26 **** * Pythonwin updates from Rémi Paucher; enter completes auto-complete in the editor and interactive windows, auto-complete should now work on French ! keyboards. * Lots of work to better support unicode, py3k and 64bits from Roger. --- 22,26 ---- * Pythonwin updates from Rémi Paucher; enter completes auto-complete in the editor and interactive windows, auto-complete should now work on French ! keyboards. (XXX - some of this was reverted - update!) * Lots of work to better support unicode, py3k and 64bits from Roger. |
From: Mark H. <mha...@us...> - 2008-12-11 04:24:30
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26596 Modified Files: Tag: py3k testall.py Log Message: use subprocess if available Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/testall.py,v retrieving revision 1.6.2.3 retrieving revision 1.6.2.4 diff -C2 -d -r1.6.2.3 -r1.6.2.4 *** testall.py 6 Dec 2008 01:48:27 -0000 1.6.2.3 --- testall.py 11 Dec 2008 04:24:25 -0000 1.6.2.4 *************** *** 26,35 **** self.argv = argv def __call__(self): ! # subprocess failed in strange ways for me?? ! fin, fout, ferr = os.popen3(" ".join(self.argv)) ! fin.close() ! output = fout.read() + ferr.read() ! fout.close() ! rc = ferr.close() if rc: base = os.path.basename(self.argv[1]) --- 26,44 ---- self.argv = argv def __call__(self): ! try: ! import subprocess ! p = subprocess.Popen(self.argv, ! stdout=subprocess.PIPE, ! stderr=subprocess.STDOUT) ! p.wait() ! rc = p.returncode ! output = p.stdout.read() ! except ImportError: ! # py2.3? ! fin, fout, ferr = os.popen3(" ".join(self.argv)) ! fin.close() ! output = fout.read() + ferr.read() ! fout.close() ! rc = ferr.close() if rc: base = os.path.basename(self.argv[1]) |
From: Mark H. <mha...@us...> - 2008-12-11 04:13:47
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/win32wnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275/win32/Demos/win32wnet Modified Files: Tag: py3k testwnet.py Log Message: merge lots of changes from the trunk Index: testwnet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32wnet/testwnet.py,v retrieving revision 1.2.4.3 retrieving revision 1.2.4.4 diff -C2 -d -r1.2.4.3 -r1.2.4.4 *** testwnet.py 27 Nov 2008 11:31:05 -0000 1.2.4.3 --- testwnet.py 11 Dec 2008 04:13:35 -0000 1.2.4.4 *************** *** 1,2 **** --- 1,3 ---- + import win32api import win32wnet import sys *************** *** 39,47 **** print("Finished dumping all resources.") def TestConnection(): if len(possible_shares)==0: print("Couldn't find any potential shares to connect to") return ! localName = "Z:" # need better way! for share in possible_shares: print("Attempting connection of", localName, "to", share.lpRemoteName) --- 40,65 ---- print("Finished dumping all resources.") + def findUnusedDriveLetter(): + existing = [x[0].lower() for x in win32api.GetLogicalDriveStrings().split('\0') if x] + handle = win32wnet.WNetOpenEnum(RESOURCE_REMEMBERED,RESOURCETYPE_DISK,0,None) + try: + while 1: + items = win32wnet.WNetEnumResource(handle, 0) + if len(items)==0: + break + xtra = [i.lpLocalName[0].lower() for i in items if i.lpLocalName] + existing.extend(xtra) + finally: + handle.Close() + for maybe in 'defghijklmnopqrstuvwxyz': + if maybe not in existing: + return maybe + raise RuntimeError("All drive mappings are taken?") + def TestConnection(): if len(possible_shares)==0: print("Couldn't find any potential shares to connect to") return ! localName = findUnusedDriveLetter() + ':' for share in possible_shares: print("Attempting connection of", localName, "to", share.lpRemoteName) *************** *** 61,66 **** finally: win32wnet.WNetCancelConnection2(localName, 0, 0) ! # Only do the first share that succeeds. ! break def TestGetUser(): --- 79,93 ---- finally: win32wnet.WNetCancelConnection2(localName, 0, 0) ! # and do it again, but this time by using the more modern ! # NETRESOURCE way. ! nr = win32wnet.NETRESOURCE() ! nr.dwType = share.dwType ! nr.lpLocalName = localName ! nr.lpRemoteName = share.lpRemoteName ! win32wnet.WNetAddConnection2(nr) ! win32wnet.WNetCancelConnection2(localName, 0, 0) ! ! # Only do the first share that succeeds. ! break def TestGetUser(): |
From: Mark H. <mha...@us...> - 2008-12-11 04:13:47
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275/win32/Lib Modified Files: Tag: py3k netbios.py win32inetcon.py Log Message: merge lots of changes from the trunk Index: win32inetcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32inetcon.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** win32inetcon.py 12 Jun 2004 13:40:34 -0000 1.1 --- win32inetcon.py 11 Dec 2008 04:13:35 -0000 1.1.4.1 *************** *** 1,7 **** # Generated by h2py from \mssdk\include\WinInet.h - # Included from pshpack8.h - - # Included from pshpack4.h INTERNET_INVALID_PORT_NUMBER = 0 INTERNET_DEFAULT_FTP_PORT = 21 --- 1,4 ---- *************** *** 725,727 **** PRIVACY_TYPE_THIRD_PARTY = 1 ! # Included from poppack.h --- 722,1103 ---- PRIVACY_TYPE_THIRD_PARTY = 1 ! # Generated by h2py from winhttp.h ! INTERNET_DEFAULT_PORT = 0 ! INTERNET_DEFAULT_HTTP_PORT = 80 ! INTERNET_DEFAULT_HTTPS_PORT = 443 ! WINHTTP_FLAG_ASYNC = 0x10000000 ! WINHTTP_FLAG_SECURE = 0x00800000 ! WINHTTP_FLAG_ESCAPE_PERCENT = 0x00000004 ! WINHTTP_FLAG_NULL_CODEPAGE = 0x00000008 ! WINHTTP_FLAG_BYPASS_PROXY_CACHE = 0x00000100 ! WINHTTP_FLAG_REFRESH = WINHTTP_FLAG_BYPASS_PROXY_CACHE ! WINHTTP_FLAG_ESCAPE_DISABLE = 0x00000040 ! WINHTTP_FLAG_ESCAPE_DISABLE_QUERY = 0x00000080 ! SECURITY_FLAG_IGNORE_UNKNOWN_CA = 0x00000100 ! SECURITY_FLAG_IGNORE_CERT_DATE_INVALID = 0x00002000 ! SECURITY_FLAG_IGNORE_CERT_CN_INVALID = 0x00001000 ! SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE = 0x00000200 ! INTERNET_SCHEME_HTTP = (1) ! INTERNET_SCHEME_HTTPS = (2) ! WINHTTP_AUTOPROXY_AUTO_DETECT = 0x00000001 ! WINHTTP_AUTOPROXY_CONFIG_URL = 0x00000002 ! WINHTTP_AUTOPROXY_RUN_INPROCESS = 0x00010000 ! WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY = 0x00020000 ! WINHTTP_AUTO_DETECT_TYPE_DHCP = 0x00000001 ! WINHTTP_AUTO_DETECT_TYPE_DNS_A = 0x00000002 ! WINHTTP_TIME_FORMAT_BUFSIZE = 62 ! ICU_NO_ENCODE = 0x20000000 ! ICU_DECODE = 0x10000000 ! ICU_NO_META = 0x08000000 ! ICU_ENCODE_SPACES_ONLY = 0x04000000 ! ICU_BROWSER_MODE = 0x02000000 ! ICU_ENCODE_PERCENT = 0x00001000 ! ICU_ESCAPE = (-2147483648) ! ICU_ESCAPE_AUTHORITY = 0x00002000 ! ICU_REJECT_USERPWD = 0x00004000 ! WINHTTP_ACCESS_TYPE_DEFAULT_PROXY = 0 ! WINHTTP_ACCESS_TYPE_NO_PROXY = 1 ! WINHTTP_ACCESS_TYPE_NAMED_PROXY = 3 ! WINHTTP_OPTION_CALLBACK = 1 ! WINHTTP_OPTION_RESOLVE_TIMEOUT = 2 ! WINHTTP_OPTION_CONNECT_TIMEOUT = 3 ! WINHTTP_OPTION_CONNECT_RETRIES = 4 ! WINHTTP_OPTION_SEND_TIMEOUT = 5 ! WINHTTP_OPTION_RECEIVE_TIMEOUT = 6 ! WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT = 7 ! WINHTTP_OPTION_HANDLE_TYPE = 9 ! WINHTTP_OPTION_READ_BUFFER_SIZE = 12 ! WINHTTP_OPTION_WRITE_BUFFER_SIZE = 13 ! WINHTTP_OPTION_PARENT_HANDLE = 21 ! WINHTTP_OPTION_EXTENDED_ERROR = 24 ! WINHTTP_OPTION_SECURITY_FLAGS = 31 ! WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT = 32 ! WINHTTP_OPTION_URL = 34 ! WINHTTP_OPTION_SECURITY_KEY_BITNESS = 36 ! WINHTTP_OPTION_PROXY = 38 ! WINHTTP_OPTION_USER_AGENT = 41 ! WINHTTP_OPTION_CONTEXT_VALUE = 45 ! WINHTTP_OPTION_CLIENT_CERT_CONTEXT = 47 ! WINHTTP_OPTION_REQUEST_PRIORITY = 58 ! WINHTTP_OPTION_HTTP_VERSION = 59 ! WINHTTP_OPTION_DISABLE_FEATURE = 63 ! WINHTTP_OPTION_CODEPAGE = 68 ! WINHTTP_OPTION_MAX_CONNS_PER_SERVER = 73 ! WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER = 74 ! WINHTTP_OPTION_AUTOLOGON_POLICY = 77 ! WINHTTP_OPTION_SERVER_CERT_CONTEXT = 78 ! WINHTTP_OPTION_ENABLE_FEATURE = 79 ! WINHTTP_OPTION_WORKER_THREAD_COUNT = 80 ! WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT = 81 ! WINHTTP_OPTION_PASSPORT_COBRANDING_URL = 82 ! WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH = 83 ! WINHTTP_OPTION_SECURE_PROTOCOLS = 84 ! WINHTTP_OPTION_ENABLETRACING = 85 ! WINHTTP_OPTION_PASSPORT_SIGN_OUT = 86 ! WINHTTP_OPTION_PASSPORT_RETURN_URL = 87 ! WINHTTP_OPTION_REDIRECT_POLICY = 88 ! WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS = 89 ! WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE = 90 ! WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE = 91 ! WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE = 92 ! WINHTTP_OPTION_CONNECTION_INFO = 93 ! WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST = 94 ! WINHTTP_OPTION_SPN = 96 ! WINHTTP_OPTION_GLOBAL_PROXY_CREDS = 97 ! WINHTTP_OPTION_GLOBAL_SERVER_CREDS = 98 ! WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT = 99 ! WINHTTP_OPTION_REJECT_USERPWD_IN_URL = 100 ! WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS = 101 ! WINHTTP_LAST_OPTION = WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS ! WINHTTP_OPTION_USERNAME = 0x1000 ! WINHTTP_OPTION_PASSWORD = 0x1001 ! WINHTTP_OPTION_PROXY_USERNAME = 0x1002 ! WINHTTP_OPTION_PROXY_PASSWORD = 0x1003 ! WINHTTP_CONNS_PER_SERVER_UNLIMITED = (-1) ! WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM = 0 ! WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW = 1 ! WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH = 2 ! WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT = WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM ! WINHTTP_OPTION_REDIRECT_POLICY_NEVER = 0 ! WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP = 1 ! WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS = 2 ! WINHTTP_OPTION_REDIRECT_POLICY_LAST = WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS ! WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT = WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP ! WINHTTP_DISABLE_PASSPORT_AUTH = 0x00000000 ! WINHTTP_ENABLE_PASSPORT_AUTH = 0x10000000 ! WINHTTP_DISABLE_PASSPORT_KEYRING = 0x20000000 ! WINHTTP_ENABLE_PASSPORT_KEYRING = 0x40000000 ! WINHTTP_DISABLE_COOKIES = 0x00000001 ! WINHTTP_DISABLE_REDIRECTS = 0x00000002 ! WINHTTP_DISABLE_AUTHENTICATION = 0x00000004 ! WINHTTP_DISABLE_KEEP_ALIVE = 0x00000008 ! WINHTTP_ENABLE_SSL_REVOCATION = 0x00000001 ! WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION = 0x00000002 ! WINHTTP_DISABLE_SPN_SERVER_PORT = 0x00000000 ! WINHTTP_ENABLE_SPN_SERVER_PORT = 0x00000001 ! WINHTTP_OPTION_SPN_MASK = WINHTTP_ENABLE_SPN_SERVER_PORT ! WINHTTP_HANDLE_TYPE_SESSION = 1 ! WINHTTP_HANDLE_TYPE_CONNECT = 2 ! WINHTTP_HANDLE_TYPE_REQUEST = 3 ! WINHTTP_AUTH_SCHEME_BASIC = 0x00000001 ! WINHTTP_AUTH_SCHEME_NTLM = 0x00000002 ! WINHTTP_AUTH_SCHEME_PASSPORT = 0x00000004 ! WINHTTP_AUTH_SCHEME_DIGEST = 0x00000008 ! WINHTTP_AUTH_SCHEME_NEGOTIATE = 0x00000010 ! WINHTTP_AUTH_TARGET_SERVER = 0x00000000 ! WINHTTP_AUTH_TARGET_PROXY = 0x00000001 ! SECURITY_FLAG_SECURE = 0x00000001 ! SECURITY_FLAG_STRENGTH_WEAK = 0x10000000 ! SECURITY_FLAG_STRENGTH_MEDIUM = 0x40000000 ! SECURITY_FLAG_STRENGTH_STRONG = 0x20000000 ! WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED = 0x00000001 ! WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT = 0x00000002 ! WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED = 0x00000004 ! WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA = 0x00000008 ! WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID = 0x00000010 ! WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID = 0x00000020 ! WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE = 0x00000040 ! WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR = (-2147483648) ! WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 = 0x00000008 ! WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 = 0x00000020 ! WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 = 0x00000080 ! WINHTTP_FLAG_SECURE_PROTOCOL_ALL = (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | \ ! WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | \ ! WINHTTP_FLAG_SECURE_PROTOCOL_TLS1) ! WINHTTP_CALLBACK_STATUS_RESOLVING_NAME = 0x00000001 ! WINHTTP_CALLBACK_STATUS_NAME_RESOLVED = 0x00000002 ! WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER = 0x00000004 ! WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER = 0x00000008 ! WINHTTP_CALLBACK_STATUS_SENDING_REQUEST = 0x00000010 ! WINHTTP_CALLBACK_STATUS_REQUEST_SENT = 0x00000020 ! WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE = 0x00000040 ! WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED = 0x00000080 ! WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION = 0x00000100 ! WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED = 0x00000200 ! WINHTTP_CALLBACK_STATUS_HANDLE_CREATED = 0x00000400 ! WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING = 0x00000800 ! WINHTTP_CALLBACK_STATUS_DETECTING_PROXY = 0x00001000 ! WINHTTP_CALLBACK_STATUS_REDIRECT = 0x00004000 ! WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE = 0x00008000 ! WINHTTP_CALLBACK_STATUS_SECURE_FAILURE = 0x00010000 ! WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE = 0x00020000 ! WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE = 0x00040000 ! WINHTTP_CALLBACK_STATUS_READ_COMPLETE = 0x00080000 ! WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE = 0x00100000 ! WINHTTP_CALLBACK_STATUS_REQUEST_ERROR = 0x00200000 ! WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE = 0x00400000 ! API_RECEIVE_RESPONSE = (1) ! API_QUERY_DATA_AVAILABLE = (2) ! API_READ_DATA = (3) ! API_WRITE_DATA = (4) ! API_SEND_REQUEST = (5) ! WINHTTP_CALLBACK_FLAG_RESOLVE_NAME = (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED) ! WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER = (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER) ! WINHTTP_CALLBACK_FLAG_SEND_REQUEST = (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT) ! WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE = (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED) ! WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION = (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED) ! WINHTTP_CALLBACK_FLAG_HANDLES = (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING) ! WINHTTP_CALLBACK_FLAG_DETECTING_PROXY = WINHTTP_CALLBACK_STATUS_DETECTING_PROXY ! WINHTTP_CALLBACK_FLAG_REDIRECT = WINHTTP_CALLBACK_STATUS_REDIRECT ! WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE = WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE ! WINHTTP_CALLBACK_FLAG_SECURE_FAILURE = WINHTTP_CALLBACK_STATUS_SECURE_FAILURE ! WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE = WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE ! WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE = WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE ! WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE = WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE ! WINHTTP_CALLBACK_FLAG_READ_COMPLETE = WINHTTP_CALLBACK_STATUS_READ_COMPLETE ! WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE = WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE ! WINHTTP_CALLBACK_FLAG_REQUEST_ERROR = WINHTTP_CALLBACK_STATUS_REQUEST_ERROR ! WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS = (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE \ ! | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE \ ! | WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE \ ! | WINHTTP_CALLBACK_STATUS_READ_COMPLETE \ ! | WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE \ ! | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR) ! WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS = (-1) ! WINHTTP_QUERY_MIME_VERSION = 0 ! WINHTTP_QUERY_CONTENT_TYPE = 1 ! WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING = 2 ! WINHTTP_QUERY_CONTENT_ID = 3 ! WINHTTP_QUERY_CONTENT_DESCRIPTION = 4 ! WINHTTP_QUERY_CONTENT_LENGTH = 5 ! WINHTTP_QUERY_CONTENT_LANGUAGE = 6 ! WINHTTP_QUERY_ALLOW = 7 ! WINHTTP_QUERY_PUBLIC = 8 ! WINHTTP_QUERY_DATE = 9 ! WINHTTP_QUERY_EXPIRES = 10 ! WINHTTP_QUERY_LAST_MODIFIED = 11 ! WINHTTP_QUERY_MESSAGE_ID = 12 ! WINHTTP_QUERY_URI = 13 ! WINHTTP_QUERY_DERIVED_FROM = 14 ! WINHTTP_QUERY_COST = 15 ! WINHTTP_QUERY_LINK = 16 ! WINHTTP_QUERY_PRAGMA = 17 ! WINHTTP_QUERY_VERSION = 18 ! WINHTTP_QUERY_STATUS_CODE = 19 ! WINHTTP_QUERY_STATUS_TEXT = 20 ! WINHTTP_QUERY_RAW_HEADERS = 21 ! WINHTTP_QUERY_RAW_HEADERS_CRLF = 22 ! WINHTTP_QUERY_CONNECTION = 23 ! WINHTTP_QUERY_ACCEPT = 24 ! WINHTTP_QUERY_ACCEPT_CHARSET = 25 ! WINHTTP_QUERY_ACCEPT_ENCODING = 26 ! WINHTTP_QUERY_ACCEPT_LANGUAGE = 27 ! WINHTTP_QUERY_AUTHORIZATION = 28 ! WINHTTP_QUERY_CONTENT_ENCODING = 29 ! WINHTTP_QUERY_FORWARDED = 30 ! WINHTTP_QUERY_FROM = 31 ! WINHTTP_QUERY_IF_MODIFIED_SINCE = 32 ! WINHTTP_QUERY_LOCATION = 33 ! WINHTTP_QUERY_ORIG_URI = 34 ! WINHTTP_QUERY_REFERER = 35 ! WINHTTP_QUERY_RETRY_AFTER = 36 ! WINHTTP_QUERY_SERVER = 37 ! WINHTTP_QUERY_TITLE = 38 ! WINHTTP_QUERY_USER_AGENT = 39 ! WINHTTP_QUERY_WWW_AUTHENTICATE = 40 ! WINHTTP_QUERY_PROXY_AUTHENTICATE = 41 ! WINHTTP_QUERY_ACCEPT_RANGES = 42 ! WINHTTP_QUERY_SET_COOKIE = 43 ! WINHTTP_QUERY_COOKIE = 44 ! WINHTTP_QUERY_REQUEST_METHOD = 45 ! WINHTTP_QUERY_REFRESH = 46 ! WINHTTP_QUERY_CONTENT_DISPOSITION = 47 ! WINHTTP_QUERY_AGE = 48 ! WINHTTP_QUERY_CACHE_CONTROL = 49 ! WINHTTP_QUERY_CONTENT_BASE = 50 ! WINHTTP_QUERY_CONTENT_LOCATION = 51 ! WINHTTP_QUERY_CONTENT_MD5 = 52 ! WINHTTP_QUERY_CONTENT_RANGE = 53 ! WINHTTP_QUERY_ETAG = 54 ! WINHTTP_QUERY_HOST = 55 ! WINHTTP_QUERY_IF_MATCH = 56 ! WINHTTP_QUERY_IF_NONE_MATCH = 57 ! WINHTTP_QUERY_IF_RANGE = 58 ! WINHTTP_QUERY_IF_UNMODIFIED_SINCE = 59 ! WINHTTP_QUERY_MAX_FORWARDS = 60 ! WINHTTP_QUERY_PROXY_AUTHORIZATION = 61 ! WINHTTP_QUERY_RANGE = 62 ! WINHTTP_QUERY_TRANSFER_ENCODING = 63 ! WINHTTP_QUERY_UPGRADE = 64 ! WINHTTP_QUERY_VARY = 65 ! WINHTTP_QUERY_VIA = 66 ! WINHTTP_QUERY_WARNING = 67 ! WINHTTP_QUERY_EXPECT = 68 ! WINHTTP_QUERY_PROXY_CONNECTION = 69 ! WINHTTP_QUERY_UNLESS_MODIFIED_SINCE = 70 ! WINHTTP_QUERY_PROXY_SUPPORT = 75 ! WINHTTP_QUERY_AUTHENTICATION_INFO = 76 ! WINHTTP_QUERY_PASSPORT_URLS = 77 ! WINHTTP_QUERY_PASSPORT_CONFIG = 78 ! WINHTTP_QUERY_MAX = 78 ! WINHTTP_QUERY_CUSTOM = 65535 ! WINHTTP_QUERY_FLAG_REQUEST_HEADERS = (-2147483648) ! WINHTTP_QUERY_FLAG_SYSTEMTIME = 0x40000000 ! WINHTTP_QUERY_FLAG_NUMBER = 0x20000000 ! HTTP_STATUS_CONTINUE = 100 ! HTTP_STATUS_SWITCH_PROTOCOLS = 101 ! HTTP_STATUS_OK = 200 ! HTTP_STATUS_CREATED = 201 ! HTTP_STATUS_ACCEPTED = 202 ! HTTP_STATUS_PARTIAL = 203 ! HTTP_STATUS_NO_CONTENT = 204 ! HTTP_STATUS_RESET_CONTENT = 205 ! HTTP_STATUS_PARTIAL_CONTENT = 206 ! HTTP_STATUS_WEBDAV_MULTI_STATUS = 207 ! HTTP_STATUS_AMBIGUOUS = 300 ! HTTP_STATUS_MOVED = 301 ! HTTP_STATUS_REDIRECT = 302 ! HTTP_STATUS_REDIRECT_METHOD = 303 ! HTTP_STATUS_NOT_MODIFIED = 304 ! HTTP_STATUS_USE_PROXY = 305 ! HTTP_STATUS_REDIRECT_KEEP_VERB = 307 ! HTTP_STATUS_BAD_REQUEST = 400 ! HTTP_STATUS_DENIED = 401 ! HTTP_STATUS_PAYMENT_REQ = 402 ! HTTP_STATUS_FORBIDDEN = 403 ! HTTP_STATUS_NOT_FOUND = 404 ! HTTP_STATUS_BAD_METHOD = 405 ! HTTP_STATUS_NONE_ACCEPTABLE = 406 ! HTTP_STATUS_PROXY_AUTH_REQ = 407 ! HTTP_STATUS_REQUEST_TIMEOUT = 408 ! HTTP_STATUS_CONFLICT = 409 ! HTTP_STATUS_GONE = 410 ! HTTP_STATUS_LENGTH_REQUIRED = 411 ! HTTP_STATUS_PRECOND_FAILED = 412 ! HTTP_STATUS_REQUEST_TOO_LARGE = 413 ! HTTP_STATUS_URI_TOO_LONG = 414 ! HTTP_STATUS_UNSUPPORTED_MEDIA = 415 ! HTTP_STATUS_RETRY_WITH = 449 ! HTTP_STATUS_SERVER_ERROR = 500 ! HTTP_STATUS_NOT_SUPPORTED = 501 ! HTTP_STATUS_BAD_GATEWAY = 502 ! HTTP_STATUS_SERVICE_UNAVAIL = 503 ! HTTP_STATUS_GATEWAY_TIMEOUT = 504 ! HTTP_STATUS_VERSION_NOT_SUP = 505 ! HTTP_STATUS_FIRST = HTTP_STATUS_CONTINUE ! HTTP_STATUS_LAST = HTTP_STATUS_VERSION_NOT_SUP ! WINHTTP_ADDREQ_INDEX_MASK = 0x0000FFFF ! WINHTTP_ADDREQ_FLAGS_MASK = (-65536) ! WINHTTP_ADDREQ_FLAG_ADD_IF_NEW = 0x10000000 ! WINHTTP_ADDREQ_FLAG_ADD = 0x20000000 ! WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA = 0x40000000 ! WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON = 0x01000000 ! WINHTTP_ADDREQ_FLAG_COALESCE = WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA ! WINHTTP_ADDREQ_FLAG_REPLACE = (-2147483648) ! WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH = 0 ! WINHTTP_ERROR_BASE = 12000 ! ERROR_WINHTTP_OUT_OF_HANDLES = (WINHTTP_ERROR_BASE + 1) ! ERROR_WINHTTP_TIMEOUT = (WINHTTP_ERROR_BASE + 2) ! ERROR_WINHTTP_INTERNAL_ERROR = (WINHTTP_ERROR_BASE + 4) ! ERROR_WINHTTP_INVALID_URL = (WINHTTP_ERROR_BASE + 5) ! ERROR_WINHTTP_UNRECOGNIZED_SCHEME = (WINHTTP_ERROR_BASE + 6) ! ERROR_WINHTTP_NAME_NOT_RESOLVED = (WINHTTP_ERROR_BASE + 7) ! ERROR_WINHTTP_INVALID_OPTION = (WINHTTP_ERROR_BASE + 9) ! ERROR_WINHTTP_OPTION_NOT_SETTABLE = (WINHTTP_ERROR_BASE + 11) ! ERROR_WINHTTP_SHUTDOWN = (WINHTTP_ERROR_BASE + 12) ! ERROR_WINHTTP_LOGIN_FAILURE = (WINHTTP_ERROR_BASE + 15) ! ERROR_WINHTTP_OPERATION_CANCELLED = (WINHTTP_ERROR_BASE + 17) ! ERROR_WINHTTP_INCORRECT_HANDLE_TYPE = (WINHTTP_ERROR_BASE + 18) ! ERROR_WINHTTP_INCORRECT_HANDLE_STATE = (WINHTTP_ERROR_BASE + 19) ! ERROR_WINHTTP_CANNOT_CONNECT = (WINHTTP_ERROR_BASE + 29) ! ERROR_WINHTTP_CONNECTION_ERROR = (WINHTTP_ERROR_BASE + 30) ! ERROR_WINHTTP_RESEND_REQUEST = (WINHTTP_ERROR_BASE + 32) ! ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED = (WINHTTP_ERROR_BASE + 44) ! ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN = (WINHTTP_ERROR_BASE + 100) ! ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND = (WINHTTP_ERROR_BASE + 101) ! ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND = (WINHTTP_ERROR_BASE + 102) ! ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN = (WINHTTP_ERROR_BASE + 103) ! ERROR_WINHTTP_HEADER_NOT_FOUND = (WINHTTP_ERROR_BASE + 150) ! ERROR_WINHTTP_INVALID_SERVER_RESPONSE = (WINHTTP_ERROR_BASE + 152) ! ERROR_WINHTTP_INVALID_HEADER = (WINHTTP_ERROR_BASE + 153) ! ERROR_WINHTTP_INVALID_QUERY_REQUEST = (WINHTTP_ERROR_BASE + 154) ! ERROR_WINHTTP_HEADER_ALREADY_EXISTS = (WINHTTP_ERROR_BASE + 155) ! ERROR_WINHTTP_REDIRECT_FAILED = (WINHTTP_ERROR_BASE + 156) ! ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR = (WINHTTP_ERROR_BASE + 178) ! ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT = (WINHTTP_ERROR_BASE + 166) ! ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT = (WINHTTP_ERROR_BASE + 167) ! ERROR_WINHTTP_NOT_INITIALIZED = (WINHTTP_ERROR_BASE + 172) ! ERROR_WINHTTP_SECURE_FAILURE = (WINHTTP_ERROR_BASE + 175) ! ERROR_WINHTTP_SECURE_CERT_DATE_INVALID = (WINHTTP_ERROR_BASE + 37) ! ERROR_WINHTTP_SECURE_CERT_CN_INVALID = (WINHTTP_ERROR_BASE + 38) ! ERROR_WINHTTP_SECURE_INVALID_CA = (WINHTTP_ERROR_BASE + 45) ! ERROR_WINHTTP_SECURE_CERT_REV_FAILED = (WINHTTP_ERROR_BASE + 57) ! ERROR_WINHTTP_SECURE_CHANNEL_ERROR = (WINHTTP_ERROR_BASE + 157) ! ERROR_WINHTTP_SECURE_INVALID_CERT = (WINHTTP_ERROR_BASE + 169) ! ERROR_WINHTTP_SECURE_CERT_REVOKED = (WINHTTP_ERROR_BASE + 170) ! ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE = (WINHTTP_ERROR_BASE + 179) ! ERROR_WINHTTP_AUTODETECTION_FAILED = (WINHTTP_ERROR_BASE + 180) ! ERROR_WINHTTP_HEADER_COUNT_EXCEEDED = (WINHTTP_ERROR_BASE + 181) ! ERROR_WINHTTP_HEADER_SIZE_OVERFLOW = (WINHTTP_ERROR_BASE + 182) ! ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW = (WINHTTP_ERROR_BASE + 183) ! ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW = (WINHTTP_ERROR_BASE + 184) ! ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY = (WINHTTP_ERROR_BASE + 185) ! ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY = (WINHTTP_ERROR_BASE + 186) ! WINHTTP_ERROR_LAST = (WINHTTP_ERROR_BASE + 186) ! ! WINHTTP_NO_PROXY_NAME = None ! WINHTTP_NO_PROXY_BYPASS = None ! WINHTTP_NO_REFERER = None ! WINHTTP_DEFAULT_ACCEPT_TYPES = None ! WINHTTP_NO_ADDITIONAL_HEADERS = None ! WINHTTP_NO_REQUEST_DATA = None Index: netbios.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/netbios.py,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** netbios.py 27 Nov 2008 11:31:05 -0000 1.4.4.2 --- netbios.py 11 Dec 2008 04:13:35 -0000 1.4.4.3 *************** *** 1,2 **** --- 1,3 ---- + import sys import win32wnet import struct *************** *** 257,260 **** --- 258,268 ---- return NCBStruct(ACTION_HEADER_ITEMS) + def byte_to_int(b): + """Given an element in a binary buffer, return its integer value""" + if sys.version_info >= (3,0): + # a byte is already an int in py3k + return b + return ord(b) # its a char from a string in py2k. + if __name__=='__main__': # code ported from "HOWTO: Get the MAC Address for an Ethernet Adapter" *************** *** 269,279 **** ncb.Reset() ncb.Command = NCBRESET ! ncb.Lana_num = la_enum.lana[i] rc = Netbios(ncb) if rc != 0: raise RuntimeError("Unexpected result %d" % (rc,)) ncb.Reset() ncb.Command = NCBASTAT ! ncb.Lana_num = la_enum.lana[i] ! ncb.Callname = b"* " adapter = ADAPTER_STATUS() ncb.Buffer = adapter --- 277,287 ---- ncb.Reset() ncb.Command = NCBRESET ! ncb.Lana_num = byte_to_int(la_enum.lana[i]) rc = Netbios(ncb) if rc != 0: raise RuntimeError("Unexpected result %d" % (rc,)) ncb.Reset() ncb.Command = NCBASTAT ! ncb.Lana_num = byte_to_int(la_enum.lana[i]) ! ncb.Callname = "* ".encode("ascii") # ensure bytes on py2x and 3k adapter = ADAPTER_STATUS() ncb.Buffer = adapter *************** *** 281,284 **** print("Adapter address:", end=' ') for ch in adapter.adapter_address: ! print("%02x" % (ch,), end=' ') print() --- 289,292 ---- print("Adapter address:", end=' ') for ch in adapter.adapter_address: ! print("%02x" % (byte_to_int(ch),), end=' ') print() |
From: Mark H. <mha...@us...> - 2008-12-11 04:13:47
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275 Modified Files: Tag: py3k CHANGES.txt Log Message: merge lots of changes from the trunk Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.26.2.5 retrieving revision 1.26.2.6 diff -C2 -d -r1.26.2.5 -r1.26.2.6 *** CHANGES.txt 6 Dec 2008 01:48:26 -0000 1.26.2.5 --- CHANGES.txt 11 Dec 2008 04:13:35 -0000 1.26.2.6 *************** *** 9,12 **** --- 9,23 ---- ---------------- + * "Modernization" changes, instigated by py3k: + + - Many older modules now accept unicode arguments where previously they + only accepted strings - notably, win32ui, win32wnet ... + + - win32wnet: NCB and NETRESOURCE attributes are now types rather than + methods. NETRESOURCE string attributes may return None if the win32 + structure has a NULL pointer (previously an empty string was returned) + + * Added win32inet.WinHttpGetDefaultProxyConfiguration() + * Pythonwin updates from Rémi Paucher; enter completes auto-complete in the editor and interactive windows, auto-complete should now work on French |
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275/win32/test Modified Files: Tag: py3k handles.py test_pywintypes.py test_security.py test_win32api.py test_win32wnet.py Added Files: Tag: py3k test_win32gui.py Log Message: merge lots of changes from the trunk Index: test_win32api.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v retrieving revision 1.13.2.2 retrieving revision 1.13.2.3 diff -C2 -d -r1.13.2.2 -r1.13.2.3 *** test_win32api.py 3 Oct 2008 01:09:55 -0000 1.13.2.2 --- test_win32api.py 11 Dec 2008 04:13:36 -0000 1.13.2.3 *************** *** 5,8 **** --- 5,9 ---- import win32api, win32con, win32event, winerror import sys, os + import tempfile class CurrentUserTestCase(unittest.TestCase): *************** *** 138,145 **** def testLongLongPathNames(self): # We need filename where the FQN is > 256 - simplest way is to create a ! # 250 character directory in the cwd. import win32file basename = "a" * 250 ! fname = "\\\\?\\" + os.path.join(os.getcwd(), basename) try: win32file.CreateDirectoryW(fname, None) --- 139,150 ---- def testLongLongPathNames(self): # We need filename where the FQN is > 256 - simplest way is to create a ! # 250 character directory in the cwd (except - cwd may be on a drive ! # not supporting \\\\?\\ (eg, network share) - so use temp. import win32file basename = "a" * 250 ! # but we need to ensure we use the 'long' version of the ! # temp dir for later comparison. ! long_temp_dir = win32api.GetLongPathNameW(tempfile.gettempdir()) ! fname = "\\\\?\\" + os.path.join(long_temp_dir, basename) try: win32file.CreateDirectoryW(fname, None) Index: test_security.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_security.py,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.2 diff -C2 -d -r1.4.4.1 -r1.4.4.2 *** test_security.py 27 Nov 2008 11:31:11 -0000 1.4.4.1 --- test_security.py 11 Dec 2008 04:13:36 -0000 1.4.4.2 *************** *** 13,16 **** --- 13,26 ---- pass + def testEqual(self): + self.failUnlessEqual(win32security.LookupAccountName('','Administrator')[0], + win32security.LookupAccountName('','Administrator')[0]) + + def testBuffer(self): + # hrm - what about py3k - intent is to check the buffer slots return + # something sane. + self.failUnlessEqual(buffer(win32security.LookupAccountName('','Administrator')[0]), + buffer(win32security.LookupAccountName('','Administrator')[0])) + def testMemory(self): pwr_sid = self.pwr_sid Index: test_pywintypes.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_pywintypes.py,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** test_pywintypes.py 13 Sep 2008 20:34:03 -0000 1.3.4.1 --- test_pywintypes.py 11 Dec 2008 04:13:36 -0000 1.3.4.2 *************** *** 22,25 **** --- 22,38 ---- return + def testPyTimeCompare(self): + t1 = pywintypes.Time(100) + t1_2 = pywintypes.Time(100) + t2 = pywintypes.Time(101) + + self.failUnlessEqual(t1, t1_2) + self.failUnless(t1 <= t1_2) + self.failUnless(t1_2 >= t1) + + self.failIfEqual(t1, t2) + self.failUnless(t1 < t2) + self.failUnless(t2 > t1 ) + def testGUID(self): s = "{00020400-0000-0000-C000-000000000046}" Index: test_win32wnet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32wnet.py,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** test_win32wnet.py 10 Dec 2008 11:01:22 -0000 1.1.4.1 --- test_win32wnet.py 11 Dec 2008 04:13:36 -0000 1.1.4.2 *************** *** 57,61 **** val = getattr(item, attr) if typ is int: ! self.failUnless(type(val) in (int, int), "Attr %r has value %r" % (attr, val)) new_val = val + 1 --- 57,61 ---- val = getattr(item, attr) if typ is int: ! self.failUnless(type(val) in (int,), "Attr %r has value %r" % (attr, val)) new_val = val + 1 Index: handles.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/handles.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 *** handles.py 27 Nov 2008 11:31:10 -0000 1.4.2.2 --- handles.py 11 Dec 2008 04:13:36 -0000 1.4.2.3 *************** *** 88,92 **** # >>> struct.unpack("P", struct.pack("P", -1)) # (4294967295L,) ! pywintypes.HANDLE(sys.maxint+1) def testGC(self): --- 88,96 ---- # >>> struct.unpack("P", struct.pack("P", -1)) # (4294967295L,) ! try: ! big = sys.maxsize ! except AttributeError: ! big = sys.maxint ! pywintypes.HANDLE(big+1) def testGC(self): --- NEW FILE: test_win32gui.py --- # tests for win32gui import unittest import win32gui class TestMisc(unittest.TestCase): def test_get_string(self): # test invalid addresses cause a ValueError rather than crash! self.assertRaises(ValueError, win32gui.PyGetString, 0) self.assertRaises(ValueError, win32gui.PyGetString, 1) self.assertRaises(ValueError, win32gui.PyGetString, 1,1) if __name__=='__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2008-12-11 04:13:40
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32wnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275/win32/src/win32wnet Modified Files: Tag: py3k PyNCB.cpp PyNetresource.cpp Log Message: merge lots of changes from the trunk Index: PyNetresource.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/PyNetresource.cpp,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -C2 -d -r1.3.4.2 -r1.3.4.3 *** PyNetresource.cpp 10 Dec 2008 11:01:22 -0000 1.3.4.2 --- PyNetresource.cpp 11 Dec 2008 04:13:35 -0000 1.3.4.3 *************** *** 126,133 **** struct PyMemberDef PyNETRESOURCE::members[] = { ! {"dwScope", T_ULONG, OFF(m_nr.dwScope), 0}, // @prop integer|dwScope| ! {"dwType", T_ULONG, OFF(m_nr.dwType), 0}, // @prop integer|dwType| ! {"dwDisplayType", T_ULONG,OFF(m_nr.dwDisplayType), 0}, // @prop integer|dwDisplayType| ! {"dwUsage", T_ULONG, OFF(m_nr.dwUsage), 0}, // @prop integer|dwUsage| // These are handled by getattro/setattro --- 126,135 ---- struct PyMemberDef PyNETRESOURCE::members[] = { ! // Note we avoid the use of 'U'nsigned types as they always force ! // a long to be returned. ! {"dwScope", T_INT, OFF(m_nr.dwScope), 0}, // @prop integer|dwScope| ! {"dwType", T_INT, OFF(m_nr.dwType), 0}, // @prop integer|dwType| ! {"dwDisplayType", T_INT, OFF(m_nr.dwDisplayType), 0}, // @prop integer|dwDisplayType| ! {"dwUsage", T_INT, OFF(m_nr.dwUsage), 0}, // @prop integer|dwUsage| // These are handled by getattro/setattro Index: PyNCB.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/PyNCB.cpp,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** PyNCB.cpp 10 Dec 2008 11:01:22 -0000 1.4.4.2 --- PyNCB.cpp 11 Dec 2008 04:13:35 -0000 1.4.4.3 *************** *** 110,124 **** struct PyMemberDef PyNCB::members[] = { ! {"Command", T_UBYTE, OFF(m_ncb.ncb_command), 0}, // @prop int|Command| ! {"Retcode", T_UBYTE, OFF(m_ncb.ncb_retcode), 0}, // @prop int|Retcode| ! {"Lsn", T_UBYTE, OFF(m_ncb.ncb_lsn), 0}, // @prop int|Lsn| ! {"Num", T_UBYTE, OFF(m_ncb.ncb_num), 0}, // @prop int|Num| ! {"Bufflen", T_USHORT, OFF(m_ncb.ncb_length), 1}, // @prop int|Bufflen|read-only {"Callname",T_STRING, OFF(m_ncb.ncb_callname),0}, // @prop string|Callname| - The strings need to be space padded to 16 chars exactly {"Name", T_STRING, OFF(m_ncb.ncb_name), 0}, // @prop string|Name| - The strings need to be space padded to 16 chars exactly ! {"Rto", T_UBYTE, OFF(m_ncb.ncb_rto), 0},// @prop string|Rto| - The strings need to be space padded to 16 chars exactly ! {"Sto", T_UBYTE, OFF(m_ncb.ncb_sto), 0},// @prop string|Sto| - The strings need to be space padded to 16 chars exactly ! {"Lana_num",T_UBYTE, OFF(m_ncb.ncb_lana_num),0},// @prop int|Lana_num| ! {"Cmd_cplt",T_UBYTE, OFF(m_ncb.ncb_cmd_cplt),0},// @prop int|Cmd_cplt| {"Event", T_LONG, OFF(m_ncb.ncb_event), 0},// @prop int|Event| {"Post", T_LONG, OFF(m_ncb.ncb_post), 0},// @prop int|Post| --- 110,126 ---- struct PyMemberDef PyNCB::members[] = { ! // Note we avoid the use of 'U'nsigned types as they always force ! // a long to be returned. ! {"Command", T_BYTE, OFF(m_ncb.ncb_command), 0}, // @prop int|Command| ! {"Retcode", T_BYTE, OFF(m_ncb.ncb_retcode), 0}, // @prop int|Retcode| ! {"Lsn", T_BYTE, OFF(m_ncb.ncb_lsn), 0}, // @prop int|Lsn| ! {"Num", T_BYTE, OFF(m_ncb.ncb_num), 0}, // @prop int|Num| ! {"Bufflen", T_SHORT, OFF(m_ncb.ncb_length), 1}, // @prop int|Bufflen|read-only {"Callname",T_STRING, OFF(m_ncb.ncb_callname),0}, // @prop string|Callname| - The strings need to be space padded to 16 chars exactly {"Name", T_STRING, OFF(m_ncb.ncb_name), 0}, // @prop string|Name| - The strings need to be space padded to 16 chars exactly ! {"Rto", T_BYTE, OFF(m_ncb.ncb_rto), 0},// @prop string|Rto| - The strings need to be space padded to 16 chars exactly ! {"Sto", T_BYTE, OFF(m_ncb.ncb_sto), 0},// @prop string|Sto| - The strings need to be space padded to 16 chars exactly ! {"Lana_num",T_BYTE, OFF(m_ncb.ncb_lana_num),0},// @prop int|Lana_num| ! {"Cmd_cplt",T_BYTE, OFF(m_ncb.ncb_cmd_cplt),0},// @prop int|Cmd_cplt| {"Event", T_LONG, OFF(m_ncb.ncb_event), 0},// @prop int|Event| {"Post", T_LONG, OFF(m_ncb.ncb_post), 0},// @prop int|Post| |
From: Mark H. <mha...@us...> - 2008-12-11 04:13:40
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275/win32/src Modified Files: Tag: py3k PyLARGE_INTEGER.cpp PyWinObjects.h win32file.i win32gui.i win32inet.i win32inet_winhttp.cpp win32profilemodule.cpp Log Message: merge lots of changes from the trunk Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -C2 -d -r1.14.2.1 -r1.14.2.2 *** PyWinObjects.h 29 Aug 2008 04:59:25 -0000 1.14.2.1 --- PyWinObjects.h 11 Dec 2008 04:13:35 -0000 1.14.2.2 *************** *** 140,143 **** --- 140,145 ---- /* Python support */ int compare(PyObject *ob); + PyObject *richcompare(PyObject *other, int op); + int print(FILE *fp, int flags); PyObject *asStr(void); *************** *** 147,150 **** --- 149,153 ---- static int printFunc(PyObject *ob, FILE *fp, int flags); static int compareFunc(PyObject *ob1, PyObject *ob2); + static PyObject *richcompareFunc(PyObject *ob, PyObject *other, int op); static int nonzeroFunc(PyObject *ob); static long hashFunc(PyObject *ob); Index: win32inet_winhttp.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32inet_winhttp.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** win32inet_winhttp.cpp 9 Apr 2008 04:31:07 -0000 1.2 --- win32inet_winhttp.cpp 11 Dec 2008 04:13:35 -0000 1.2.2.1 *************** *** 10,15 **** #include "winhttp.h" #include "pywintypes.h" ! ! extern PyObject *PyObject_FromHINTERNET(HINTERNET hi); // @doc --- 10,14 ---- #include "winhttp.h" #include "pywintypes.h" ! #include "pywinobjects.h" // @doc *************** *** 17,20 **** --- 16,22 ---- static funcWinHttpGetIEProxyConfigForCurrentUser pfnWinHttpGetIEProxyConfigForCurrentUser=NULL; + typedef BOOL (WINAPI *funcWinHttpGetDefaultProxyConfiguration)(WINHTTP_PROXY_INFO *); + static funcWinHttpGetDefaultProxyConfiguration pfnWinHttpGetDefaultProxyConfiguration=NULL; + typedef BOOL (WINAPI *funcWinHttpGetProxyForUrl)(HINTERNET, LPCWSTR, WINHTTP_AUTOPROXY_OPTIONS*, WINHTTP_PROXY_INFO *); static funcWinHttpGetProxyForUrl pfnWinHttpGetProxyForUrl=NULL; *************** *** 23,26 **** --- 25,31 ---- static funcWinHttpOpen pfnWinHttpOpen=NULL; + typedef BOOL (WINAPI *funcWinHttpCloseHandle)(HINTERNET); + static funcWinHttpCloseHandle pfnWinHttpCloseHandle=NULL; + #define CHECK_PFN(fname) \ if (pfn##fname==NULL) \ *************** *** 40,44 **** void init_win32inetstuff() { ! HMODULE hmod = LoadLibrary("Winhttp.dll"); if (!hmod) return; // nothing else to do! --- 45,49 ---- void init_win32inetstuff() { ! HMODULE hmod = LoadLibrary(_T("Winhttp.dll")); if (!hmod) return; // nothing else to do! *************** *** 46,49 **** --- 51,96 ---- LOAD_PFN(WinHttpGetProxyForUrl); LOAD_PFN(WinHttpOpen); + LOAD_PFN(WinHttpCloseHandle); + LOAD_PFN(WinHttpGetDefaultProxyConfiguration); + // winhttp.dll also provides the string resources for its errors. + PyWin_RegisterErrorMessageModule(WINHTTP_ERROR_BASE, WINHTTP_ERROR_LAST, hmod); + } + + // A handle used by WinHttpOpen; even though it is documented as a HINTERNET, + // our standard HINTERNET isn't suitable as (a) the callbacks fail and (b) + // the handle must be closed via WinHttpCloseHandle. + class PyHWINHTTP : public PyHANDLE + { + public: + PyHWINHTTP(HINTERNET hInit) : PyHANDLE((HANDLE)hInit) {;} + + virtual BOOL Close(void) { + BOOL ret=TRUE; + // We've already checked we have the function-pointer - but + // it can't hurt to check again! + if (m_handle && pfnWinHttpCloseHandle){ + HINTERNET h=m_handle; + m_handle = 0; // don't try again! + ret=(*pfnWinHttpCloseHandle)(h); + if (!ret) + PyWin_SetAPIError("WinHttpCloseHandle"); + } + return ret; + } + virtual const char *GetTypeName() {return "PyHWINHTTP";} + }; + + PyObject *PyObject_FromWinHttpHandle(HINTERNET hi) + { + // Don't allow handles to be created if we can't close them! + CHECK_PFN(WinHttpCloseHandle); + PyHWINHTTP *ret=new PyHWINHTTP(hi); + if (ret==NULL) + return PyErr_NoMemory(); + if (PyErr_Occurred()){ + Py_DECREF(ret); + ret = NULL; + } + return ret; } *************** *** 75,79 **** } ! // @object WINHTTP_AUTOPROXY_OPTIONS|Used by <om win32inet.WinHTTPGetProxyForUrl> BOOL PyObject_AsWINHTTP_AUTOPROXY_OPTIONS(PyObject *ob, WINHTTP_AUTOPROXY_OPTIONS *out) { --- 122,139 ---- } ! // @object PyWINHTTP_PROXY_INFO|A tuple representing a WINHTTP_PROXY_INFO structure. ! ! PyObject *PyObject_FromWINHTTP_PROXY_INFO(WINHTTP_PROXY_INFO *i, BOOL bFreeStrings=TRUE) ! { ! PyObject *ret = Py_BuildValue("kuu", ! i->dwAccessType, // @tupleitem 0|int|dwAccessType| ! i->lpszProxy, // @tupleitem 2|string|lpszProxy| ! i->lpszProxyBypass); // @tupleitem 3|string|lpszProxy ! if (i->lpszProxy) GlobalFree(i->lpszProxy); ! if (i->lpszProxyBypass) GlobalFree(i->lpszProxyBypass); ! return ret; ! } ! ! // @object PyWINHTTP_AUTOPROXY_OPTIONS|Used by <om win32inet.WinHTTPGetProxyForUrl> BOOL PyObject_AsWINHTTP_AUTOPROXY_OPTIONS(PyObject *ob, WINHTTP_AUTOPROXY_OPTIONS *out) { *************** *** 105,110 **** } ! // @pymethod tuple|win32inet|WinHttpGetIEProxyConfigForCurrentUser|Obtains ! // the Internet Explorer proxy configuration for the current user. PyObject *PyWinHttpGetProxyForUrl(PyObject *self, PyObject *args) { --- 165,190 ---- } ! // @pymethod <o PyWINHTTP_PROXY_INFO>|win32inet|WinHttpGetDefaultProxyConfiguration| ! // Retrieves the default WinHTTP proxy configuration from the registry. ! PyObject *PyWinHttpGetDefaultProxyConfiguration(PyObject *self, PyObject *args) ! { ! CHECK_PFN(WinHttpGetDefaultProxyConfiguration); ! if (!PyArg_ParseTuple(args, ":WinHttpGetDefaultProxyConfiguration")) ! return NULL; ! WINHTTP_PROXY_INFO info; ! memset(&info, 0, sizeof(info)); ! BOOL ok; ! Py_BEGIN_ALLOW_THREADS ! ok = (*pfnWinHttpGetDefaultProxyConfiguration)(&info); ! Py_END_ALLOW_THREADS ! if (!ok) { ! PyWin_SetAPIError("WinHttpGetDefaultProxyConfiguration"); ! return NULL; ! } ! return PyObject_FromWINHTTP_PROXY_INFO(&info); ! } ! ! // @pymethod <o PyWINHTTP_PROXY_INFO>|win32inet|WinHttpGetProxyForUrl|Obtains ! // the Internet Explorer proxy configuration for the specified URL. PyObject *PyWinHttpGetProxyForUrl(PyObject *self, PyObject *args) { *************** *** 114,118 **** &obHandle, // @pyparm <o HANDLE>/int|handle|| &obURL, // @pyparm unicode/string|url|| ! &obOptions // @pyparm tuple|options|| )) return NULL; --- 194,198 ---- &obHandle, // @pyparm <o HANDLE>/int|handle|| &obURL, // @pyparm unicode/string|url|| ! &obOptions // @pyparm <o PyWINHTTP_AUTOPROXY_OPTIONS>|options|| )) return NULL; *************** *** 143,157 **** goto done; } ! // @rdesc The result is a windows WINHTTP_PROXY_INFO ! // structure; a tuple of an int (bool) and 2 unicode strings ! // (dwAccessType, lpszProxy, lpszProxyBypass). ! // @pyseeapi WinHttpGetProxyForUrl ! // @pyseeapi WINHTTP_PROXY_INFO ! ret = Py_BuildValue("kuu", ! info.dwAccessType, ! info.lpszProxy, ! info.lpszProxyBypass); ! if (info.lpszProxy) GlobalFree(info.lpszProxy); ! if (info.lpszProxyBypass) GlobalFree(info.lpszProxyBypass); done: if (url) --- 223,227 ---- goto done; } ! ret = PyObject_FromWINHTTP_PROXY_INFO(&info); done: if (url) *************** *** 198,202 **** } // @pyseeapi WinHttpOpen ! ret = PyObject_FromHINTERNET(hi); done: if (ua) --- 268,272 ---- } // @pyseeapi WinHttpOpen ! ret = PyObject_FromWinHttpHandle(hi); done: if (ua) Index: win32profilemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32profilemodule.cpp,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** win32profilemodule.cpp 29 Aug 2008 04:59:27 -0000 1.3.2.1 --- win32profilemodule.cpp 11 Dec 2008 04:13:35 -0000 1.3.2.2 *************** *** 463,498 **** ! extern "C" __declspec(dllexport) ! #if (PY_VERSION_HEX < 0x03000000) ! void initwin32profile(void) ! #else ! PyObject *PyInit_win32profile(void) ! #endif { ! PyObject *dict, *module; ! PyWinGlobals_Ensure(); ! ! #if (PY_VERSION_HEX < 0x03000000) ! module = Py_InitModule("win32profile", win32profile_functions); ! if (!module) ! return; ! dict = PyModule_GetDict(module); ! if (!dict) ! return; ! #else ! static PyModuleDef win32profile_def = { ! PyModuleDef_HEAD_INIT, ! "win32profile", ! "Interface to the Terminal Services Api.", ! -1, ! win32profile_functions ! }; ! module = PyModule_Create(&win32profile_def); ! if (!module) ! return NULL; ! dict = PyModule_GetDict(module); ! if (!dict) ! return NULL; ! #endif // PROFILEINFO flags --- 463,470 ---- ! PYWIN_MODULE_INIT_FUNC(win32profile) { ! PYWIN_MODULE_INIT_PREPARE(win32profile, win32profile_functions, ! "Interface to the User Profile Api."); // PROFILEINFO flags *************** *** 508,512 **** hmodule=GetModuleHandle(L"Userenv.dll"); if (hmodule==NULL) ! hmodule = LoadLibrary(L"Userenv.dll"); if (hmodule!=NULL){ pfnDeleteProfile=(DeleteProfilefunc)GetProcAddress(hmodule,"DeleteProfileW"); --- 480,484 ---- hmodule=GetModuleHandle(L"Userenv.dll"); if (hmodule==NULL) ! hmodule = LoadLibrary(L"Userenv.dll"); if (hmodule!=NULL){ pfnDeleteProfile=(DeleteProfilefunc)GetProcAddress(hmodule,"DeleteProfileW"); *************** *** 520,526 **** pfnUnloadUserProfile=(UnloadUserProfilefunc)GetProcAddress(hmodule,"UnloadUserProfile"); } - #if (PY_VERSION_HEX >= 0x03000000) - return module; - #endif - } --- 492,496 ---- pfnUnloadUserProfile=(UnloadUserProfilefunc)GetProcAddress(hmodule,"UnloadUserProfile"); } + PYWIN_MODULE_INIT_RETURN_SUCCESS; + } Index: win32inet.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32inet.i,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** win32inet.i 9 Apr 2008 04:31:07 -0000 1.10 --- win32inet.i 11 Dec 2008 04:13:35 -0000 1.10.2.1 *************** *** 66,69 **** --- 66,73 ---- }; + // NOTE: The PyHINTERNET class is only suitable for HINTERNET's returned + // from the win32inet functions. The WinHttp functions should use a + // HWINHTTP. + // @object PyHINTERNET|An object that wraps a HINTERNET handle. When the // handle object is destroyed, it is automatically closed. *************** *** 1924,1927 **** --- 1928,1932 ---- extern void init_win32inetstuff(); extern PyObject *PyWinHttpGetIEProxyConfigForCurrentUser(PyObject *, PyObject *); + extern PyObject *PyWinHttpGetDefaultProxyConfiguration(PyObject *, PyObject *); extern PyObject *PyWinHttpGetProxyForUrl(PyObject *, PyObject *); extern PyObject *PyWinHttpOpen(PyObject *, PyObject *); *************** *** 1929,1932 **** --- 1934,1938 ---- %native(WinHttpGetIEProxyConfigForCurrentUser) PyWinHttpGetIEProxyConfigForCurrentUser; + %native(WinHttpGetDefaultProxyConfiguration) PyWinHttpGetDefaultProxyConfiguration; %native(WinHttpGetProxyForUrl) PyWinHttpGetProxyForUrl; %native(WinHttpOpen) PyWinHttpOpen; Index: PyLARGE_INTEGER.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyLARGE_INTEGER.cpp,v retrieving revision 1.12.2.1 retrieving revision 1.12.2.2 diff -C2 -d -r1.12.2.1 -r1.12.2.2 *** PyLARGE_INTEGER.cpp 29 Aug 2008 04:59:25 -0000 1.12.2.1 --- PyLARGE_INTEGER.cpp 11 Dec 2008 04:13:35 -0000 1.12.2.2 *************** *** 22,33 **** BOOL PyWinObject_AsLARGE_INTEGER(PyObject *ob, LARGE_INTEGER *pResult) { ! pResult->QuadPart=PyLong_AsLongLong(ob); ! return !(pResult->QuadPart == -1 && PyErr_Occurred()); } BOOL PyWinObject_AsULARGE_INTEGER(PyObject *ob, ULARGE_INTEGER *pResult) { ! pResult->QuadPart=PyLong_AsUnsignedLongLong(ob); ! return !(pResult->QuadPart == (ULONGLONG) -1 && PyErr_Occurred()); } --- 22,74 ---- BOOL PyWinObject_AsLARGE_INTEGER(PyObject *ob, LARGE_INTEGER *pResult) { ! if (PyInt_Check(ob)) { ! // 32 bit integer value. ! int x = PyInt_AS_LONG(ob); ! if (x==(int)-1 && PyErr_Occurred()) ! return FALSE; ! LISet32(*pResult, x); ! return TRUE; ! } else if (PyLong_Check(ob)) { ! pResult->QuadPart=PyLong_AsLongLong(ob); ! return !(pResult->QuadPart == -1 && PyErr_Occurred()); ! } else { ! PyErr_Warn(PyExc_PendingDeprecationWarning, "Support for passing 2 integers to create a 64bit value is deprecated - pass a long instead"); ! long hiVal, loVal; ! if (!PyArg_ParseTuple(ob, "ll", &hiVal, &loVal)) { ! PyErr_SetString(PyExc_TypeError, "LARGE_INTEGER must be 'int', or '(int, int)'"); ! return FALSE; ! } ! // ### what to do about a "negative" loVal?! ! pResult->QuadPart = (((__int64)hiVal) << 32) | loVal; ! return TRUE; ! } ! assert(0); // not reached. } BOOL PyWinObject_AsULARGE_INTEGER(PyObject *ob, ULARGE_INTEGER *pResult) { ! if (PyInt_Check(ob)) { ! // 32 bit integer value. ! int x = PyInt_AS_LONG(ob); ! if (x==(int)-1 && PyErr_Occurred()) ! return FALSE; ! // ### what to do with "negative" integers? Nothing - they ! // get treated as unsigned! ! ULISet32(*pResult, x); ! return TRUE; ! } else if (PyLong_Check(ob)) { ! pResult->QuadPart=PyLong_AsUnsignedLongLong(ob); ! return !(pResult->QuadPart == (ULONGLONG) -1 && PyErr_Occurred()); ! } else { ! PyErr_Warn(PyExc_PendingDeprecationWarning, "Support for passing 2 integers to create a 64bit value is deprecated - pass a long instead"); ! long hiVal, loVal; ! if (!PyArg_ParseTuple(ob, "ll", &hiVal, &loVal)) { ! PyErr_SetString(PyExc_TypeError, "ULARGE_INTEGER must be 'int', or '(int, int)'"); ! return FALSE; ! } ! pResult->QuadPart = (((__int64)hiVal) << 32) | loVal; ! return TRUE; ! } ! assert(0); // not reached. } Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.93.2.4 retrieving revision 1.93.2.5 diff -C2 -d -r1.93.2.4 -r1.93.2.5 *** win32file.i 13 Nov 2008 15:12:49 -0000 1.93.2.4 --- win32file.i 11 Dec 2008 04:13:35 -0000 1.93.2.5 *************** *** 23,27 **** %{ - #define UNICODE #ifndef MS_WINCE //#define FAR --- 23,26 ---- *************** *** 29,33 **** #define _WIN32_WINNT 0x0501 #endif - #include "winsock2.h" #include "mswsock.h" --- 28,31 ---- *************** *** 52,55 **** --- 50,70 ---- %include "pywin32.i" + %{ + // older python version's don't get the PyCObject structure definition + // exposed, and we need it to cleanly zap our handles (see + // CloseEncryptedFileRaw below). + // Fortunately, the PyCObject structure has been identical from versions + // 2.3->2.6 - and 2.6 is where it is first made public. + #if (PY_VERSION_HEX < 0x02060000) + typedef struct { + PyObject_HEAD + void *cobject; + void *desc; + void (*destructor)(void *); + } PyCObject; + + #endif + %} + #define FILE_GENERIC_READ FILE_GENERIC_READ #define FILE_GENERIC_WRITE FILE_GENERIC_WRITE *************** *** 4010,4014 **** void encryptedfilecontextdestructor(void *ctxt){ ! if (pfnCloseEncryptedFileRaw) (*pfnCloseEncryptedFileRaw)(ctxt); } --- 4025,4029 ---- void encryptedfilecontextdestructor(void *ctxt){ ! if (pfnCloseEncryptedFileRaw && ctxt) (*pfnCloseEncryptedFileRaw)(ctxt); } *************** *** 4203,4215 **** CHECK_PFN(CloseEncryptedFileRaw); PyObject *obctxt; - PVOID ctxt; if (!PyArg_ParseTuple(args, "O:CloseEncryptedFileRaw", &obctxt)) // @pyparm PyCObject|Context||Context object returned from <om win32file.OpenEncryptedFileRaw> return NULL; ! ctxt=PyCObject_AsVoidPtr(obctxt); ! if (ctxt==NULL) ! return NULL; // function has no return value, make sure to check for memory leaks! ! (*pfnCloseEncryptedFileRaw)(ctxt); Py_INCREF(Py_None); return Py_None; --- 4218,4239 ---- CHECK_PFN(CloseEncryptedFileRaw); PyObject *obctxt; if (!PyArg_ParseTuple(args, "O:CloseEncryptedFileRaw", &obctxt)) // @pyparm PyCObject|Context||Context object returned from <om win32file.OpenEncryptedFileRaw> return NULL; ! // We must nuke our ctxt in the CObject afer closing, else when the ! // object destructs and we attempt to close it a second time, Vista x64 ! // crashes. ! // So must bypass the CObject API for this. ! if (!PyCObject_Check(obctxt)) ! return PyErr_Format(PyExc_TypeError, "param must be handle to an encrypted file (got type %s)", obctxt->ob_type->tp_name); ! PyCObject *pcobj = (PyCObject *)obctxt; ! if (pcobj->destructor != encryptedfilecontextdestructor) ! return PyErr_Format(PyExc_TypeError, "param must be handle to an encrypted file (got a CObject with invalid destructor)"); ! if (!pcobj->cobject) ! return PyErr_Format(PyExc_ValueError, "This handle has already been closed"); ! // ok - close it, then nuke it. // function has no return value, make sure to check for memory leaks! ! (*pfnCloseEncryptedFileRaw)(pcobj->cobject); ! pcobj->cobject = 0; Py_INCREF(Py_None); return Py_None; *************** *** 5207,5225 **** %init %{ - #if (PY_VERSION_HEX < 0x03000000) - #define RETURN_ERROR return; - #else - #define RETURN_ERROR return NULL; - #endif - if (PyType_Ready(&FindFileIterator_Type) == -1 ||PyType_Ready(&PyDCB::type) == -1 ||PyType_Ready(&PyCOMSTAT::type) == -1) ! RETURN_ERROR; if (PyDict_SetItemString(d, "error", PyWinExc_ApiError) == -1) ! RETURN_ERROR; if (PyDict_SetItemString(d, "INVALID_HANDLE_VALUE", PyWinLong_FromHANDLE(INVALID_HANDLE_VALUE)) == -1) ! RETURN_ERROR; for (PyMethodDef *pmd = win32fileMethods;pmd->ml_name;pmd++) --- 5231,5243 ---- %init %{ if (PyType_Ready(&FindFileIterator_Type) == -1 ||PyType_Ready(&PyDCB::type) == -1 ||PyType_Ready(&PyCOMSTAT::type) == -1) ! PYWIN_MODULE_INIT_RETURN_ERROR; if (PyDict_SetItemString(d, "error", PyWinExc_ApiError) == -1) ! PYWIN_MODULE_INIT_RETURN_ERROR; if (PyDict_SetItemString(d, "INVALID_HANDLE_VALUE", PyWinLong_FromHANDLE(INVALID_HANDLE_VALUE)) == -1) ! PYWIN_MODULE_INIT_RETURN_ERROR; for (PyMethodDef *pmd = win32fileMethods;pmd->ml_name;pmd++) Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.118.2.3 retrieving revision 1.118.2.4 diff -C2 -d -r1.118.2.3 -r1.118.2.4 *** win32gui.i 11 Nov 2008 00:20:25 -0000 1.118.2.3 --- win32gui.i 11 Dec 2008 04:13:35 -0000 1.118.2.4 *************** *** 254,263 **** // Written to the module init function. %init %{ - #if (PY_VERSION_HEX < 0x03000000) - #define RETURN_ERROR return; - #else - #define RETURN_ERROR return NULL; - #endif - PyEval_InitThreads(); /* Start the interpreter's thread-awareness */ PyDict_SetItemString(d, "dllhandle", PyWinLong_FromVoidPtr(g_dllhandle)); --- 254,257 ---- *************** *** 267,271 **** PyType_Ready(&PyBITMAPType) == -1 || PyType_Ready(&PyLOGFONTType) == -1) ! RETURN_ERROR; // Expose the window procedure and window class dicts to aid debugging --- 261,265 ---- PyType_Ready(&PyBITMAPType) == -1 || PyType_Ready(&PyLOGFONTType) == -1) ! PYWIN_MODULE_INIT_RETURN_ERROR; // Expose the window procedure and window class dicts to aid debugging *************** *** 1608,1612 **** PyErr_SetString(PyExc_ValueError, "PyGetString: NULL is not valid pointer"); return NULL; ! } if (len != -1){ if (IsBadReadPtr(addr, len)) { --- 1602,1606 ---- PyErr_SetString(PyExc_ValueError, "PyGetString: NULL is not valid pointer"); return NULL; ! } if (len != -1){ if (IsBadReadPtr(addr, len)) { *************** *** 1615,1620 **** } return PyString_FromStringAndSize(addr, len); ! } // This should probably be in a __try just in case. return PyString_FromString(addr); } --- 1609,1618 ---- } return PyString_FromStringAndSize(addr, len); ! } // This should probably be in a __try just in case. + if (IsBadStringPtrA(addr, (DWORD_PTR)-1)) { + PyErr_SetString(PyExc_ValueError, "The value is not a valid null-terminated string"); + return NULL; + } return PyString_FromString(addr); } |
From: Mark H. <mha...@us...> - 2008-12-11 04:11:53
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26234 Modified Files: Tag: py3k PyHANDLE.cpp Log Message: add richcompare to handles Index: PyHANDLE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyHANDLE.cpp,v retrieving revision 1.16.2.5 retrieving revision 1.16.2.6 diff -C2 -d -r1.16.2.5 -r1.16.2.6 *** PyHANDLE.cpp 4 Dec 2008 00:07:22 -0000 1.16.2.5 --- PyHANDLE.cpp 11 Dec 2008 04:11:48 -0000 1.16.2.6 *************** *** 177,182 **** // @pymeth __str__|Used when a string representation is required PyHANDLE::strFunc, /* tp_str */ ! 0, /* tp_getattro */ ! 0, /* tp_setattro */ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ --- 177,182 ---- // @pymeth __str__|Used when a string representation is required PyHANDLE::strFunc, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyObject_GenericSetAttr, /* tp_setattro */ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ *************** *** 184,188 **** 0, /* tp_traverse */ 0, /* tp_clear */ ! 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ --- 184,188 ---- 0, /* tp_traverse */ 0, /* tp_clear */ ! PyHANDLE::richcompareFunc, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ *************** *** 274,277 **** --- 274,297 ---- } + PyObject *PyHANDLE::richcompare(PyObject *other, int op) + { + BOOL e; + if (PyHANDLE_Check(other)) + e=compare((PyHANDLE *)other)==0; + else + e=FALSE; + PyObject *ret; + if (op==Py_EQ) + ret = e ? Py_True : Py_False; + else if (op==Py_NE) + ret = !e ? Py_True : Py_False; + else { + PyErr_SetString(PyExc_TypeError, "HANDLEs only compare equal or not equal"); + ret = NULL; + } + Py_XINCREF(ret); + return ret; + } + // @pymethod |PyHANDLE|__int__|Used when the handle as an integer is required. // @comm To get the underling win32 handle from a PyHANDLE object, use int(handleObject) *************** *** 307,310 **** --- 327,335 ---- } + PyObject *PyHANDLE::richcompareFunc(PyObject *ob, PyObject *other, int op) + { + return ((PyHANDLE *)ob)->richcompare(other, op); + } + // @pymethod int|PyHANDLE|__hash__|Used when the hash value of a HANDLE object is required long PyHANDLE::hashFunc(PyObject *ob) |
From: Mark H. <mha...@us...> - 2008-12-11 03:45:52
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24262 Modified Files: Tag: py3k setup.py Log Message: enable more modules Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.81.2.9 retrieving revision 1.81.2.10 diff -C2 -d -r1.81.2.9 -r1.81.2.10 *** setup.py 11 Dec 2008 03:37:46 -0000 1.81.2.9 --- setup.py 11 Dec 2008 03:45:48 -0000 1.81.2.10 *************** *** 1935,1941 **** if is_py3k: py3k_skip_modules = \ ! """odbc win32evtlog win32print win32security win32inet adsi internet ! mapi bits ifilter isapi PyISAPI_loader ! """.split() ext_modules = [e for e in ext_modules if e.name not in py3k_skip_modules] --- 1935,1939 ---- if is_py3k: py3k_skip_modules = \ ! """win32security adsi mapi isapi PyISAPI_loader""".split() ext_modules = [e for e in ext_modules if e.name not in py3k_skip_modules] |