pywin32-checkins Mailing List for Python for Windows Extensions (Page 21)
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: Roger U. <ru...@us...> - 2009-02-02 17:25:54
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14142 Modified Files: win32apimodule.cpp Log Message: Add GetLastInputInfo Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** win32apimodule.cpp 27 Jan 2009 13:07:19 -0000 1.97 --- win32apimodule.cpp 2 Feb 2009 17:25:49 -0000 1.98 *************** *** 90,93 **** --- 90,97 ---- static RegOverridePredefKeyfunc pfnRegOverridePredefKey = NULL; + // from user32.dll + typedef BOOL (WINAPI *GetLastInputInfofunc)(PLASTINPUTINFO); + static GetLastInputInfofunc pfnGetLastInputInfo = NULL; + /* error helper */ PyObject *ReturnError(char *msg, char *fnName = NULL) *************** *** 1534,1537 **** --- 1538,1553 ---- } + // @pymethod int|win32api|GetLastInputInfo|Returns time of last input event in tick count + // @pyseeapi GetLastInputInfo + static PyObject *PyGetLastInputInfo(PyObject * self, PyObject * args) + { + CHECK_PFN(GetLastInputInfo); + LASTINPUTINFO lii; + lii.cbSize = sizeof(lii); + if (!(*pfnGetLastInputInfo)(&lii)) + return PyWin_SetAPIError("GetLastInputInfo"); + return PyLong_FromUnsignedLong(lii.dwTime); + } + // @pymethod string|win32api|GetLogicalDriveStrings|Returns a string with all logical drives currently mapped. static PyObject * PyGetLogicalDriveStrings (PyObject * self, PyObject *args) *************** *** 6191,6194 **** --- 6207,6211 ---- {"GetKeyState", PyGetKeyState, 1}, // @pymeth GetKeyState|Retrives the last known key state for a key. {"GetLastError", PyGetLastError, 1}, // @pymeth GetLastError|Retrieves the last error code known by the system. + {"GetLastInputInfo", PyGetLastInputInfo, METH_NOARGS}, // @pymeth GetLastInputInfo|Returns time of last input event in tick count {"GetLocalTime", PyGetLocalTime, 1}, // @pymeth GetLocalTime|Returns the current local time. // @pymeth GetLongPathName|Converts the specified path to its long form. *************** *** 6450,6453 **** --- 6467,6471 ---- pfnGetMonitorInfo=(GetMonitorInfofunc)GetProcAddress(hmodule, "GetMonitorInfo" A_OR_W); pfnEnumDisplaySettingsEx=(EnumDisplaySettingsExfunc)GetProcAddress(hmodule, "EnumDisplaySettingsEx" A_OR_W); + pfnGetLastInputInfo=(GetLastInputInfofunc)GetProcAddress(hmodule, "GetLastInputInfo"); } |
|
From: Roger U. <ru...@us...> - 2009-02-02 17:19:48
|
Update of /cvsroot/pywin32/pywin32/com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13142 Modified Files: internet.dsp Log Message: Fix format of project file - Somebody ignored the big # ** DO NOT EDIT ** at the top ;) Index: internet.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/internet.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** internet.dsp 2 Nov 2008 12:50:01 -0000 1.7 --- internet.dsp 2 Feb 2009 17:19:43 -0000 1.8 *************** *** 129,133 **** SOURCE=.\win32comext\internet\src\PyIInternetProtocolSink.cpp # End Source File ! # End Group SOURCE=.\win32comext\internet\src\PyIInternetSecurityManager.cpp --- 129,133 ---- SOURCE=.\win32comext\internet\src\PyIInternetProtocolSink.cpp # End Source File ! # Begin Source File SOURCE=.\win32comext\internet\src\PyIInternetSecurityManager.cpp |
|
From: Roger U. <ru...@us...> - 2009-02-02 15:54:37
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30356 Modified Files: win32file.i Log Message: In ConnectEx, allow port to be passed as Unicode Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** win32file.i 1 Feb 2009 21:11:01 -0000 1.102 --- win32file.i 2 Feb 2009 15:54:26 -0000 1.103 *************** *** 1793,1797 **** PyObject *hobj = NULL; PyObject *pobj = (PyObject *)NULL; ! TmpPyObject host_idna; struct addrinfo hints, *res; --- 1793,1797 ---- PyObject *hobj = NULL; PyObject *pobj = (PyObject *)NULL; ! TmpPyObject host_idna, port_idna; struct addrinfo hints, *res; *************** *** 1813,1825 **** return NULL; } ! if (PyInt_Check(pobj)) { ! PyOS_snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj)); ! pptr = pbuf; } else if (PyString_Check(pobj)) { pptr = PyString_AsString(pobj); ! } else if (pobj == Py_None) { ! pptr = (char *)NULL; } else { ! PyErr_SetString(PyExc_TypeError, "Int or String expected"); return NULL; } --- 1813,1831 ---- return NULL; } ! ! if (pobj == Py_None) { ! pptr = NULL; ! } else if (PyUnicode_Check(pobj)) { ! port_idna = PyObject_CallMethod(pobj, "encode", "s", "idna"); ! if (!port_idna) ! return NULL; ! pptr = PyString_AsString(port_idna); } else if (PyString_Check(pobj)) { pptr = PyString_AsString(pobj); ! } else if (PyInt_Check(pobj)) { ! PyOS_snprintf(pbuf, sizeof(pbuf), "%ld", PyInt_AsLong(pobj)); ! pptr = pbuf; } else { ! PyErr_SetString(PyExc_TypeError, "Port must be int, string, or None"); return NULL; } |
|
From: Mark H. <mha...@us...> - 2009-02-02 12:55:32
|
Update of /cvsroot/pywin32/pywin32/isapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11878 Modified Files: install.py Log Message: has_key -> in Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/install.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** install.py 28 Jan 2009 10:54:41 -0000 1.21 --- install.py 2 Feb 2009 12:55:28 -0000 1.22 *************** *** 421,425 **** for vd in params.VirtualDirs: for smp in vd.ScriptMaps: ! if not added.has_key(smp.Module) and smp.AddExtensionFile: _AddExtensionFile(smp.Module, vd.Name, vd.Description, smp, options) --- 421,425 ---- for vd in params.VirtualDirs: for smp in vd.ScriptMaps: ! if smp.Module not in added and smp.AddExtensionFile: _AddExtensionFile(smp.Module, vd.Name, vd.Description, smp, options) *************** *** 427,431 **** for fd in params.Filters: ! if not added.has_key(fd.Path) and fd.AddExtensionFile: _AddExtensionFile(fd.Path, fd.Name, fd.Description, fd, options) added[fd.Path] = True --- 427,431 ---- for fd in params.Filters: ! if fd.Path not in added and fd.AddExtensionFile: _AddExtensionFile(fd.Path, fd.Name, fd.Description, fd, options) added[fd.Path] = True *************** *** 443,452 **** for vd in params.VirtualDirs: for smp in vd.ScriptMaps: ! if not deleted.has_key(smp.Module) and smp.AddExtensionFile: _DeleteExtensionFileRecord(smp.Module, options) deleted[smp.Module] = True for filter_def in params.Filters: ! if not deleted.has_key(filter_def.Path) and filter_def.AddExtensionFile: _DeleteExtensionFileRecord(filter_def.Path, options) deleted[filter_def.Path] = True --- 443,452 ---- for vd in params.VirtualDirs: for smp in vd.ScriptMaps: ! if smp.Module not in deleted and smp.AddExtensionFile: _DeleteExtensionFileRecord(smp.Module, options) deleted[smp.Module] = True for filter_def in params.Filters: ! if filter_def.Path not in deleted and filter_def.AddExtensionFile: _DeleteExtensionFileRecord(filter_def.Path, options) deleted[filter_def.Path] = True |
|
From: Mark H. <mha...@us...> - 2009-02-02 06:51:59
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12260 Modified Files: setup.py Log Message: specify explicit file extensions in all our data files Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** setup.py 28 Jan 2009 10:54:06 -0000 1.96 --- setup.py 2 Feb 2009 06:51:54 -0000 1.97 *************** *** 1,3 **** ! build_id="212.6" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="212.7" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) *************** *** 2089,2104 **** 'pythonwin/license.txt', 'win32/license.txt', ! 'win32/scripts/*', ! 'win32/test/*', ! 'win32/Demos/*', 'com/win32com/readme.htm', # win32com test utility files. ! 'com/win32com/test/*', # win32com docs ! 'com/win32com/HTML/*', ! 'com/win32comext/adsi/demos/*', # Active Scripting test and demos. ! 'com/win32comext/axscript/test/*', ! 'com/win32comext/axscript/Demos/*', 'com/win32comext/mapi/demos/*.py', 'com/win32comext/propsys/test/*.py', --- 2089,2117 ---- 'pythonwin/license.txt', 'win32/license.txt', ! 'win32/scripts/*.py', ! 'win32/test/*.py', ! 'win32/Demos/*.py', 'com/win32com/readme.htm', # win32com test utility files. ! 'com/win32com/test/*.idl', ! 'com/win32com/test/*.js', ! 'com/win32com/test/*.sct', ! 'com/win32com/test/*.tlb', ! 'com/win32com/test/*.txt', ! 'com/win32com/test/*.vbs', ! 'com/win32com/test/*.xsl', # win32com docs ! 'com/win32com/HTML/*.html', ! 'com/win32com/HTML/image/*.gif', ! 'com/win32comext/adsi/demos/*.py', # Active Scripting test and demos. ! 'com/win32comext/axscript/test/*.html', ! 'com/win32comext/axscript/test/*.py', ! 'com/win32comext/axscript/test/*.pys', ! 'com/win32comext/axscript/test/*.vbs', ! 'com/win32comext/axscript/Demos/*.pys', ! 'com/win32comext/axscript/Demos/*.htm*', ! 'com/win32comext/axscript/Demos/*.gif', ! 'com/win32comext/axscript/Demos/*.asp', 'com/win32comext/mapi/demos/*.py', 'com/win32comext/propsys/test/*.py', |
|
From: Vernon C. <kf...@us...> - 2009-02-02 03:48:48
|
Update of /cvsroot/pywin32/pywin32/adodbapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29916 Modified Files: adodbapi.py readme.txt Log Message: adodbapi v2.2.6 works with Python 3.0 (after 2to3) Index: adodbapi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/adodbapi.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** adodbapi.py 8 Dec 2008 18:13:53 -0000 1.6 --- adodbapi.py 2 Feb 2009 03:48:41 -0000 1.7 *************** *** 1,3 **** ! """adodbapi v2.2.4 - A python DB API 2.0 interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund --- 1,3 ---- ! """adodbapi v2.2.6 - A python DB API 2.0 interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund *************** *** 29,33 **** import string - import exceptions import time import calendar --- 29,32 ---- *************** *** 38,41 **** --- 37,46 ---- try: + from exceptions import StandardError as _BaseException + except ImportError: + # py3k + _BaseException = Exception + + try: import decimal except ImportError: #perhaps running Cpython 2.3 *************** *** 60,63 **** --- 65,69 ---- else: #pywin32 import pythoncom + import pywintypes pythoncom.__future_currency__ = True def Dispatch(dispatch): *************** *** 66,70 **** return obj(index) DBNull = type(None) ! DateTime = type(NotImplemented) #impossible value # --- define objects to smooth out Python3000 <-> Python 2.x differences --- 72,76 ---- return obj(index) DBNull = type(None) ! DateTime = type(NotImplemented) #impossible value # --- define objects to smooth out Python3000 <-> Python 2.x differences *************** *** 74,79 **** if sys.version[0] == '3': StringTypes = [str] else: ! memoryview = buffer bytes = str StringTypes = types.StringTypes # will be messed up by 2to3 but never used --- 80,86 ---- if sys.version[0] == '3': StringTypes = [str] + makeByteBuffer = bytes else: ! makeByteBuffer = buffer bytes = str StringTypes = types.StringTypes # will be messed up by 2to3 but never used *************** *** 152,156 **** def DateObjectFromCOMDate(self,comDate): #ComDate is number of days since 1899-12-31 ! if isinstance(comDate,DateTime): fComDate = comDate.ToOADate() else: --- 159,165 ---- def DateObjectFromCOMDate(self,comDate): #ComDate is number of days since 1899-12-31 ! if isinstance(comDate,datetime.datetime): ! return comDate.replace(tzinfo=None) # make non aware ! elif isinstance(comDate,DateTime): fComDate = comDate.ToOADate() else: *************** *** 187,190 **** --- 196,201 ---- if isinstance(obj,datetime.datetime): s = obj.strftime('%Y-%m-%d %H:%M:%S') + elif isinstance(obj,datetime.date): #exact midnight + s = obj.strftime('%Y-%m-%d 00:00:00') else: try: #usually datetime.datetime *************** *** 197,204 **** def __init__(self): TimeConverter.__init__(self) ! if onIronPython: ! def COMDate(self,timeobj): ! return self.COMDateFromTuple(timeobj) ! def COMDateFromTuple(self,t): d = datetime.date(t[0],t[1],t[2]) integerPart = d.toordinal() - self._ordinal_1899_12_31 --- 208,214 ---- def __init__(self): TimeConverter.__init__(self) ! def COMDate(self,timeobj): ! return self.COMDateFromTuple(timeobj) ! def COMDateFromTuple(self,t): d = datetime.date(t[0],t[1],t[2]) integerPart = d.toordinal() - self._ordinal_1899_12_31 *************** *** 206,219 **** fractPart = sec / 86400.0 return integerPart + fractPart ! else: #pywin32 ! def COMDate(self,timeobj): ! return float(pythoncom.MakeTime(time.mktime(timeobj))) ! def COMDateFromTuple(self,YMDHMSmsTuple): ! t=pythoncom.MakeTime(YMDHMSmsTuple) ! return float(t) ! def DateObjectFromCOMDate(self,comDate): 'Returns ticks since 1970' ! if isinstance(comDate,DateTime): fcomDate = comDate.ToOADate() else: --- 216,225 ---- fractPart = sec / 86400.0 return integerPart + fractPart ! def DateObjectFromCOMDate(self,comDate): 'Returns ticks since 1970' ! if isinstance(comDate,datetime.datetime): ! return comDate.timetuple() ! elif isinstance(comDate,DateTime): fcomDate = comDate.ToOADate() else: *************** *** 240,244 **** return s ! class Error(exceptions.StandardError): pass #Exception that is the base class of all other error #exceptions. You can use this to catch all errors with one --- 246,250 ---- return s ! class Error(_BaseException): pass #Exception that is the base class of all other error #exceptions. You can use this to catch all errors with one *************** *** 248,252 **** #module exceptions). ! class Warning(exceptions.StandardError): pass --- 254,258 ---- #module exceptions). ! class Warning(_BaseException): pass *************** *** 342,348 **** class Connection(object): ! from adodbapi import Warning, Error, InterfaceError, DataError, \ ! DatabaseError, OperationalError, IntegrityError, InternalError, \ ! NotSupportedError, ProgrammingError #required by api definition def __init__(self,adoConn): self.adoConn=adoConn --- 348,363 ---- class Connection(object): ! # include connection attributes required by api definition. ! Warning = Warning ! Error = Error ! InterfaceError = InterfaceError ! DataError = DataError ! DatabaseError = DatabaseError ! OperationalError = OperationalError ! IntegrityError = IntegrityError ! InternalError = InternalError ! NotSupportedError = NotSupportedError ! ProgrammingError = ProgrammingError ! def __init__(self,adoConn): self.adoConn=adoConn *************** *** 487,491 **** ## The attribute is -1 in case no executeXXX() has been performed on the cursor or ## the rowcount of the last operation is not determinable by the interface.[7] - ## N.O.T.E. -- adodbapi returns "-1" by default for all select statements arraysize=1 --- 502,505 ---- *************** *** 544,550 **** def _makeDescriptionFromRS(self,rs): self.rs = rs #v2.1.1 bkline ! if (rs == None) or (rs.State == adStateClosed): ! ##self.rs=None #removed v2.1.1 bkline ! self.description=None else: # Since the current implementation has a forward-only cursor, RecordCount will always return -1 --- 558,565 ---- def _makeDescriptionFromRS(self,rs): self.rs = rs #v2.1.1 bkline ! if not rs: ! self.description = None ! elif rs.State == adStateClosed: ! self.description = None else: # Since the current implementation has a forward-only cursor, RecordCount will always return -1 *************** *** 701,707 **** ra = Reference[int]() rs = self.cmd.Execute(ra) ! adoRetVal=(rs,ra.Value) #return a tuple like win32 does else: #pywin32 ! adoRetVal=self.cmd.Execute() # ----- ------------------------------- --- except Exception, e: --- 716,722 ---- ra = Reference[int]() rs = self.cmd.Execute(ra) ! count = ra.Value else: #pywin32 ! rs, count = self.cmd.Execute() # ----- ------------------------------- --- except Exception, e: *************** *** 717,725 **** return - rs=adoRetVal[0] try: self.rowcount = rs.RecordCount except: ! self.rowcount = adoRetVal[1] self._makeDescriptionFromRS(rs) --- 732,739 ---- return try: self.rowcount = rs.RecordCount except: ! self.rowcount = count self._makeDescriptionFromRS(rs) *************** *** 788,792 **** self._raiseCursorError(Error,None) return ! if rs == None or rs.State == adStateClosed: #v2.1.1 bkline self._raiseCursorError(Error,None) return --- 802,806 ---- self._raiseCursorError(Error,None) return ! if not rs or rs.State == adStateClosed: #v2.1.1 bkline self._raiseCursorError(Error,None) return *************** *** 878,885 **** """ self.messages=[] ! if self.conn == None: self._raiseCursorError(Error,None) return ! if self.rs == None: self._raiseCursorError(Error,None) return --- 892,899 ---- """ self.messages=[] ! if not self.conn: self._raiseCursorError(Error,None) return ! if not self.rs: self._raiseCursorError(Error,None) return *************** *** 956,960 **** def Binary(aString): """This function constructs an object capable of holding a binary (long) string value. """ ! return memoryview(aString) #v2.1 Cole comment out: BinaryType = Binary('a') --- 970,974 ---- def Binary(aString): """This function constructs an object capable of holding a binary (long) string value. """ ! return makeByteBuffer(aString) #v2.1 Cole comment out: BinaryType = Binary('a') *************** *** 1145,1152 **** self.values = valuesTuple ! def __cmp__(self,other): ! if other in self.values: ! return 0 ! return 1 adoIntegerTypes=(adInteger,adSmallInt,adTinyInt,adUnsignedInt, --- 1159,1164 ---- self.values = valuesTuple ! def __eq__(self,other): ! return other in self.values adoIntegerTypes=(adInteger,adSmallInt,adTinyInt,adUnsignedInt, *************** *** 1192,1196 **** typeMap[bytes] = adBSTR, # 2.x string type else: #python 3.0 integrated integers ! ## Should this differentiote between an int that fits ion an long and one that requires 64 bit datatype? typeMap[int] = adBigInt --- 1204,1208 ---- typeMap[bytes] = adBSTR, # 2.x string type else: #python 3.0 integrated integers ! ## Should this differentiote between an int that fits in a long and one that requires 64 bit datatype? typeMap[int] = adBigInt *************** *** 1247,1251 **** def cvtBuffer(variant): ! return memoryview(variant) def cvtUnicode(variant): --- 1259,1263 ---- def cvtBuffer(variant): ! return makeByteBuffer(variant) def cvtUnicode(variant): Index: readme.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/readme.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** readme.txt 8 Dec 2008 18:13:53 -0000 1.6 --- readme.txt 2 Feb 2009 03:48:41 -0000 1.7 *************** *** 31,38 **** adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.cvtFloat or: ! adodbapi.variantConversions[adodbapi.adNumeric] = my_convertion_function ............ Whats new in version 2.2.4 1. Ready for Python3? -- refactored so that 2to3 will inject very few errors, seems to be almost runnable in Pyk3. What happened to version 2.2.3? --- 31,51 ---- adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.cvtFloat or: ! adodbapi.variantConversions[adodbapi.adNumeric] = write_your_own_convertion_function ............ + Whats new in version 2.2.6 + 1. Actually works in Python 3.0 (using pywin32 212.6) after running thru 2to3 + 2. (Produces an error in dbapi20 test when trying adodbapi.Buffer('This is a string') in Python 3.0) + 3. When a value with an exact midnight time is retrieved from a DATETIME column, return a datetime.datetime, + not a datetime.date. + + Whats new in version 2.2.5 + 1. Exception definition cleanups for for Python 3.0 readiness [Mark Hammond] + 2. Remove depreciated pythoncom.MakeTime calls (now uses pywintypes.Time) + 3. Change tests to default to local SQL server. + 4. Add an access-type database file for demo use. + Whats new in version 2.2.4 1. Ready for Python3? -- refactored so that 2to3 will inject very few errors, seems to be almost runnable in Pyk3. + 2. Use new function getIndexedValue() to hide differences between IronPython and pywin32. What happened to version 2.2.3? *************** *** 122,126 **** Relase history -------------- ! 2.2.2 Iron Python support complete. 2.2.1 Bugfix for string truncation 2.2 Code cleanup. added feature: "adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.cvtString" --- 135,141 ---- Relase history -------------- ! 2.2.4 Ready for 2to3 convertion. Refactor to be more readable. Added function getIndexedValue() for IPy 2.0. ! 2.2.3 (withdrawn) ! 2.2.2 Iron Python support complete. 2.2.1 Bugfix for string truncation 2.2 Code cleanup. added feature: "adodbapi.variantConversions[adodbapi.adNumeric] = adodbapi.cvtString" |
|
From: Vernon C. <kf...@us...> - 2009-02-02 03:48:48
|
Update of /cvsroot/pywin32/pywin32/adodbapi/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29916/tests Modified Files: adodbapitest.py adodbapitestconfig.py db_print.py dbapi20.py test_adodbapi_dbapi20.py Added Files: test.mdb Log Message: adodbapi v2.2.6 works with Python 3.0 (after 2to3) Index: adodbapitest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitest.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** adodbapitest.py 8 Dec 2008 18:13:53 -0000 1.7 --- adodbapitest.py 2 Feb 2009 03:48:41 -0000 1.8 *************** *** 1,3 **** ! """ Unit tests for adodbapi version 2.2.4""" """ adodbapi - A python DB API 2.0 interface to Microsoft ADO --- 1,3 ---- ! """ Unit tests for adodbapi version 2.2.6""" """ adodbapi - A python DB API 2.0 interface to Microsoft ADO *************** *** 25,28 **** --- 25,29 ---- import unittest + import sys try: *************** *** 274,280 **** pass #self.helpTestDataType("BLOB",'BINARY',adodbapi.Binary('\x00\x01\xE2\x40')) else: ! self.helpTestDataType("binary(4)",'BINARY',adodbapi.Binary('\x00\x01\xE2\x40')) ! self.helpTestDataType("varbinary(100)",'BINARY',adodbapi.Binary('\x00\x01\xE2\x40')) ! self.helpTestDataType("image",'BINARY',adodbapi.Binary('\x00\x01\xE2\x40')) def helpRollbackTblTemp(self): --- 275,283 ---- pass #self.helpTestDataType("BLOB",'BINARY',adodbapi.Binary('\x00\x01\xE2\x40')) else: ! # python 3.0 syntax -> binfld = b'\x00\x01\xE2\x40' ! binfld = '\x00\x01\xE2\x40' ! self.helpTestDataType("binary(4)",'BINARY',adodbapi.Binary(binfld)) ! self.helpTestDataType("varbinary(100)",'BINARY',adodbapi.Binary(binfld)) ! self.helpTestDataType("image",'BINARY',adodbapi.Binary(binfld)) def helpRollbackTblTemp(self): Index: adodbapitestconfig.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitestconfig.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** adodbapitestconfig.py 8 Dec 2008 18:13:53 -0000 1.6 --- adodbapitestconfig.py 2 Feb 2009 03:48:41 -0000 1.7 *************** *** 1,4 **** # Configure this in order to run the testcases. ! "adodbapitestconfig.py v 2.2.4" import os --- 1,4 ---- # Configure this in order to run the testcases. ! "adodbapitestconfig.py v 2.2.5" import os *************** *** 80,89 **** if doSqlServerTest: ! _computername="franklin" #or name of computer with SQL Server _databasename="Northwind" #or something else ! _username="guest" ! _password="12345678" ! #connStrSQLServer = r"Provider=SQLOLEDB.1; Integrated Security=SSPI; Initial Catalog=%s;Data Source=%s" %(_databasename, _computername) ! connStrSQLServer = r"Provider=SQLOLEDB.1; User ID=%s; Password=%s; Initial Catalog=%s;Data Source=%s" %(_username,_password,_databasename, _computername) print ' ...Testing MS-SQL login...' try: --- 80,89 ---- if doSqlServerTest: ! _computername=".\SQLEXPRESS" #or name of computer with SQL Server _databasename="Northwind" #or something else ! #_username="guest" ! #_password="12345678" ! connStrSQLServer = r"Provider=SQLOLEDB.1; Integrated Security=SSPI; Initial Catalog=%s;Data Source=%s" %(_databasename, _computername) ! #connStrSQLServer = r"Provider=SQLOLEDB.1; User ID=%s; Password=%s; Initial Catalog=%s;Data Source=%s" %(_username,_password,_databasename, _computername) print ' ...Testing MS-SQL login...' try: *************** *** 91,101 **** s.close() except adodbapi.DatabaseError, inst: ! print inst.args[0][2] # should be the error message doSqlServerTest = False if doMySqlTest: ! _computername='wciptest' _databasename='test' ! _username = 'test' _password = '12345678' _driver="MySQL ODBC 5.1 Driver" # or _driver="MySQL ODBC 3.51 Driver" --- 91,101 ---- s.close() except adodbapi.DatabaseError, inst: ! print inst.args[0] # should be the error message doSqlServerTest = False if doMySqlTest: ! _computername='192.168.1.1' _databasename='test' ! _username = 'Test' _password = '12345678' _driver="MySQL ODBC 5.1 Driver" # or _driver="MySQL ODBC 3.51 Driver" *************** *** 107,110 **** s.close() except adodbapi.DatabaseError, inst: ! print inst.args[0][2] # should be the error message doMySqlTest = False --- 107,110 ---- s.close() except adodbapi.DatabaseError, inst: ! print inst.args[0] # should be the error message doMySqlTest = False Index: dbapi20.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/dbapi20.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dbapi20.py 1 Oct 2008 14:44:53 -0000 1.2 --- dbapi20.py 2 Feb 2009 03:48:41 -0000 1.3 *************** *** 18,25 **** import unittest import time # $Log$ ! # Revision 1.2 2008/10/01 14:44:53 mhammond ! # Move to 'new style' exception raising. # # Revision 1.1.1.1 2008/01/04 18:49:10 kf7xm --- 18,30 ---- import unittest import time + import sys # $Log$ ! # Revision 1.3 2009/02/02 03:48:41 kf7xm ! # adodbapi v2.2.6 works with Python 3.0 (after 2to3) ! # ! # Revision 1.1.1.1.2.1 2008/09/20 19:54:59 rupole ! # Include latest changes from main branch ! # Updates for py3k # # Revision 1.1.1.1 2008/01/04 18:49:10 kf7xm *************** *** 182,192 **** # Make sure required exceptions exist, and are in the # defined heirarchy. ! self.failUnless(issubclass(self.driver.Warning,StandardError)) ! self.failUnless(issubclass(self.driver.Error,StandardError)) ! self.failUnless( ! issubclass(self.driver.InterfaceError,self.driver.Error) ! ) self.failUnless( ! issubclass(self.driver.DatabaseError,self.driver.Error) ) self.failUnless( --- 187,200 ---- # Make sure required exceptions exist, and are in the # defined heirarchy. ! if sys.version[0] == '3': #under Python 3 StardardError no longer exists ! self.failUnless(issubclass(self.driver.Warning,Exception)) ! self.failUnless(issubclass(self.driver.Error,Exception)) ! else: ! self.failUnless(issubclass(self.driver.Warning,StandardError)) ! self.failUnless(issubclass(self.driver.Error,StandardError)) ! self.failUnless( ! issubclass(self.driver.InterfaceError,self.driver.Error)) ! self.failUnless( issubclass(self.driver.DatabaseError,self.driver.Error) ) self.failUnless( *************** *** 709,713 **** ''' Should create a procedure called deleteme that returns two result sets, first the ! number of rows in booze then "name from booze" ''' raise NotImplementedError('Helper not implemented') --- 717,721 ---- ''' Should create a procedure called deleteme that returns two result sets, first the ! number of rows in booze then "name from booze" ''' raise NotImplementedError('Helper not implemented') *************** *** 791,795 **** def test_setoutputsize(self): # Real test for setoutputsize is driver dependant ! raise NotImplementedError('Driver need to override this test') def test_None(self): --- 799,803 ---- def test_setoutputsize(self): # Real test for setoutputsize is driver dependant ! raise NotImplementedError('Driver needed to override this test') def test_None(self): *************** *** 855,857 **** 'module.ROWID must be defined.' ) - --- 863,864 ---- Index: db_print.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/db_print.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_print.py 11 Nov 2008 23:54:30 -0000 1.2 --- db_print.py 2 Feb 2009 03:48:41 -0000 1.3 *************** *** 4,35 **** adodbapi.adodbapi.verbose = True # adds details to the sample printout - _computername="franklin" #or name of computer with SQL Server - _databasename="Northwind" #or something else - _username="guest" - _password='12345678' - - _table_name= 'Products' - # connection string templates from http://www.connectionstrings.com ! ! # Switch test providers by changing the "if False" below # connection string for an Access data table: ! if False: ! _databasename = "C:/adodbapi-2.1/tests/Test.mdb" # generic -> 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s; User Id=%s; Password=%s;' % (_databasename, _username, _password) constr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s' \ % _databasename ! _table_name= 'Test_tbl' ! ! if False: ! # this will open a MS-SQL table with Windows authentication ! constr = r"Initial Catalog=%s; Data Source=%s; Provider=SQLOLEDB.1; Integrated Security=SSPI" %(_databasename, _computername) ! # this set opens a MS-SQL table with SQL authentication ! if True: ! constr = r"Provider=SQLOLEDB.1; Initial Catalog=%s; Data Source=%s; user ID=%s; Password=%s; " \ % (_databasename, _computername, _username, _password) ! # connection string for MySQL if False: --- 4,35 ---- adodbapi.adodbapi.verbose = True # adds details to the sample printout # connection string templates from http://www.connectionstrings.com ! # Switch test providers by changing the "if True" below # connection string for an Access data table: ! if True: ! _databasename = "Test.mdb" # generic -> 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s; User Id=%s; Password=%s;' % (_databasename, _username, _password) constr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s' \ % _databasename ! _table_name= 'Products' ! #---------- ! else: ! # connection string for an SQL server ! _computername="127.0.0.1" #or name of computer with SQL Server ! _databasename="Northwind" #or something else ! _table_name= 'Products' ! if True: ! # this will open a MS-SQL table with Windows authentication ! constr = r"Initial Catalog=%s; Data Source=%s; Provider=SQLOLEDB.1; Integrated Security=SSPI" \ ! %(_databasename, _computername) ! else: ! _username="guest" ! _password='12345678' ! # this set opens a MS-SQL table with SQL authentication ! constr = r"Provider=SQLOLEDB.1; Initial Catalog=%s; Data Source=%s; user ID=%s; Password=%s; " \ % (_databasename, _computername, _username, _password) ! #----------------------- # connection string for MySQL if False: *************** *** 40,56 **** % (_computername,_databasename) _table_name= 'Test_tbl' ! # connection string for AS400 if False: - _computername = "PEPPER" - _databasename = 'CMSDTA00' constr = "Provider=IBMDA400; DATA SOURCE=%s;DEFAULT COLLECTION=%s;User ID=%s;Password=%s" \ % (_computername, _databasename, _username, _password) # NOTE! user's PC must have OLE support installed in IBM Client Access Express ! _table_name= 'CSPCM' ! #tell the server we are not planning to update... adodbapi.adodbapi.defaultIsolationLevel = adodbapi.adodbapi.adXactBrowse ! #and we want a local cursor adodbapi.adodbapi.defaultCursorLocation = adodbapi.adodbapi.adUseClient --- 40,55 ---- % (_computername,_databasename) _table_name= 'Test_tbl' ! #----------- # connection string for AS400 if False: constr = "Provider=IBMDA400; DATA SOURCE=%s;DEFAULT COLLECTION=%s;User ID=%s;Password=%s" \ % (_computername, _databasename, _username, _password) # NOTE! user's PC must have OLE support installed in IBM Client Access Express ! #----------------- ! #tell the server we are not planning to update... adodbapi.adodbapi.defaultIsolationLevel = adodbapi.adodbapi.adXactBrowse ! ! #and we want a local cursor (so that we will have an accurate rowcount) adodbapi.adodbapi.defaultCursorLocation = adodbapi.adodbapi.adUseClient --- NEW FILE: test.mdb --- (This appears to be a binary file; contents omitted.) Index: test_adodbapi_dbapi20.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/test_adodbapi_dbapi20.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_adodbapi_dbapi20.py 8 Dec 2008 18:13:53 -0000 1.3 --- test_adodbapi_dbapi20.py 2 Feb 2009 03:48:41 -0000 1.4 *************** *** 3,17 **** import dbapi20 - print "Tested with dbapi20 %s" % dbapi20.__version__ import unittest ! import adodbapitestconfig import adodbapi ! import string class test_adodbapi(dbapi20.DatabaseAPI20Test): driver = adodbapi ! connect_args = (adodbapitestconfig.connStrSQLServer,) connect_kw_args = {} --- 3,36 ---- import dbapi20 import unittest + import os, sys, string ! #attempt to find adodbapi in this directory's parent ! cwd = os.getcwd() ! adoPath = os.path.normpath(cwd + '/../adodbapi.py') ! if os.path.exists(adoPath): ! if adoPath not in sys.path: ! sys.path.insert(1,os.path.dirname(adoPath)) import adodbapi ! print adodbapi.version ! print "Tested with dbapi20 %s" % dbapi20.__version__ ! ! _computername=".\SQLEXPRESS" #or name of computer with SQL Server ! _databasename="Northwind" #or something else ! connStr = r"Provider=SQLOLEDB.1; Integrated Security=SSPI; Initial Catalog=%s;Data Source=%s" %(_databasename, _computername) ! #connStr = r"Provider=SQLOLEDB.1; User ID=%s; Password=%s; Initial Catalog=%s;Data Source=%s" %(_username,_password,_databasename, _computername) ! ! print ' ...Testing MS-SQL login...' ! try: ! s = adodbapi.connect(connStr) #connect to server ! s.close() ! except adodbapi.DatabaseError, inst: ! print inst.args[0] # should be the error message ! sys.exit(1) class test_adodbapi(dbapi20.DatabaseAPI20Test): driver = adodbapi ! connect_args = (connStr,) connect_kw_args = {} |
|
From: Mark H. <mha...@us...> - 2009-02-02 03:31:37
|
Update of /cvsroot/pywin32/pywin32/SWIG In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28675 Modified Files: swig_py3k.exe Log Message: fix py3k version of swig after setting binary mode Index: swig_py3k.exe =================================================================== RCS file: /cvsroot/pywin32/pywin32/SWIG/swig_py3k.exe,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsuVNe6o and /tmp/cvsYx9v3y differ |
|
From: Roger U. <ru...@us...> - 2009-02-01 21:11:10
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8527 Modified Files: win32file.i Log Message: Fix refcount leak in ConnectEx Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** win32file.i 1 Feb 2009 17:12:49 -0000 1.101 --- win32file.i 1 Feb 2009 21:11:01 -0000 1.102 *************** *** 1793,1797 **** PyObject *hobj = NULL; PyObject *pobj = (PyObject *)NULL; ! PyObject *idna = NULL; struct addrinfo hints, *res; --- 1793,1797 ---- PyObject *hobj = NULL; PyObject *pobj = (PyObject *)NULL; ! TmpPyObject host_idna; struct addrinfo hints, *res; *************** *** 1802,1809 **** hptr = NULL; } else if (PyUnicode_Check(hobj)) { ! idna = PyObject_CallMethod(hobj, "encode", "s", "idna"); ! if (!idna) return NULL; ! hptr = PyString_AsString(idna); } else if (PyString_Check(hobj)) { hptr = PyString_AsString(hobj); --- 1802,1809 ---- hptr = NULL; } else if (PyUnicode_Check(hobj)) { ! host_idna = PyObject_CallMethod(hobj, "encode", "s", "idna"); ! if (!host_idna) return NULL; ! hptr = PyString_AsString(host_idna); } else if (PyString_Check(hobj)) { hptr = PyString_AsString(hobj); |
|
From: Roger U. <ru...@us...> - 2009-02-01 17:26:51
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12016 Modified Files: PyWinTypes.h odbc.cpp Log Message: Move TmpPyObject into PyWinTypes.h Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** odbc.cpp 8 Jan 2009 02:56:17 -0000 1.30 --- odbc.cpp 1 Feb 2009 17:26:47 -0000 1.31 *************** *** 846,866 **** } - // Class to hold a temporary reference that decrements itself - class TmpPyObject - { - public: - PyObject *tmp; - TmpPyObject() { tmp=NULL; } - TmpPyObject(PyObject *ob) { tmp=ob; } - PyObject * operator= (PyObject *ob){ - Py_XDECREF(tmp); - tmp=ob; - return tmp; - } - - boolean operator== (PyObject *ob) { return tmp==ob; } - operator PyObject *() { return tmp; } - ~TmpPyObject() { Py_XDECREF(tmp); } - }; static int ibindDate(cursorObject*cur, int column, PyObject *item) --- 846,849 ---- Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** PyWinTypes.h 26 Jan 2009 00:47:31 -0000 1.62 --- PyWinTypes.h 1 Feb 2009 17:26:47 -0000 1.63 *************** *** 919,922 **** --- 919,940 ---- // End of exception helper macros. + // Class to hold a temporary reference that decrements itself + class TmpPyObject + { + public: + PyObject *tmp; + TmpPyObject() { tmp=NULL; } + TmpPyObject(PyObject *ob) { tmp=ob; } + PyObject * operator= (PyObject *ob){ + Py_XDECREF(tmp); + tmp=ob; + return tmp; + } + + boolean operator== (PyObject *ob) { return tmp==ob; } + operator PyObject *() { return tmp; } + ~TmpPyObject() { Py_XDECREF(tmp); } + }; + #endif // __PYWINTYPES_H__ |
|
From: Roger U. <ru...@us...> - 2009-02-01 17:12:58
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10945 Modified Files: win32file.i Log Message: In ConnectEx, free the result of getaddrinfo Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** win32file.i 1 Feb 2009 16:50:36 -0000 1.100 --- win32file.i 1 Feb 2009 17:12:49 -0000 1.101 *************** *** 1849,1852 **** --- 1849,1853 ---- if (!PyWinObject_AsOVERLAPPED(obOverlapped, &pOverlapped)) { + freeaddrinfo(res); return NULL; } *************** *** 1857,1860 **** --- 1858,1862 ---- rc=WSAGetLastError(); Py_END_ALLOW_THREADS; + freeaddrinfo(res); if (rc==0 || rc == ERROR_IO_PENDING) return Py_BuildValue("ii", rc, sent); |
|
From: Roger U. <ru...@us...> - 2009-02-01 16:50:42
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8846 Modified Files: win32file.i Log Message: In ConnectEx, incorporate changes from latest version of patch Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** win32file.i 26 Jan 2009 00:47:31 -0000 1.99 --- win32file.i 1 Feb 2009 16:50:36 -0000 1.100 *************** *** 1825,1832 **** } memset(&hints, 0, sizeof(hints)); ! hints.ai_family = AF_INET; ! hints.ai_socktype = SOCK_STREAM; ! hints.ai_protocol = IPPROTO_TCP; error = getaddrinfo(hptr, pptr, &hints, &res); if (error) --- 1825,1842 ---- } + WSAPROTOCOL_INFO prot_info; + int prot_info_len = sizeof(WSAPROTOCOL_INFO); + error = getsockopt(sConnecting, SOL_SOCKET, SO_PROTOCOL_INFO, + (char*)&prot_info, &prot_info_len); + if (error) + { + PyWin_SetAPIError("getsockopt", WSAGetLastError()); + return NULL; + } + memset(&hints, 0, sizeof(hints)); ! hints.ai_family = prot_info.iAddressFamily; ! hints.ai_socktype = prot_info.iSocketType; ! hints.ai_protocol = prot_info.iProtocol; error = getaddrinfo(hptr, pptr, &hints, &res); if (error) |
|
From: Mark H. <mha...@us...> - 2009-02-01 03:23:43
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18710 Modified Files: control.py Log Message: Use SCI_GETTEXTLENGTH instead of WM_GETTEXTLENGTH as apparently Windows will "helpfully" change the result of the latter when Asian languages are set as the default locale causing scintilla to crash. Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** control.py 31 Jan 2009 03:51:08 -0000 1.22 --- control.py 1 Feb 2009 03:23:37 -0000 1.23 *************** *** 344,351 **** def GetTextLength(self): ! return self.SendScintilla(win32con.WM_GETTEXTLENGTH) def GetTextRange(self, start = 0, end = -1, decode = True): ! if end == -1: end = self.SendScintilla(win32con.WM_GETTEXTLENGTH) assert end>=start, "Negative index requested (%d/%d)" % (start, end) assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" --- 344,351 ---- def GetTextLength(self): ! return self.SendScintilla(scintillacon.SCI_GETTEXTLENGTH) def GetTextRange(self, start = 0, end = -1, decode = True): ! if end == -1: end = self.SendScintilla(scintillacon.SCI_GETTEXTLENGTH) assert end>=start, "Negative index requested (%d/%d)" % (start, end) assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:56:10
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32042/pywin/scintilla Modified Files: view.py Log Message: nuke a few dangling references to is_platform_unicode and default_platform_encoding Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** view.py 31 Jan 2009 03:08:05 -0000 1.34 --- view.py 31 Jan 2009 05:56:01 -0000 1.35 *************** *** 20,25 **** import os - from pywin import is_platform_unicode - PRINTDLGORD = 1538 IDC_PRINT_MAG_EDIT = 1010 --- 20,23 ---- |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:56:06
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32042/pywin/framework Modified Files: winout.py Log Message: nuke a few dangling references to is_platform_unicode and default_platform_encoding Index: winout.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/winout.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** winout.py 14 Nov 2008 00:22:25 -0000 1.15 --- winout.py 31 Jan 2009 05:56:01 -0000 1.16 *************** *** 43,47 **** import pywin.scintilla.document from pywin.scintilla import scintillacon ! from pywin import is_platform_unicode, default_platform_encoding, default_scintilla_encoding WindowOutputDocumentParent=pywin.scintilla.document.CScintillaDocument --- 43,47 ---- import pywin.scintilla.document from pywin.scintilla import scintillacon ! from pywin import default_scintilla_encoding WindowOutputDocumentParent=pywin.scintilla.document.CScintillaDocument |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:56:06
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32042/pywin Modified Files: __init__.py Log Message: nuke a few dangling references to is_platform_unicode and default_platform_encoding Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/__init__.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** __init__.py 14 Nov 2008 00:22:25 -0000 1.5 --- __init__.py 31 Jan 2009 05:56:01 -0000 1.6 *************** *** 1,11 **** ! # See if we run in Unicode mode. ! # This may be referenced all over the place, so we save it globally. ! import win32api, win32con ! ! # This doesn't seem to work correctly on NT - see bug 716708 is_platform_unicode = 0 - #is_platform_unicode = hasattr(__builtin__, "unicode") and win32api.GetVersionEx()[3] == win32con.VER_PLATFORM_WIN32_NT - default_platform_encoding = "mbcs" # Will it ever be necessary to change this? - default_scintilla_encoding = "utf-8" # Scintilla _only_ supports this ATM ! del win32api, win32con --- 1,10 ---- ! # is_platform_unicode is an old variable that was never correctly used and ! # is no longer referenced in pywin32. It is staying for a few releases incase ! # others are looking at it, but it will go away soon! is_platform_unicode = 0 ! # Ditto default_platform_encoding - not referenced and will die. ! default_platform_encoding = "mbcs" ! ! # This one *is* real and used - but in practice can't be changed. ! default_scintilla_encoding = "utf-8" # Scintilla _only_ supports this ATM |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:50:48
|
Update of /cvsroot/pywin32/pywin32/win32/help In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31725/win32/help Modified Files: py3k.html Log Message: add better link to win32timezone methods Index: py3k.html =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/help/py3k.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** py3k.html 28 Jan 2009 10:47:40 -0000 1.1 --- py3k.html 31 Jan 2009 05:50:41 -0000 1.2 *************** *** 29,35 **** method, but otherwise the datetime object is identical to the base class. All time objects returned by pywin32 will have a UTC timezone ! (via the win32timezone module), and times with any timezone will be ! accepted when passed to pywin32 - but "time zone naive" objects are ! *not* supported. </p> <p> --- 29,35 ---- method, but otherwise the datetime object is identical to the base class. All time objects returned by pywin32 will have a UTC timezone ! (via the <a href="win32timezone.TimeZoneInfo__utc_meth.html">win32timezone.TimeZoneInfo.utc() method</a>), ! and times with any timezone will be accepted when passed to pywin32 - ! but "time zone naive" objects are *not* supported. </p> <p> |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:48:48
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31584 Modified Files: CHANGES.txt Log Message: Fix memory leak in win32wnet.WNetEnumResource Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** CHANGES.txt 28 Jan 2009 10:57:30 -0000 1.43 --- CHANGES.txt 31 Jan 2009 05:48:36 -0000 1.44 *************** *** 22,25 **** --- 22,27 ---- - Vernon Cole: for help with porting adodbapi to py3k. + * Fixed memory leak in win32wnet.WNetEnumResource. + * Added win32wnet.WNetAddConnection3 allowing a HWND to be specified for authentication. |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:48:41
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32wnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31584/win32/src/win32wnet Modified Files: win32wnet.cpp Log Message: Fix memory leak in win32wnet.WNetEnumResource Index: win32wnet.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/win32wnet.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** win32wnet.cpp 3 Jan 2009 06:42:20 -0000 1.18 --- win32wnet.cpp 31 Jan 2009 05:48:36 -0000 1.19 *************** *** 405,409 **** { Py_DECREF(pRetlist); ! VirtualFree(lpBuffer, dwRefsize, MEM_DECOMMIT); return(ReturnError("Unable to create return list","WNetEnumResource")); } --- 405,409 ---- { Py_DECREF(pRetlist); ! VirtualFree(lpBuffer, 0, MEM_RELEASE); return(ReturnError("Unable to create return list","WNetEnumResource")); } *************** *** 417,421 **** } ! VirtualFree(lpBuffer, dwRefsize, MEM_DECOMMIT); // free the working buffer }while ((Errno == NO_ERROR) && (dwMaxCount != 0)); // No more because EnumResource returned "ERROR_NO_MORE_DATA" --- 417,421 ---- } ! VirtualFree(lpBuffer, 0, MEM_RELEASE); // free the working buffer }while ((Errno == NO_ERROR) && (dwMaxCount != 0)); // No more because EnumResource returned "ERROR_NO_MORE_DATA" |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:30:20
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30492/pywin/framework Modified Files: scriptutils.py Log Message: load scripts we run as bytes so Py3k auto-detects encoding decls Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** scriptutils.py 8 Jan 2009 12:28:42 -0000 1.23 --- scriptutils.py 31 Jan 2009 05:30:16 -0000 1.24 *************** *** 27,30 **** --- 27,34 ---- Post-Mortem of unhandled exceptions""".split("\n") + byte_cr = "\r".encode("ascii") + byte_lf = "\n".encode("ascii") + byte_crlf = "\r\n".encode("ascii") + # A dialog box for the "Run Script" command. class DlgRunScript(dialog.Dialog): *************** *** 261,270 **** if not IsOnPythonPath(path): sys.path.append(path) try: ! f = open(script) except IOError, exc: win32ui.MessageBox("The file could not be opened - %s (%d)" % (exc.strerror, exc.errno)) return # Remember and hack sys.argv for the script. oldArgv = sys.argv --- 265,284 ---- if not IsOnPythonPath(path): sys.path.append(path) + # py3k fun: If we use text mode to open the file, we get \r\n + # translated so Python allows the syntax (good!), but we get back + # text already decoded from the default encoding (bad!) and Python + # ignores any encoding decls (bad!). If we use binary mode we get + # the raw bytes and Python looks at the encoding (good!) but \r\n + # chars stay in place so Python throws a syntax error (bad!). + # So: so the binary thing and manually normalize \r\n. try: ! f = open(script, 'rb') except IOError, exc: win32ui.MessageBox("The file could not be opened - %s (%d)" % (exc.strerror, exc.errno)) return + # Get the source-code - as above, normalize \r\n + code = f.read().replace(byte_crlf, byte_lf).replace(byte_cr, byte_lf) + byte_lf + # Remember and hack sys.argv for the script. oldArgv = sys.argv *************** *** 296,300 **** # at this point try: ! codeObject = compile(f.read()+"\n", script, "exec") except: # Almost certainly a syntax error! --- 310,314 ---- # at this point try: ! codeObject = compile(code, script, "exec") except: # Almost certainly a syntax error! |
|
From: Mark H. <mha...@us...> - 2009-01-31 05:28:29
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30367/pywin/scintilla Modified Files: document.py Log Message: implement pep263 encoding detection Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** document.py 5 Jan 2009 11:09:20 -0000 1.9 --- document.py 31 Jan 2009 05:28:24 -0000 1.10 *************** *** 7,14 **** --- 7,19 ---- import os import codecs + import re crlf_bytes = "\r\n".encode("ascii") lf_bytes = "\n".encode("ascii") + # re from pep263 - but we use it both on bytes and strings. + re_encoding_bytes = re.compile("coding[:=]\s*([-\w.]+)".encode("ascii")) + re_encoding_text = re.compile("coding[:=]\s*([-\w.]+)") + ParentScintillaDocument=docview.Document class CScintillaDocument(ParentScintillaDocument): *************** *** 17,21 **** self.bom = None # the BOM, if any, read from the file. # the encoding we detected from the source. Might have ! # detected via the BOM or an encoding decl. self.source_encoding = None ParentScintillaDocument.__init__(self, *args) --- 22,29 ---- self.bom = None # the BOM, if any, read from the file. # the encoding we detected from the source. Might have ! # detected via the BOM or an encoding decl. Note that in ! # the latter case (ie, while self.bom is None), it can't be ! # trusted - the user may have edited the encoding decl between ! # open and save. self.source_encoding = None ParentScintillaDocument.__init__(self, *args) *************** *** 59,62 **** --- 67,71 ---- # first '\n' and guess based on the char before. l = f.readline() + l2 = f.readline() # If line ends with \r\n or has no line ending, use CRLF. if l.endswith(crlf_bytes) or not l.endswith(lf_bytes): *************** *** 65,74 **** eol_mode = scintillacon.SC_EOL_LF ! # Detect the encoding. ! # XXX - todo - support pep263 encoding declarations as well as ! # the BOM detection here (but note that unlike our BOM, the ! # encoding declaration could change between loading and saving ! # - particularly with a new file - so it also needs to be ! # implemented at save time.) for bom, encoding in ( (codecs.BOM_UTF8, "utf8"), --- 74,79 ---- eol_mode = scintillacon.SC_EOL_LF ! # Detect the encoding - first look for a BOM, and if not found, ! # look for a pep263 encoding declaration. for bom, encoding in ( (codecs.BOM_UTF8, "utf8"), *************** *** 81,96 **** l = l[len(bom):] # remove it. break # reading by lines would be too slow? Maybe we can use the # incremental encoders? For now just stick with loading the # entire file in memory. ! text = l + f.read() # Translate from source encoding to UTF-8 bytes for Scintilla source_encoding = self.source_encoding ! # This latin1 sucks until we get pep263 support; if we don't ! # know an encoding we just write as binary (maybe we should ! # try ascii to let the 'decoding failed' handling below to ! # provide a nice warning that the file is non-ascii) if source_encoding is None: source_encoding = 'latin1' --- 86,109 ---- l = l[len(bom):] # remove it. break + else: + # no bom detected - look for pep263 encoding decl. + for look in (l, l2): + # Note we are looking at raw bytes here: so + # both the re itself uses bytes and the result + # is bytes - but we need the result as a string. + match = re_encoding_bytes.search(look) + if match is not None: + self.source_encoding = match.group(1).decode("ascii") + break # reading by lines would be too slow? Maybe we can use the # incremental encoders? For now just stick with loading the # entire file in memory. ! text = l + l2 + f.read() # Translate from source encoding to UTF-8 bytes for Scintilla source_encoding = self.source_encoding ! # If we don't know an encoding, just use latin-1 to treat ! # it as bytes... if source_encoding is None: source_encoding = 'latin1' *************** *** 123,129 **** def _SaveTextToFile(self, view, f): s = view.GetTextRange() # already decoded from scintilla's encoding if self.bom: f.write(self.bom) ! source_encoding = self.source_encoding if source_encoding is None: source_encoding = 'latin1' --- 136,153 ---- def _SaveTextToFile(self, view, f): s = view.GetTextRange() # already decoded from scintilla's encoding + source_encoding = None if self.bom: f.write(self.bom) ! source_encoding = self.source_encoding ! else: ! # no BOM - look for an encoding. ! bits = re.split("[\r\n]*", s, 3) ! for look in bits[:-1]: ! match = re_encoding_text.search(look) ! if match is not None: ! source_encoding = match.group(1) ! self.source_encoding = source_encoding ! break ! if source_encoding is None: source_encoding = 'latin1' |
|
From: Mark H. <mha...@us...> - 2009-01-31 03:52:45
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22805/pywin/scintilla Modified Files: formatter.py Log Message: do syntax coloring on the raw utf8 stream Index: formatter.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/formatter.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** formatter.py 3 Jan 2009 05:52:28 -0000 1.17 --- formatter.py 31 Jan 2009 03:52:39 -0000 1.18 *************** *** 240,244 **** def Colorize(self, start=0, end=-1): scintilla = self.scintilla ! stringVal = scintilla.GetTextRange(start, end) if start > 0: stylenum = scintilla.SCIGetStyleAt(start - 1) --- 240,248 ---- def Colorize(self, start=0, end=-1): scintilla = self.scintilla ! # scintilla's formatting is all done in terms of utf, so ! # we work with utf8 bytes instead of unicode. This magically ! # works as any extended chars found in the utf8 don't change ! # the semantics. ! stringVal = scintilla.GetTextRange(start, end, decode=False) if start > 0: stylenum = scintilla.SCIGetStyleAt(start - 1) *************** *** 359,363 **** def ClassifyWord(self, cdoc, start, end, prevWord): ! word = cdoc[start:end+1] attr = STYLE_IDENTIFIER if prevWord == "class": --- 363,367 ---- def ClassifyWord(self, cdoc, start, end, prevWord): ! word = cdoc[start:end+1].decode('latin-1') attr = STYLE_IDENTIFIER if prevWord == "class": *************** *** 365,369 **** elif prevWord == "def": attr = STYLE_METHOD ! elif cdoc[start] in string.digits: attr = STYLE_NUMBER elif iskeyword(word): --- 369,373 ---- elif prevWord == "def": attr = STYLE_METHOD ! elif word[0] in string.digits: attr = STYLE_NUMBER elif iskeyword(word): *************** *** 383,395 **** state = styleStart chPrev = chPrev2 = chPrev3 = ' ' ! chNext = cdoc[charStart] ! chNext2 = cdoc[charStart] startSeg = i = charStart while i < lengthDoc: ch = chNext chNext = ' ' ! if i+1 < lengthDoc: chNext = cdoc[i+1] chNext2 = ' ' ! if i+2 < lengthDoc: chNext2 = cdoc[i+2] if state == STYLE_DEFAULT: if ch in wordstarts: --- 387,398 ---- state = styleStart chPrev = chPrev2 = chPrev3 = ' ' ! chNext2 = chNext = cdoc[charStart:charStart+1].decode('latin-1') startSeg = i = charStart while i < lengthDoc: ch = chNext chNext = ' ' ! if i+1 < lengthDoc: chNext = cdoc[i+1:i+2].decode('latin-1') chNext2 = ' ' ! if i+2 < lengthDoc: chNext2 = cdoc[i+2:i+3].decode('latin-1') if state == STYLE_DEFAULT: if ch in wordstarts: |
|
From: Mark H. <mha...@us...> - 2009-01-31 03:52:45
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22805/pywin/framework Modified Files: interact.py Log Message: do syntax coloring on the raw utf8 stream Index: interact.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/interact.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** interact.py 3 Jan 2009 05:52:28 -0000 1.20 --- interact.py 31 Jan 2009 03:52:39 -0000 1.21 *************** *** 116,120 **** if lengthDoc == 0: return state = styleStart ! chNext = cdoc[0] startSeg = 0 i = 0 --- 116,124 ---- if lengthDoc == 0: return state = styleStart ! # As per comments in Colorize(), we work with the raw utf8 ! # bytes. To avoid too muych py3k pain, we treat each utf8 byte ! # as a latin-1 unicode character - we only use it to compare ! # against ascii chars anyway... ! chNext = cdoc[0:1].decode('latin-1') startSeg = 0 i = 0 *************** *** 122,126 **** while i < lengthDoc: ch = chNext ! chNext = cdoc[i+1:i+2] # trace("ch=%r, i=%d, next=%r, state=%s" % (ch, i, chNext, state)) --- 126,130 ---- while i < lengthDoc: ch = chNext ! chNext = cdoc[i+1:i+2].decode('latin-1') # trace("ch=%r, i=%d, next=%r, state=%s" % (ch, i, chNext, state)) *************** *** 176,180 **** # and ask the Python colorizer to color that. end = startSeg ! while end < lengthDoc and cdoc[end] not in '\r\n': end = end + 1 self.ColorizePythonCode( cdoc[:end], startSeg, state) --- 180,184 ---- # and ask the Python colorizer to color that. end = startSeg ! while end < lengthDoc and cdoc[end] not in '\r\n'.encode('ascii'): end = end + 1 self.ColorizePythonCode( cdoc[:end], startSeg, state) *************** *** 186,190 **** startSeg =end i = end - 1 # ready for increment. ! chNext = cdoc[end:end+1] state = STYLE_INTERACTIVE_EOL if lastState != state: --- 190,194 ---- startSeg =end i = end - 1 # ready for increment. ! chNext = cdoc[end:end+1].decode('latin-1') state = STYLE_INTERACTIVE_EOL if lastState != state: *************** *** 196,200 **** def Colorize(self, start=0, end=-1): ! stringVal = self.scintilla.GetTextRange(start, end) styleStart = None stylePyStart = None --- 200,208 ---- def Colorize(self, start=0, end=-1): ! # scintilla's formatting is all done in terms of utf, so ! # we work with utf8 bytes instead of unicode. This magically ! # works as any extended chars found in the utf8 don't change ! # the semantics. ! stringVal = self.scintilla.GetTextRange(start, end, decode=False) styleStart = None stylePyStart = None *************** *** 303,315 **** if line==-1: line = self.LineFromChar() line = self.GetLine(line) - if pywin.is_platform_unicode: - try: - line = unicode(line, pywin.default_scintilla_encoding).encode(pywin.default_platform_encoding) - except: - # We should fix the underlying problem rather than always masking errors - # so make it complain. - print "Unicode error converting", repr(line) - line = unicode(line, pywin.default_scintilla_encoding, "ignore").encode(pywin.default_platform_encoding) - while line and line[-1] in ['\r', '\n']: line = line[:-1] --- 311,314 ---- |
|
From: Mark H. <mha...@us...> - 2009-01-31 03:51:12
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22604/pywin/scintilla Modified Files: control.py Log Message: remove debug statement Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** control.py 31 Jan 2009 03:31:03 -0000 1.21 --- control.py 31 Jan 2009 03:51:08 -0000 1.22 *************** *** 77,81 **** if isinstance(text, unicode): text = text.encode(default_scintilla_encoding) - win32api.OutputDebugString("SCI: %r\n" % text) self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, text + null_byte) def SCISetSavePoint(self): --- 77,80 ---- |
|
From: Mark H. <mha...@us...> - 2009-01-31 03:31:13
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20618/pywin/scintilla Modified Files: control.py Log Message: Allow GetTextRange() to return raw utf8 and SCIInsertText only encodes unicode Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** control.py 5 Jan 2009 11:07:24 -0000 1.20 --- control.py 31 Jan 2009 03:31:03 -0000 1.21 *************** *** 73,78 **** self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, text.encode(default_scintilla_encoding)) def SCIInsertText(self, text, pos=-1): ! buff=(text+'\0').encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, buff) def SCISetSavePoint(self): self.SendScintilla(scintillacon.SCI_SETSAVEPOINT) --- 73,82 ---- self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, text.encode(default_scintilla_encoding)) def SCIInsertText(self, text, pos=-1): ! # SCIInsertText allows unicode or bytes - but if they are bytes, ! # the caller must ensure it is encoded correctly. ! if isinstance(text, unicode): ! text = text.encode(default_scintilla_encoding) ! win32api.OutputDebugString("SCI: %r\n" % text) ! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, text + null_byte) def SCISetSavePoint(self): self.SendScintilla(scintillacon.SCI_SETSAVEPOINT) *************** *** 343,347 **** return self.SendScintilla(win32con.WM_GETTEXTLENGTH) ! def GetTextRange(self, start = 0, end = -1): if end == -1: end = self.SendScintilla(win32con.WM_GETTEXTLENGTH) assert end>=start, "Negative index requested (%d/%d)" % (start, end) --- 347,351 ---- return self.SendScintilla(win32con.WM_GETTEXTLENGTH) ! def GetTextRange(self, start = 0, end = -1, decode = True): if end == -1: end = self.SendScintilla(win32con.WM_GETTEXTLENGTH) assert end>=start, "Negative index requested (%d/%d)" % (start, end) *************** *** 354,359 **** trBuff = array.array('b', tr) addressTrBuff = trBuff.buffer_info()[0] ! numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff) ! return buff.tostring()[:numChars].decode(default_scintilla_encoding) def ReplaceSel(self, str): --- 358,366 ---- trBuff = array.array('b', tr) addressTrBuff = trBuff.buffer_info()[0] ! num_bytes = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff) ! ret = buff.tostring()[:num_bytes] ! if decode: ! ret = ret.decode(default_scintilla_encoding) ! return ret def ReplaceSel(self, str): |