pywin32-checkins Mailing List for Python for Windows Extensions (Page 69)
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...> - 2008-09-04 02:27:10
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32754 Modified Files: Tag: py3k win32ctrlList.cpp win32ctrlTree.cpp win32ui.h win32util.cpp win32view.cpp Log Message: Free text in LV_COLUMN Autoduck fixes for TV_ITEM, LV_ITEM, LV_COLUMN Index: win32ui.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ui.h,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -C2 -d -r1.7.2.2 -r1.7.2.3 *** win32ui.h 2 Sep 2008 02:14:43 -0000 1.7.2.2 --- win32ui.h 4 Sep 2008 02:27:19 -0000 1.7.2.3 *************** *** 357,362 **** PYW_EXPORT void PyWinObject_FreeLV_ITEM(LV_ITEM *pItem); ! PYW_EXPORT PyObject *MakeLV_COLUMNTuple(LV_COLUMN *item); ! PYW_EXPORT BOOL ParseLV_COLUMNTuple( PyObject *args, LV_COLUMN *pItem); PYW_EXPORT BOOL PyWinObject_AsTV_ITEM( PyObject *args, TV_ITEM *pItem); --- 357,363 ---- PYW_EXPORT void PyWinObject_FreeLV_ITEM(LV_ITEM *pItem); ! PYW_EXPORT PyObject *PyWinObject_FromLV_COLUMN(LV_COLUMN *pCol); ! PYW_EXPORT BOOL PyWinObject_AsLV_COLUMN( PyObject *args, LV_COLUMN *pCol); ! PYW_EXPORT void PyWinObject_FreeLV_COLUMN(LV_COLUMN *pCol); PYW_EXPORT BOOL PyWinObject_AsTV_ITEM( PyObject *args, TV_ITEM *pItem); Index: win32util.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v retrieving revision 1.13.2.2 retrieving revision 1.13.2.3 diff -C2 -d -r1.13.2.2 -r1.13.2.3 *** win32util.cpp 2 Sep 2008 02:14:43 -0000 1.13.2.2 --- win32util.cpp 4 Sep 2008 02:27:19 -0000 1.13.2.3 *************** *** 448,475 **** // // LV_COLUMN ! PyObject *MakeLV_COLUMNTuple(LV_COLUMN *item) { PyObject *ret = PyTuple_New(4); if (ret==NULL) return NULL; ! if (item->mask & LVCF_FMT) { ! PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(item->fmt)); } else { Py_INCREF(Py_None); PyTuple_SET_ITEM(ret, 0, Py_None); } ! if (item->mask & LVCF_WIDTH) { ! PyTuple_SET_ITEM(ret, 1, PyInt_FromLong(item->cx)); } else { Py_INCREF(Py_None); PyTuple_SET_ITEM(ret, 1, Py_None); } ! if ((item->mask & LVCF_TEXT) && (item->pszText != NULL)) { ! PyTuple_SET_ITEM(ret, 2, PyWinObject_FromTCHAR(item->pszText)); } else { Py_INCREF(Py_None); PyTuple_SET_ITEM(ret, 2, Py_None); } ! if (item->mask & LVCF_SUBITEM) { ! PyTuple_SET_ITEM(ret, 3, PyInt_FromLong(item->iSubItem)); } else { Py_INCREF(Py_None); --- 448,475 ---- // // LV_COLUMN ! PyObject *PyWinObject_FromLV_COLUMN(LV_COLUMN *pCol) { PyObject *ret = PyTuple_New(4); if (ret==NULL) return NULL; ! if (pCol->mask & LVCF_FMT) { ! PyTuple_SET_ITEM(ret, 0, PyInt_FromLong(pCol->fmt)); } else { Py_INCREF(Py_None); PyTuple_SET_ITEM(ret, 0, Py_None); } ! if (pCol->mask & LVCF_WIDTH) { ! PyTuple_SET_ITEM(ret, 1, PyInt_FromLong(pCol->cx)); } else { Py_INCREF(Py_None); PyTuple_SET_ITEM(ret, 1, Py_None); } ! if ((pCol->mask & LVCF_TEXT) && (pCol->pszText != NULL)) { ! PyTuple_SET_ITEM(ret, 2, PyWinObject_FromTCHAR(pCol->pszText)); } else { Py_INCREF(Py_None); PyTuple_SET_ITEM(ret, 2, Py_None); } ! if (pCol->mask & LVCF_SUBITEM) { ! PyTuple_SET_ITEM(ret, 3, PyInt_FromLong(pCol->iSubItem)); } else { Py_INCREF(Py_None); *************** *** 478,481 **** --- 478,487 ---- return ret; } + + void PyWinObject_FreeLV_COLUMN(LV_COLUMN *pCol){ + if (pCol->mask & LVCF_TEXT) + PyWinObject_FreeTCHAR(pCol->pszText); + } + // @object LV_COLUMN|A tuple that describes a Win32 LV_COLUMN tuple. Used by the <o PyCListCtrl> object. // A tuple of 4 items, being fmt, cx, pszText, iSubItem *************** *** 486,537 **** // <nl>When passed to Python, will always be a tuple of size 4, and items may be None if not available. // <nl>When passed from Python, the tuple may be any length up to 4, and any item may be None. ! BOOL ParseLV_COLUMNTuple( PyObject *args, LV_COLUMN *pItem) { PyObject *ob; ! pItem->mask = 0; ! Py_ssize_t len = PyTuple_Size(args); if (len > 4) { ! PyErr_SetString(PyExc_TypeError, "LV_COLUMN tuple has invalid size"); return FALSE; ! } ! assert (!PyErr_Occurred()); // PyErr_Clear(); // clear any errors, so I can detect my own. // 0 - fmt if (len<1) return TRUE; ! if ((ob=PyTuple_GetItem(args, 0))==NULL) ! return FALSE; if (ob != Py_None) { ! pItem->fmt = (int)PyInt_AsLong(ob); ! if (pItem->fmt==-1 && PyErr_Occurred()) return FALSE; ! pItem->mask |= LVCF_FMT; } // 1 - cx if (len<2) return TRUE; ! if ((ob=PyTuple_GetItem(args, 1))==NULL) ! return FALSE; if (ob != Py_None) { ! pItem->cx = (int)PyInt_AsLong(ob); ! if (pItem->cx==-1 && PyErr_Occurred()) return FALSE; ! pItem->mask |= LVCF_WIDTH; } // 2 - text if (len<3) return TRUE; - ob=PyTuple_GET_ITEM(args, 2); ! if (!PyWinObject_AsTCHAR(ob, &pItem->pszText, TRUE, (DWORD *)&pItem->cchTextMax)) return FALSE; ! // ??? Need to free this somewhere ??? ! if (pItem->pszText) ! pItem->mask |= LVCF_TEXT; // 3 - subitem if (len<4) return TRUE; ! if ((ob=PyTuple_GetItem(args, 3))==NULL) ! return FALSE; if (ob != Py_None) { ! pItem->mask |= LVCF_SUBITEM; ! pItem->iSubItem = PyInt_AsLong(ob); ! if (pItem->iSubItem==-1 && PyErr_Occurred()) return FALSE; ! } return TRUE; } --- 492,546 ---- // <nl>When passed to Python, will always be a tuple of size 4, and items may be None if not available. // <nl>When passed from Python, the tuple may be any length up to 4, and any item may be None. ! BOOL PyWinObject_AsLV_COLUMN( PyObject *args, LV_COLUMN *pCol) { + ZeroMemory(pCol, sizeof(*pCol)); + if (!PyTuple_Check(args)){ + PyErr_SetString(PyExc_TypeError, "LV_COLUMN must be a tuple"); + return FALSE; + } PyObject *ob; ! Py_ssize_t len = PyTuple_GET_SIZE(args); if (len > 4) { ! PyErr_SetString(PyExc_TypeError, "LV_COLUMN can contain at most 4 items"); return FALSE; ! } ! // 0 - fmt if (len<1) return TRUE; ! ob=PyTuple_GET_ITEM(args, 0); if (ob != Py_None) { ! pCol->fmt = PyInt_AsLong(ob); ! if (pCol->fmt==-1 && PyErr_Occurred()) return FALSE; ! pCol->mask |= LVCF_FMT; } + // 1 - cx if (len<2) return TRUE; ! ob=PyTuple_GET_ITEM(args, 1); if (ob != Py_None) { ! pCol->cx = PyInt_AsLong(ob); ! if (pCol->cx==-1 && PyErr_Occurred()) return FALSE; ! pCol->mask |= LVCF_WIDTH; } + // 2 - text if (len<3) return TRUE; ob=PyTuple_GET_ITEM(args, 2); ! if (!PyWinObject_AsTCHAR(ob, &pCol->pszText, TRUE, (DWORD *)&pCol->cchTextMax)) return FALSE; ! if (pCol->pszText) ! pCol->mask |= LVCF_TEXT; // 3 - subitem if (len<4) return TRUE; ! ob=PyTuple_GET_ITEM(args, 3); if (ob != Py_None) { ! pCol->iSubItem = PyInt_AsLong(ob); ! if (pCol->iSubItem==-1 && PyErr_Occurred()){ ! PyWinObject_FreeLV_COLUMN(pCol); return FALSE; ! } ! pCol->mask |= LVCF_SUBITEM; ! } return TRUE; } Index: win32view.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32view.cpp,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** win32view.cpp 29 Aug 2008 05:53:30 -0000 1.4.2.1 --- win32view.cpp 4 Sep 2008 02:27:19 -0000 1.4.2.2 *************** *** 1020,1024 **** PyCCtrlView_Type PyCListView::type("PyCListView", &PyCCtrlView::type, // @base PyCListView|PyCCtrlView ! &PyCListCtrl::type, // ??? need to add this to tp_bases so PyCListView inherits PyCListCtrl methods ??? RUNTIME_CLASS(CListView), sizeof(PyCListView), --- 1020,1024 ---- PyCCtrlView_Type PyCListView::type("PyCListView", &PyCCtrlView::type, // @base PyCListView|PyCCtrlView ! &PyCListCtrl::type, RUNTIME_CLASS(CListView), sizeof(PyCListView), Index: win32ctrlList.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlList.cpp,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** win32ctrlList.cpp 2 Sep 2008 02:14:43 -0000 1.3.2.2 --- win32ctrlList.cpp 4 Sep 2008 02:27:19 -0000 1.3.2.3 *************** *** 228,239 **** if (!PyArg_ParseTuple(args, "iO:InsertColumn", &iColNo, // @pyparm int|colNo||The new column number ! &obLVCol)) // @pyparm <om PyCListCtrl.LV_COLUMN tuple>|item||A tuple describing the new column. return NULL; LV_COLUMN lvCol; ! if (!ParseLV_COLUMNTuple(obLVCol, &lvCol)) return NULL; GUI_BGN_SAVE; int ret = pList->InsertColumn(iColNo, &lvCol); GUI_END_SAVE; if (ret==-1) RETURN_ERR("InsertColumn failed"); --- 228,240 ---- if (!PyArg_ParseTuple(args, "iO:InsertColumn", &iColNo, // @pyparm int|colNo||The new column number ! &obLVCol)) // @pyparm <o LV_COLUMN>|item||A tuple describing the new column. return NULL; LV_COLUMN lvCol; ! if (!PyWinObject_AsLV_COLUMN(obLVCol, &lvCol)) return NULL; GUI_BGN_SAVE; int ret = pList->InsertColumn(iColNo, &lvCol); GUI_END_SAVE; + PyWinObject_FreeLV_COLUMN(&lvCol); if (ret==-1) RETURN_ERR("InsertColumn failed"); *************** *** 253,267 **** if (!PyArg_ParseTuple(args, "iO:InsertColumn", &iColNo, // @pyparm int|colNo||The to be modified column number ! &obLVCol)) // @pyparm <om PyCListCtrl.LV_COLUMN tuple>|item||A tuple describing the modified column. return NULL; LV_COLUMN lvCol; ! if (!ParseLV_COLUMNTuple(obLVCol, &lvCol)) return NULL; GUI_BGN_SAVE; int ret = pList->SetColumn(iColNo, &lvCol); GUI_END_SAVE; if (ret==-1) RETURN_ERR("SetColumn failed"); ! return Py_BuildValue("i",ret); } --- 254,269 ---- if (!PyArg_ParseTuple(args, "iO:InsertColumn", &iColNo, // @pyparm int|colNo||The to be modified column number ! &obLVCol)) // @pyparm <o LV_COLUMN>|item||A tuple describing the modified column. return NULL; LV_COLUMN lvCol; ! if (!PyWinObject_AsLV_COLUMN(obLVCol, &lvCol)) return NULL; GUI_BGN_SAVE; int ret = pList->SetColumn(iColNo, &lvCol); GUI_END_SAVE; + PyWinObject_FreeLV_COLUMN(&lvCol); if (ret==-1) RETURN_ERR("SetColumn failed"); ! return PyInt_FromLong(ret); } *************** *** 299,303 **** PyErr_Clear(); if (PyArg_ParseTuple(args, "O:InsertItem", ! &obLVItem)) { // @pyparm <om PyCListCtrl.LV_ITEM tuple>|item||A tuple describing the new item. LV_ITEM lvItem; if (!PyWinObject_AsLV_ITEM(obLVItem, &lvItem)) --- 301,305 ---- PyErr_Clear(); if (PyArg_ParseTuple(args, "O:InsertItem", ! &obLVItem)) { // @pyparm <o LV_ITEM>|item||A tuple describing the new item. LV_ITEM lvItem; if (!PyWinObject_AsLV_ITEM(obLVItem, &lvItem)) *************** *** 316,320 **** if (ret==-1) RETURN_ERR("InsertItem failed"); ! return Py_BuildValue("i",ret); } --- 318,322 ---- if (ret==-1) RETURN_ERR("InsertItem failed"); ! return PyInt_FromLong(ret); } *************** *** 327,331 **** return NULL; if (!PyArg_ParseTuple(args, "O:SetItem", ! &obLVItem)) // @pyparm <om PyCListCtrl.LV_ITEM tuple>|item||A tuple describing the new item. return NULL; LV_ITEM lvItem; --- 329,333 ---- return NULL; if (!PyArg_ParseTuple(args, "O:SetItem", ! &obLVItem)) // @pyparm <o LV_ITEM>|item||A tuple describing the new item. return NULL; LV_ITEM lvItem; *************** *** 363,367 **** } ! // @pymethod <om PyCListCtrl.LV_COLUMN tuple>|PyCListCtrl|GetColumn|Retrieves the details of a column in the control. PyObject *PyCListCtrl_GetColumn( PyObject *self, PyObject *args ) { --- 365,369 ---- } ! // @pymethod <o LV_COLUMN>|PyCListCtrl|GetColumn|Retrieves the details of a column in the control. PyObject *PyCListCtrl_GetColumn( PyObject *self, PyObject *args ) { *************** *** 382,386 **** if (!ok) RETURN_ERR("GetColumn failed"); ! return MakeLV_COLUMNTuple(&lvItem); } --- 384,388 ---- if (!ok) RETURN_ERR("GetColumn failed"); ! return PyWinObject_FromLV_COLUMN(&lvItem); } *************** *** 455,459 **** } ! // @pymethod <om PyCListCtrl.LV_ITEM tuple>|PyCListCtrl|GetItem|Retrieves the details of an items attributes. PyObject *PyCListCtrl_GetItem( PyObject *self, PyObject *args ) { --- 457,461 ---- } ! // @pymethod <o LV_ITEM>|PyCListCtrl|GetItem|Retrieves the details of an items attributes. PyObject *PyCListCtrl_GetItem( PyObject *self, PyObject *args ) { Index: win32ctrlTree.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlTree.cpp,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -C2 -d -r1.6.2.2 -r1.6.2.3 *** win32ctrlTree.cpp 2 Sep 2008 02:14:43 -0000 1.6.2.2 --- win32ctrlTree.cpp 4 Sep 2008 02:27:19 -0000 1.6.2.3 *************** *** 482,486 **** PyWinObject_AsHANDLE, &tvItem.hParent, // @pyparm HTREEITEM|hParent||The parent item. If commctrl.TVI_ROOT or 0, it is added to the root. PyWinObject_AsHANDLE, &tvItem.hInsertAfter, // @pyparm HTREEITEM|hInsertAfter||The item to insert after. Can be an item or TVI_FIRST, TVI_LAST or TVI_SORT ! &obTVItem)) { // @pyparm <om PyCTreeCtrl.TV_ITEM tuple>|item||A tuple describing the new item. if (!PyWinObject_AsTV_ITEM(obTVItem, &tvItem.item)) return NULL; --- 482,486 ---- PyWinObject_AsHANDLE, &tvItem.hParent, // @pyparm HTREEITEM|hParent||The parent item. If commctrl.TVI_ROOT or 0, it is added to the root. PyWinObject_AsHANDLE, &tvItem.hInsertAfter, // @pyparm HTREEITEM|hInsertAfter||The item to insert after. Can be an item or TVI_FIRST, TVI_LAST or TVI_SORT ! &obTVItem)) { // @pyparm <o TV_ITEM>|item||A tuple describing the new item. if (!PyWinObject_AsTV_ITEM(obTVItem, &tvItem.item)) return NULL; *************** *** 511,515 **** return NULL; if (!PyArg_ParseTuple(args, "O:SetItem", ! &obTVItem)) // @pyparm <om PyCTreeCtrl.TV_ITEM tuple>|item||A tuple describing the new item. return NULL; TV_ITEM tvItem; --- 511,515 ---- return NULL; if (!PyArg_ParseTuple(args, "O:SetItem", ! &obTVItem)) // @pyparm <o TV_ITEM>|item||A tuple describing the new item. return NULL; TV_ITEM tvItem; *************** *** 547,551 **** } ! // @pymethod <om PyCTreeCtrl.TV_ITEM tuple>|PyCTreeCtrl|GetItem|Retrieves the details of an items attributes. PyObject *PyCTreeCtrl_GetItem( PyObject *self, PyObject *args ) { --- 547,551 ---- } ! // @pymethod <o TV_ITEM>|PyCTreeCtrl|GetItem|Retrieves the details of an items attributes. PyObject *PyCTreeCtrl_GetItem( PyObject *self, PyObject *args ) { |
From: Roger U. <ru...@us...> - 2008-09-03 21:30:08
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9809 Modified Files: Tag: py3k debugger.py Log Message: Use str on __name__, which may be None under unusual circumstances Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** debugger.py 29 Aug 2008 06:16:41 -0000 1.17.2.1 --- debugger.py 3 Sep 2008 21:30:18 -0000 1.17.2.2 *************** *** 56,60 **** # See if locals has a '__name__' (ie, a module) if '__name__' in self.myobject.f_locals: ! name = self.myobject.f_locals['__name__'] + " module" else: name = '<Debugger Context>' --- 56,60 ---- # See if locals has a '__name__' (ie, a module) if '__name__' in self.myobject.f_locals: ! name = str(self.myobject.f_locals['__name__']) + " module" else: name = '<Debugger Context>' *************** *** 578,582 **** def user_exception(self, frame, exc_info): - print ('user exception callled !!!!!!!') # This function is called if an exception occurs, # but only if we are to stop at or just below this level --- 578,581 ---- |
From: Roger U. <ru...@us...> - 2008-09-03 21:23:05
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7001 Modified Files: debugger.py Log Message: Use str on __name__, which may be None under unusual circumstances Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** debugger.py 9 Aug 2008 16:47:07 -0000 1.17 --- debugger.py 3 Sep 2008 21:23:15 -0000 1.18 *************** *** 56,60 **** # See if locals has a '__name__' (ie, a module) if self.myobject.f_locals.has_key('__name__'): ! name = self.myobject.f_locals['__name__'] + " module" else: name = '<Debugger Context>' --- 56,60 ---- # See if locals has a '__name__' (ie, a module) if self.myobject.f_locals.has_key('__name__'): ! name = str(self.myobject.f_locals['__name__']) + " module" else: name = '<Debugger Context>' |
From: Roger U. <ru...@us...> - 2008-09-03 03:05:49
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19320 Modified Files: Tag: py3k control.py document.py view.py Log Message: Use default_scintilla_encoding in place of hardcoded 'utf-8' Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.17.2.2 retrieving revision 1.17.2.3 diff -C2 -d -r1.17.2.2 -r1.17.2.3 *** control.py 2 Sep 2008 22:02:51 -0000 1.17.2.2 --- control.py 3 Sep 2008 03:05:57 -0000 1.17.2.3 *************** *** 224,229 **** self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, buff) def SCISetProperty(self, name, value): ! name_buff = array.array('b', (name + '\0').encode('utf-8')) ! val_buff = array.array("b", (str(value)+'\0').encode('utf-8')) address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] --- 224,229 ---- self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, buff) def SCISetProperty(self, name, value): ! name_buff = array.array('b', (name + '\0').encode(default_scintilla_encoding)) ! val_buff = array.array("b", (str(value)+'\0').encode(default_scintilla_encoding)) address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] *************** *** 282,286 **** findtextex_fmt='llPll' ## Scintilla does not handle unicode in EM_FINDTEXT msg (FINDTEXTEX struct) ! txt_buff = (findText+'\0').encode('utf-8') txt_array = array.array('b', txt_buff) ft_buff = struct.pack(findtextex_fmt, range[0], range[1], txt_array.buffer_info()[0], 0, 0) --- 282,286 ---- findtextex_fmt='llPll' ## Scintilla does not handle unicode in EM_FINDTEXT msg (FINDTEXTEX struct) ! txt_buff = (findText+'\0').encode(default_scintilla_encoding) txt_array = array.array('b', txt_buff) ft_buff = struct.pack(findtextex_fmt, range[0], range[1], txt_array.buffer_info()[0], 0, 0) Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.28.2.2 retrieving revision 1.28.2.3 diff -C2 -d -r1.28.2.2 -r1.28.2.3 *** view.py 1 Sep 2008 08:03:57 -0000 1.28.2.2 --- view.py 3 Sep 2008 03:05:57 -0000 1.28.2.3 *************** *** 387,392 **** doc = self.GetDocument() s = self.GetTextRange() ! if is_platform_unicode: ! s = str(s,"utf-8").encode("mbcs") f = open(filename, 'w') f.write(s) --- 387,392 ---- doc = self.GetDocument() s = self.GetTextRange() ! ## if is_platform_unicode: ! ## s = str(s,"utf-8").encode("mbcs") f = open(filename, 'w') f.write(s) Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.3 diff -C2 -d -r1.6.4.2 -r1.6.4.3 *** document.py 2 Sep 2008 19:45:18 -0000 1.6.4.2 --- document.py 3 Sep 2008 03:05:57 -0000 1.6.4.3 *************** *** 28,35 **** finally: f.close() ! text = text.encode('utf-8') ! if is_platform_unicode: ! # Translate from locale-specific (MCBS) encoding to UTF-8 for Scintilla ! text = text.encode(default_scintilla_encoding) except IOError: win32ui.MessageBox("Could not load the file from %s" % filename) --- 28,33 ---- finally: f.close() ! # Translate from locale-specific (MCBS) encoding to UTF-8 for Scintilla ! text = text.encode(default_scintilla_encoding) except IOError: win32ui.MessageBox("Could not load the file from %s" % filename) |
From: Roger U. <ru...@us...> - 2008-09-03 03:01:53
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783 Modified Files: find.py Log Message: In dialog lists, use 0 instead of None for no extended style Index: find.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/find.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** find.py 16 Jun 2005 08:59:11 -0000 1.10 --- find.py 3 Sep 2008 03:02:02 -0000 1.11 *************** *** 215,219 **** visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ! ["Find", (0, 2, 240, 75), style, None, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["Edit", "", 102, (50, 7, 120, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], --- 215,219 ---- visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ! ["Find", (0, 2, 240, 75), style, 0, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["Edit", "", 102, (50, 7, 120, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], *************** *** 233,237 **** visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ! ["Replace", (0, 2, 240, 95), style, None, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["Edit", "", 102, (60, 7, 110, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], --- 233,237 ---- visible = win32con.WS_CHILD | win32con.WS_VISIBLE dt = [ ! ["Replace", (0, 2, 240, 95), style, 0, (8, "MS Sans Serif")], ["Static", "Fi&nd What:", 101, (5, 8, 40, 10), visible], ["Edit", "", 102, (60, 7, 110, 12), visible | win32con.WS_BORDER | win32con.WS_TABSTOP | win32con.ES_AUTOHSCROLL], |
From: Roger U. <ru...@us...> - 2008-09-03 02:59:36
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16885 Modified Files: view.py Log Message: Remove import * Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** view.py 9 Aug 2008 16:47:08 -0000 1.28 --- view.py 3 Sep 2008 02:59:44 -0000 1.29 *************** *** 5,9 **** from pywin.mfc import docview from pywin.mfc import dialog ! from scintillacon import * import win32con import win32ui --- 5,9 ---- from pywin.mfc import docview from pywin.mfc import dialog ! import scintillacon import win32con import win32ui *************** *** 79,88 **** command_reflectors = [ (win32ui.ID_EDIT_UNDO, win32con.WM_UNDO), ! (win32ui.ID_EDIT_REDO, SCI_REDO), (win32ui.ID_EDIT_CUT, win32con.WM_CUT), (win32ui.ID_EDIT_COPY, win32con.WM_COPY), (win32ui.ID_EDIT_PASTE, win32con.WM_PASTE), (win32ui.ID_EDIT_CLEAR, win32con.WM_CLEAR), ! (win32ui.ID_EDIT_SELECT_ALL, SCI_SELECTALL), ] --- 79,88 ---- command_reflectors = [ (win32ui.ID_EDIT_UNDO, win32con.WM_UNDO), ! (win32ui.ID_EDIT_REDO, scintillacon.SCI_REDO), (win32ui.ID_EDIT_CUT, win32con.WM_CUT), (win32ui.ID_EDIT_COPY, win32con.WM_COPY), (win32ui.ID_EDIT_PASTE, win32con.WM_PASTE), (win32ui.ID_EDIT_CLEAR, win32con.WM_CLEAR), ! (win32ui.ID_EDIT_SELECT_ALL, scintillacon.SCI_SELECTALL), ] *************** *** 196,206 **** # Enable Unicode if we can if is_platform_unicode: ! self.SendScintilla(SCI_SETCODEPAGE, SC_CP_UTF8, 0) # Create margins ! self.SendScintilla(SCI_SETMARGINTYPEN, 1, SC_MARGIN_SYMBOL); ! self.SendScintilla(SCI_SETMARGINMASKN, 1, 0xF); ! self.SendScintilla(SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL); ! self.SendScintilla(SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS); ! self.SendScintilla(SCI_SETMARGINSENSITIVEN, 2, 1); self.GetDocument().HookViewNotifications(self) # is there an MFC way to grab this? --- 196,206 ---- # Enable Unicode if we can if is_platform_unicode: ! self.SendScintilla(scintillacon.SCI_SETCODEPAGE, scintillacon.SC_CP_UTF8, 0) # Create margins ! self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 1, scintillacon.SC_MARGIN_SYMBOL); ! self.SendScintilla(scintillacon.SCI_SETMARGINMASKN, 1, 0xF); ! self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 2, scintillacon.SC_MARGIN_SYMBOL); ! self.SendScintilla(scintillacon.SCI_SETMARGINMASKN, 2, scintillacon.SC_MASK_FOLDERS); ! self.SendScintilla(scintillacon.SCI_SETMARGINSENSITIVEN, 2, 1); self.GetDocument().HookViewNotifications(self) # is there an MFC way to grab this? *************** *** 323,333 **** cmdui.Enable() def OnCmdViewRightEdge(self, cmd, code): # Handle the menu command ! if self.SCIGetEdgeMode() == EDGE_NONE: ! mode = EDGE_BACKGROUND else: ! mode = EDGE_NONE self.SCISetEdgeMode(mode) def OnUpdateViewRightEdge(self, cmdui): # Update the tick on the UI. ! cmdui.SetCheck(self.SCIGetEdgeMode() != EDGE_NONE) cmdui.Enable() def OnCmdViewEOL(self, cmd, code): # Handle the menu command --- 323,333 ---- cmdui.Enable() def OnCmdViewRightEdge(self, cmd, code): # Handle the menu command ! if self.SCIGetEdgeMode() == scintillacon.EDGE_NONE: ! mode = scintillacon.EDGE_BACKGROUND else: ! mode = scintillacon.EDGE_NONE self.SCISetEdgeMode(mode) def OnUpdateViewRightEdge(self, cmdui): # Update the tick on the UI. ! cmdui.SetCheck(self.SCIGetEdgeMode() != scintillacon.EDGE_NONE) cmdui.Enable() def OnCmdViewEOL(self, cmd, code): # Handle the menu command |
From: Roger U. <ru...@us...> - 2008-09-03 00:55:01
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30690 Modified Files: configui.py Log Message: Remove import * Index: configui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/configui.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** configui.py 9 Aug 2008 16:47:07 -0000 1.5 --- configui.py 3 Sep 2008 00:55:10 -0000 1.6 *************** *** 5,9 **** import copy import string ! from scintillacon import * ###################################################### --- 5,9 ---- import copy import string ! import scintillacon ###################################################### *************** *** 42,46 **** rect = self.MapDialogRect( (5, 5, 120, 75)) self.scintilla.CreateWindow(style, rect, self, 111) ! self.HookNotify(self.OnBraceMatch, SCN_CHECKBRACE) self.scintilla.HookKeyStroke(self.OnEsc, 27) self.scintilla.SCISetViewWS(1) --- 42,46 ---- rect = self.MapDialogRect( (5, 5, 120, 75)) self.scintilla.CreateWindow(style, rect, self, 111) ! self.HookNotify(self.OnBraceMatch, scintillacon.SCN_CHECKBRACE) self.scintilla.HookKeyStroke(self.OnEsc, 27) self.scintilla.SCISetViewWS(1) |
From: Roger U. <ru...@us...> - 2008-09-03 00:51:37
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29097 Modified Files: Tag: py3k configui.py Log Message: Remove import * Index: configui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/configui.py,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** configui.py 29 Aug 2008 06:16:42 -0000 1.5.2.1 --- configui.py 3 Sep 2008 00:51:46 -0000 1.5.2.2 *************** *** 5,9 **** import copy import string ! from .scintillacon import * ###################################################### --- 5,9 ---- import copy import string ! from . import scintillacon ###################################################### *************** *** 42,46 **** rect = self.MapDialogRect( (5, 5, 120, 75)) self.scintilla.CreateWindow(style, rect, self, 111) ! self.HookNotify(self.OnBraceMatch, SCN_CHECKBRACE) self.scintilla.HookKeyStroke(self.OnEsc, 27) self.scintilla.SCISetViewWS(1) --- 42,46 ---- rect = self.MapDialogRect( (5, 5, 120, 75)) self.scintilla.CreateWindow(style, rect, self, 111) ! self.HookNotify(self.OnBraceMatch, scintillacon.SCN_CHECKBRACE) self.scintilla.HookKeyStroke(self.OnEsc, 27) self.scintilla.SCISetViewWS(1) |
From: Roger U. <ru...@us...> - 2008-09-02 23:03:30
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18282 Modified Files: control.py Log Message: Remove import * Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** control.py 9 Aug 2008 16:47:07 -0000 1.17 --- control.py 2 Sep 2008 23:03:38 -0000 1.18 *************** *** 13,17 **** import string import os ! from scintillacon import * # Load Scintilla.dll to get access to the control. --- 13,17 ---- import string import os ! import scintillacon # Load Scintilla.dll to get access to the control. *************** *** 32,35 **** --- 32,36 ---- dllid = win32api.LoadLibrary("Scintilla.DLL") + ## These are from Richedit.h - need to add to win32con or commctrl EM_GETTEXTRANGE = 1099 EM_EXLINEFROMCHAR = 1078 *************** *** 58,62 **** def SCIAddText(self, text): ! self.SendMessage(SCI_ADDTEXT, buffer(text)) def SCIAddStyledText(self, text, style = None): # If style is None, text is assumed to be a "native" Scintilla buffer. --- 59,63 ---- def SCIAddText(self, text): ! self.SendMessage(scintillacon.SCI_ADDTEXT, buffer(text)) def SCIAddStyledText(self, text, style = None): # If style is None, text is assumed to be a "native" Scintilla buffer. *************** *** 66,96 **** text = map(lambda char, style=style: char+chr(style), text) text = ''.join(text) ! self.SendMessage(SCI_ADDSTYLEDTEXT, buffer(text)) def SCIInsertText(self, text, pos=-1): sma = array.array('c', text+"\0") (a,l) = sma.buffer_info() ! self.SendScintilla(SCI_INSERTTEXT, pos, a) def SCISetSavePoint(self): ! self.SendScintilla(SCI_SETSAVEPOINT) def SCISetUndoCollection(self, collectFlag): ! self.SendScintilla(SCI_SETUNDOCOLLECTION, collectFlag) def SCIBeginUndoAction(self): ! self.SendScintilla(SCI_BEGINUNDOACTION) def SCIEndUndoAction(self): ! self.SendScintilla(SCI_ENDUNDOACTION) def SCIGetCurrentPos(self): ! return self.SendScintilla(SCI_GETCURRENTPOS) def SCIGetCharAt(self, pos): # Must ensure char is unsigned! ! return chr(self.SendScintilla(SCI_GETCHARAT, pos) & 0xFF) def SCIGotoLine(self, line): ! self.SendScintilla(SCI_GOTOLINE, line) def SCIBraceMatch(self, pos, maxReStyle): ! return self.SendScintilla(SCI_BRACEMATCH, pos, maxReStyle) def SCIBraceHighlight(self, pos, posOpposite): ! return self.SendScintilla(SCI_BRACEHIGHLIGHT, pos, posOpposite) def SCIBraceBadHighlight(self, pos): ! return self.SendScintilla(SCI_BRACEBADLIGHT, pos) #################################### --- 67,97 ---- text = map(lambda char, style=style: char+chr(style), text) text = ''.join(text) ! self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, buffer(text)) def SCIInsertText(self, text, pos=-1): sma = array.array('c', text+"\0") (a,l) = sma.buffer_info() ! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, a) def SCISetSavePoint(self): ! self.SendScintilla(scintillacon.SCI_SETSAVEPOINT) def SCISetUndoCollection(self, collectFlag): ! self.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, collectFlag) def SCIBeginUndoAction(self): ! self.SendScintilla(scintillacon.SCI_BEGINUNDOACTION) def SCIEndUndoAction(self): ! self.SendScintilla(scintillacon.SCI_ENDUNDOACTION) def SCIGetCurrentPos(self): ! return self.SendScintilla(scintillacon.SCI_GETCURRENTPOS) def SCIGetCharAt(self, pos): # Must ensure char is unsigned! ! return chr(self.SendScintilla(scintillacon.SCI_GETCHARAT, pos) & 0xFF) def SCIGotoLine(self, line): ! self.SendScintilla(scintillacon.SCI_GOTOLINE, line) def SCIBraceMatch(self, pos, maxReStyle): ! return self.SendScintilla(scintillacon.SCI_BRACEMATCH, pos, maxReStyle) def SCIBraceHighlight(self, pos, posOpposite): ! return self.SendScintilla(scintillacon.SCI_BRACEHIGHLIGHT, pos, posOpposite) def SCIBraceBadHighlight(self, pos): ! return self.SendScintilla(scintillacon.SCI_BRACEBADLIGHT, pos) #################################### *************** *** 99,156 **** # NOTE - dependent on of we use builtin lexer, so handled below. def SCIGetEndStyled(self): ! return self.SendScintilla(SCI_GETENDSTYLED) def SCIStyleSetFore(self, num, v): ! return self.SendScintilla(SCI_STYLESETFORE, num, v) def SCIStyleSetBack(self, num, v): ! return self.SendScintilla(SCI_STYLESETBACK, num, v) def SCIStyleSetEOLFilled(self, num, v): ! return self.SendScintilla(SCI_STYLESETEOLFILLED, num, v) def SCIStyleSetFont(self, num, name, characterset=0): buff = array.array('c', name + "\0") addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(SCI_STYLESETFONT, num, addressBuffer) ! self.SendScintilla(SCI_STYLESETCHARACTERSET, num, characterset) def SCIStyleSetBold(self, num, bBold): ! self.SendScintilla(SCI_STYLESETBOLD, num, bBold) def SCIStyleSetItalic(self, num, bItalic): ! self.SendScintilla(SCI_STYLESETITALIC, num, bItalic) def SCIStyleSetSize(self, num, size): ! self.SendScintilla(SCI_STYLESETSIZE, num, size) def SCIGetViewWS(self): ! return self.SendScintilla(SCI_GETVIEWWS) def SCISetViewWS(self, val): ! self.SendScintilla(SCI_SETVIEWWS, not (val==0)) self.InvalidateRect() def SCISetIndentationGuides(self, val): ! self.SendScintilla(SCI_SETINDENTATIONGUIDES, val) def SCIGetIndentationGuides(self): ! return self.SendScintilla(SCI_GETINDENTATIONGUIDES) def SCISetIndent(self, val): ! self.SendScintilla(SCI_SETINDENT, val) def SCIGetIndent(self, val): ! return self.SendScintilla(SCI_GETINDENT) def SCIGetViewEOL(self): ! return self.SendScintilla(SCI_GETVIEWEOL) def SCISetViewEOL(self, val): ! self.SendScintilla(SCI_SETVIEWEOL, not(val==0)) self.InvalidateRect() def SCISetTabWidth(self, width): ! self.SendScintilla(SCI_SETTABWIDTH, width, 0) def SCIStartStyling(self, pos, mask): ! self.SendScintilla(SCI_STARTSTYLING, pos, mask) def SCISetStyling(self, pos, attr): ! self.SendScintilla(SCI_SETSTYLING, pos, attr) def SCISetStylingEx(self, ray): # ray is an array. address, length = ray.buffer_info() ! self.SendScintilla(SCI_SETSTYLINGEX, length, address) def SCIGetStyleAt(self, pos): ! return self.SendScintilla(SCI_GETSTYLEAT, pos) def SCISetMarginWidth(self, width): ! self.SendScintilla(SCI_SETMARGINWIDTHN, 1, width) def SCISetMarginWidthN(self, n, width): ! self.SendScintilla(SCI_SETMARGINWIDTHN, n, width) def SCISetFoldFlags(self, flags): ! self.SendScintilla(SCI_SETFOLDFLAGS, flags) # Markers def SCIMarkerDefineAll(self, markerNum, markerType, fore, back): --- 100,157 ---- # NOTE - dependent on of we use builtin lexer, so handled below. def SCIGetEndStyled(self): ! return self.SendScintilla(scintillacon.SCI_GETENDSTYLED) def SCIStyleSetFore(self, num, v): ! return self.SendScintilla(scintillacon.SCI_STYLESETFORE, num, v) def SCIStyleSetBack(self, num, v): ! return self.SendScintilla(scintillacon.SCI_STYLESETBACK, num, v) def SCIStyleSetEOLFilled(self, num, v): ! return self.SendScintilla(scintillacon.SCI_STYLESETEOLFILLED, num, v) def SCIStyleSetFont(self, num, name, characterset=0): buff = array.array('c', name + "\0") addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_STYLESETFONT, num, addressBuffer) ! self.SendScintilla(scintillacon.SCI_STYLESETCHARACTERSET, num, characterset) def SCIStyleSetBold(self, num, bBold): ! self.SendScintilla(scintillacon.SCI_STYLESETBOLD, num, bBold) def SCIStyleSetItalic(self, num, bItalic): ! self.SendScintilla(scintillacon.SCI_STYLESETITALIC, num, bItalic) def SCIStyleSetSize(self, num, size): ! self.SendScintilla(scintillacon.SCI_STYLESETSIZE, num, size) def SCIGetViewWS(self): ! return self.SendScintilla(scintillacon.SCI_GETVIEWWS) def SCISetViewWS(self, val): ! self.SendScintilla(scintillacon.SCI_SETVIEWWS, not (val==0)) self.InvalidateRect() def SCISetIndentationGuides(self, val): ! self.SendScintilla(scintillacon.SCI_SETINDENTATIONGUIDES, val) def SCIGetIndentationGuides(self): ! return self.SendScintilla(scintillacon.SCI_GETINDENTATIONGUIDES) def SCISetIndent(self, val): ! self.SendScintilla(scintillacon.SCI_SETINDENT, val) def SCIGetIndent(self, val): ! return self.SendScintilla(scintillacon.SCI_GETINDENT) def SCIGetViewEOL(self): ! return self.SendScintilla(scintillacon.SCI_GETVIEWEOL) def SCISetViewEOL(self, val): ! self.SendScintilla(scintillacon.SCI_SETVIEWEOL, not(val==0)) self.InvalidateRect() def SCISetTabWidth(self, width): ! self.SendScintilla(scintillacon.SCI_SETTABWIDTH, width, 0) def SCIStartStyling(self, pos, mask): ! self.SendScintilla(scintillacon.SCI_STARTSTYLING, pos, mask) def SCISetStyling(self, pos, attr): ! self.SendScintilla(scintillacon.SCI_SETSTYLING, pos, attr) def SCISetStylingEx(self, ray): # ray is an array. address, length = ray.buffer_info() ! self.SendScintilla(scintillacon.SCI_SETSTYLINGEX, length, address) def SCIGetStyleAt(self, pos): ! return self.SendScintilla(scintillacon.SCI_GETSTYLEAT, pos) def SCISetMarginWidth(self, width): ! self.SendScintilla(scintillacon.SCI_SETMARGINWIDTHN, 1, width) def SCISetMarginWidthN(self, n, width): ! self.SendScintilla(scintillacon.SCI_SETMARGINWIDTHN, n, width) def SCISetFoldFlags(self, flags): ! self.SendScintilla(scintillacon.SCI_SETFOLDFLAGS, flags) # Markers def SCIMarkerDefineAll(self, markerNum, markerType, fore, back): *************** *** 159,179 **** self.SCIMarkerSetBack(markerNum, back) def SCIMarkerDefine(self, markerNum, markerType): ! self.SendScintilla(SCI_MARKERDEFINE, markerNum, markerType) def SCIMarkerSetFore(self, markerNum, fore): ! self.SendScintilla(SCI_MARKERSETFORE, markerNum, fore) def SCIMarkerSetBack(self, markerNum, back): ! self.SendScintilla(SCI_MARKERSETBACK, markerNum, back) def SCIMarkerAdd(self, lineNo, markerNum): ! self.SendScintilla(SCI_MARKERADD, lineNo, markerNum) def SCIMarkerDelete(self, lineNo, markerNum): ! self.SendScintilla(SCI_MARKERDELETE, lineNo, markerNum) def SCIMarkerDeleteAll(self, markerNum=-1): ! self.SendScintilla(SCI_MARKERDELETEALL, markerNum) def SCIMarkerGet(self, lineNo): ! return self.SendScintilla(SCI_MARKERGET, lineNo) def SCIMarkerNext(self, lineNo, markerNum): ! return self.SendScintilla(SCI_MARKERNEXT, lineNo, markerNum) def SCICancel(self): ! self.SendScintilla(SCI_CANCEL) # AutoComplete def SCIAutoCShow(self, text): --- 160,180 ---- self.SCIMarkerSetBack(markerNum, back) def SCIMarkerDefine(self, markerNum, markerType): ! self.SendScintilla(scintillacon.SCI_MARKERDEFINE, markerNum, markerType) def SCIMarkerSetFore(self, markerNum, fore): ! self.SendScintilla(scintillacon.SCI_MARKERSETFORE, markerNum, fore) def SCIMarkerSetBack(self, markerNum, back): ! self.SendScintilla(scintillacon.SCI_MARKERSETBACK, markerNum, back) def SCIMarkerAdd(self, lineNo, markerNum): ! self.SendScintilla(scintillacon.SCI_MARKERADD, lineNo, markerNum) def SCIMarkerDelete(self, lineNo, markerNum): ! self.SendScintilla(scintillacon.SCI_MARKERDELETE, lineNo, markerNum) def SCIMarkerDeleteAll(self, markerNum=-1): ! self.SendScintilla(scintillacon.SCI_MARKERDELETEALL, markerNum) def SCIMarkerGet(self, lineNo): ! return self.SendScintilla(scintillacon.SCI_MARKERGET, lineNo) def SCIMarkerNext(self, lineNo, markerNum): ! return self.SendScintilla(scintillacon.SCI_MARKERNEXT, lineNo, markerNum) def SCICancel(self): ! self.SendScintilla(scintillacon.SCI_CANCEL) # AutoComplete def SCIAutoCShow(self, text): *************** *** 182,200 **** buff = array.array('c', text + "\0") addressBuffer = buff.buffer_info()[0] ! return self.SendScintilla(SCI_AUTOCSHOW, 0, addressBuffer) def SCIAutoCCancel(self): ! self.SendScintilla(SCI_AUTOCCANCEL) def SCIAutoCActive(self): ! return self.SendScintilla(SCI_AUTOCACTIVE) def SCIAutoCComplete(self): ! return self.SendScintilla(SCI_AUTOCCOMPLETE) def SCIAutoCStops(self, stops): buff = array.array('c', stops + "\0") addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(SCI_AUTOCSTOPS, 0, addressBuffer) def SCIAutoCSetAutoHide(self, hide): ! self.SendScintilla(SCI_AUTOCSETAUTOHIDE, hide) def SCIAutoCSetFillups(self, fillups): ! self.SendScintilla(SCI_AUTOCSETFILLUPS, fillups) # Call tips def SCICallTipShow(self, text, pos=-1): --- 183,201 ---- buff = array.array('c', text + "\0") addressBuffer = buff.buffer_info()[0] ! return self.SendScintilla(scintillacon.SCI_AUTOCSHOW, 0, addressBuffer) def SCIAutoCCancel(self): ! self.SendScintilla(scintillacon.SCI_AUTOCCANCEL) def SCIAutoCActive(self): ! return self.SendScintilla(scintillacon.SCI_AUTOCACTIVE) def SCIAutoCComplete(self): ! return self.SendScintilla(scintillacon.SCI_AUTOCCOMPLETE) def SCIAutoCStops(self, stops): buff = array.array('c', stops + "\0") addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_AUTOCSTOPS, 0, addressBuffer) def SCIAutoCSetAutoHide(self, hide): ! self.SendScintilla(scintillacon.SCI_AUTOCSETAUTOHIDE, hide) def SCIAutoCSetFillups(self, fillups): ! self.SendScintilla(scintillacon.SCI_AUTOCSETFILLUPS, fillups) # Call tips def SCICallTipShow(self, text, pos=-1): *************** *** 207,224 **** buff = array.array('c', text + "\0") addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(SCI_CALLTIPSHOW, pos, addressBuffer) def SCICallTipCancel(self): ! self.SendScintilla(SCI_CALLTIPCANCEL) def SCICallTipActive(self): ! return self.SendScintilla(SCI_CALLTIPACTIVE) def SCICallTipPosStart(self): ! return self.SendScintilla(SCI_CALLTIPPOSSTART) def SCINewline(self): ! self.SendScintilla(SCI_NEWLINE) # Lexer etc def SCISetKeywords(self, keywords, kw_list_no = 0): ar = array.array('c', keywords+"\0") (a,l) = ar.buffer_info() ! self.SendScintilla(SCI_SETKEYWORDS, kw_list_no, a) def SCISetProperty(self, name, value): name_buff = array.array('c', name + "\0") --- 208,225 ---- buff = array.array('c', text + "\0") addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_CALLTIPSHOW, pos, addressBuffer) def SCICallTipCancel(self): ! self.SendScintilla(scintillacon.SCI_CALLTIPCANCEL) def SCICallTipActive(self): ! return self.SendScintilla(scintillacon.SCI_CALLTIPACTIVE) def SCICallTipPosStart(self): ! return self.SendScintilla(scintillacon.SCI_CALLTIPPOSSTART) def SCINewline(self): ! self.SendScintilla(scintillacon.SCI_NEWLINE) # Lexer etc def SCISetKeywords(self, keywords, kw_list_no = 0): ar = array.array('c', keywords+"\0") (a,l) = ar.buffer_info() ! self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, a) def SCISetProperty(self, name, value): name_buff = array.array('c', name + "\0") *************** *** 226,263 **** address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] ! self.SendScintilla(SCI_SETPROPERTY, address_name_buffer, address_val_buffer) def SCISetStyleBits(self, nbits): ! self.SendScintilla(SCI_SETSTYLEBITS, nbits) # Folding def SCIGetFoldLevel(self, lineno): ! return self.SendScintilla(SCI_GETFOLDLEVEL, lineno) def SCIToggleFold(self, lineno): ! return self.SendScintilla(SCI_TOGGLEFOLD, lineno) def SCIEnsureVisible(self, lineno): ! self.SendScintilla(SCI_ENSUREVISIBLE, lineno) def SCIGetFoldExpanded(self, lineno): ! return self.SendScintilla(SCI_GETFOLDEXPANDED, lineno) # right edge def SCISetEdgeColumn(self, edge): ! self.SendScintilla(SCI_SETEDGECOLUMN, edge) def SCIGetEdgeColumn(self): ! return self.SendScintilla(SCI_GETEDGECOLUMN) def SCISetEdgeMode(self, mode): ! self.SendScintilla(SCI_SETEDGEMODE, mode) def SCIGetEdgeMode(self): ! return self.SendScintilla(SCI_GETEDGEMODE) def SCISetEdgeColor(self, color): ! self.SendScintilla(SCI_SETEDGECOLOUR, color) def SCIGetEdgeColor(self): ! return self.SendScintilla(SCI_GETEDGECOLOR) # Multi-doc def SCIGetDocPointer(self): ! return self.SendScintilla(SCI_GETDOCPOINTER) def SCISetDocPointer(self, p): ! return self.SendScintilla(SCI_SETDOCPOINTER, 0, p) def SCISetWrapMode(self, mode): ! return self.SendScintilla(SCI_SETWRAPMODE, mode) def SCIGetWrapMode(self): ! return self.SendScintilla(SCI_GETWRAPMODE) class CScintillaEditInterface(ScintillaControlInterface): --- 227,264 ---- address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_SETPROPERTY, address_name_buffer, address_val_buffer) def SCISetStyleBits(self, nbits): ! self.SendScintilla(scintillacon.SCI_SETSTYLEBITS, nbits) # Folding def SCIGetFoldLevel(self, lineno): ! return self.SendScintilla(scintillacon.SCI_GETFOLDLEVEL, lineno) def SCIToggleFold(self, lineno): ! return self.SendScintilla(scintillacon.SCI_TOGGLEFOLD, lineno) def SCIEnsureVisible(self, lineno): ! self.SendScintilla(scintillacon.SCI_ENSUREVISIBLE, lineno) def SCIGetFoldExpanded(self, lineno): ! return self.SendScintilla(scintillacon.SCI_GETFOLDEXPANDED, lineno) # right edge def SCISetEdgeColumn(self, edge): ! self.SendScintilla(scintillacon.SCI_SETEDGECOLUMN, edge) def SCIGetEdgeColumn(self): ! return self.SendScintilla(scintillacon.SCI_GETEDGECOLUMN) def SCISetEdgeMode(self, mode): ! self.SendScintilla(scintillacon.SCI_SETEDGEMODE, mode) def SCIGetEdgeMode(self): ! return self.SendScintilla(scintillacon.SCI_GETEDGEMODE) def SCISetEdgeColor(self, color): ! self.SendScintilla(scintillacon.SCI_SETEDGECOLOUR, color) def SCIGetEdgeColor(self): ! return self.SendScintilla(scintillacon.SCI_GETEDGECOLOR) # Multi-doc def SCIGetDocPointer(self): ! return self.SendScintilla(scintillacon.SCI_GETDOCPOINTER) def SCISetDocPointer(self, p): ! return self.SendScintilla(scintillacon.SCI_SETDOCPOINTER, 0, p) def SCISetWrapMode(self, mode): ! return self.SendScintilla(scintillacon.SCI_SETWRAPMODE, mode) def SCIGetWrapMode(self): ! return self.SendScintilla(scintillacon.SCI_GETWRAPMODE) class CScintillaEditInterface(ScintillaControlInterface): *************** *** 289,294 **** def GetSel(self): ! currentPos = self.SendScintilla(SCI_GETCURRENTPOS) ! anchorPos = self.SendScintilla(SCI_GETANCHOR) if currentPos < anchorPos: return (currentPos, anchorPos) --- 290,295 ---- def GetSel(self): ! currentPos = self.SendScintilla(scintillacon.SCI_GETCURRENTPOS) ! anchorPos = self.SendScintilla(scintillacon.SCI_GETANCHOR) if currentPos < anchorPos: return (currentPos, anchorPos) *************** *** 357,361 **** def ReplaceSel(self, str): buff = array.array('c', str + "\0") ! self.SendScintilla(SCI_REPLACESEL, 0, buff.buffer_info()[0]); buff = None --- 358,362 ---- def ReplaceSel(self, str): buff = array.array('c', str + "\0") ! self.SendScintilla(scintillacon.SCI_REPLACESEL, 0, buff.buffer_info()[0]); buff = None |
From: Roger U. <ru...@us...> - 2008-09-02 22:02:42
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26290 Modified Files: Tag: py3k control.py Log Message: Remove import * Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** control.py 29 Aug 2008 06:16:42 -0000 1.17.2.1 --- control.py 2 Sep 2008 22:02:51 -0000 1.17.2.2 *************** *** 14,18 **** import string import os ! from .scintillacon import * # Load Scintilla.dll to get access to the control. --- 14,18 ---- import string import os ! from . import scintillacon # Load Scintilla.dll to get access to the control. *************** *** 33,36 **** --- 33,37 ---- dllid = win32api.LoadLibrary("Scintilla.DLL") + ## These are from Richedit.h - need to add to win32con or commctrl EM_GETTEXTRANGE = 1099 EM_EXLINEFROMCHAR = 1078 *************** *** 59,63 **** def SCIAddText(self, text): ! self.SendMessage(SCI_ADDTEXT, text.encode(default_scintilla_encoding)) def SCIAddStyledText(self, text, style = None): # If style is None, text is assumed to be a "native" Scintilla buffer. --- 60,64 ---- def SCIAddText(self, text): ! self.SendMessage(scintillacon.SCI_ADDTEXT, text.encode(default_scintilla_encoding)) def SCIAddStyledText(self, text, style = None): # If style is None, text is assumed to be a "native" Scintilla buffer. *************** *** 67,98 **** text = list(map(lambda char, style=style: char+chr(style), text)) text = ''.join(text) ! self.SendMessage(SCI_ADDSTYLEDTEXT, text.encode(default_scintilla_encoding)) def SCIInsertText(self, text, pos=-1): ## sma = array.array('u', text+"\0") ## (a,l) = sma.buffer_info() buff=(text+'\0').encode(default_scintilla_encoding) ! self.SendScintilla(SCI_INSERTTEXT, pos, buff) def SCISetSavePoint(self): ! self.SendScintilla(SCI_SETSAVEPOINT) def SCISetUndoCollection(self, collectFlag): ! self.SendScintilla(SCI_SETUNDOCOLLECTION, collectFlag) def SCIBeginUndoAction(self): ! self.SendScintilla(SCI_BEGINUNDOACTION) def SCIEndUndoAction(self): ! self.SendScintilla(SCI_ENDUNDOACTION) def SCIGetCurrentPos(self): ! return self.SendScintilla(SCI_GETCURRENTPOS) def SCIGetCharAt(self, pos): # Must ensure char is unsigned! ! return chr(self.SendScintilla(SCI_GETCHARAT, pos) & 0xFF) def SCIGotoLine(self, line): ! self.SendScintilla(SCI_GOTOLINE, line) def SCIBraceMatch(self, pos, maxReStyle): ! return self.SendScintilla(SCI_BRACEMATCH, pos, maxReStyle) def SCIBraceHighlight(self, pos, posOpposite): ! return self.SendScintilla(SCI_BRACEHIGHLIGHT, pos, posOpposite) def SCIBraceBadHighlight(self, pos): ! return self.SendScintilla(SCI_BRACEBADLIGHT, pos) #################################### --- 68,99 ---- text = list(map(lambda char, style=style: char+chr(style), text)) text = ''.join(text) ! self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, text.encode(default_scintilla_encoding)) def SCIInsertText(self, text, pos=-1): ## sma = array.array('u', text+"\0") ## (a,l) = sma.buffer_info() buff=(text+'\0').encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, buff) def SCISetSavePoint(self): ! self.SendScintilla(scintillacon.SCI_SETSAVEPOINT) def SCISetUndoCollection(self, collectFlag): ! self.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, collectFlag) def SCIBeginUndoAction(self): ! self.SendScintilla(scintillacon.SCI_BEGINUNDOACTION) def SCIEndUndoAction(self): ! self.SendScintilla(scintillacon.SCI_ENDUNDOACTION) def SCIGetCurrentPos(self): ! return self.SendScintilla(scintillacon.SCI_GETCURRENTPOS) def SCIGetCharAt(self, pos): # Must ensure char is unsigned! ! return chr(self.SendScintilla(scintillacon.SCI_GETCHARAT, pos) & 0xFF) def SCIGotoLine(self, line): ! self.SendScintilla(scintillacon.SCI_GOTOLINE, line) def SCIBraceMatch(self, pos, maxReStyle): ! return self.SendScintilla(scintillacon.SCI_BRACEMATCH, pos, maxReStyle) def SCIBraceHighlight(self, pos, posOpposite): ! return self.SendScintilla(scintillacon.SCI_BRACEHIGHLIGHT, pos, posOpposite) def SCIBraceBadHighlight(self, pos): ! return self.SendScintilla(scintillacon.SCI_BRACEBADLIGHT, pos) #################################### *************** *** 101,158 **** # NOTE - dependent on of we use builtin lexer, so handled below. def SCIGetEndStyled(self): ! return self.SendScintilla(SCI_GETENDSTYLED) def SCIStyleSetFore(self, num, v): ! return self.SendScintilla(SCI_STYLESETFORE, num, v) def SCIStyleSetBack(self, num, v): ! return self.SendScintilla(SCI_STYLESETBACK, num, v) def SCIStyleSetEOLFilled(self, num, v): ! return self.SendScintilla(SCI_STYLESETEOLFILLED, num, v) def SCIStyleSetFont(self, num, name, characterset=0): buff = (name + "\0").encode(default_scintilla_encoding) ## addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(SCI_STYLESETFONT, num, buff) ! self.SendScintilla(SCI_STYLESETCHARACTERSET, num, characterset) def SCIStyleSetBold(self, num, bBold): ! self.SendScintilla(SCI_STYLESETBOLD, num, bBold) def SCIStyleSetItalic(self, num, bItalic): ! self.SendScintilla(SCI_STYLESETITALIC, num, bItalic) def SCIStyleSetSize(self, num, size): ! self.SendScintilla(SCI_STYLESETSIZE, num, size) def SCIGetViewWS(self): ! return self.SendScintilla(SCI_GETVIEWWS) def SCISetViewWS(self, val): ! self.SendScintilla(SCI_SETVIEWWS, not (val==0)) self.InvalidateRect() def SCISetIndentationGuides(self, val): ! self.SendScintilla(SCI_SETINDENTATIONGUIDES, val) def SCIGetIndentationGuides(self): ! return self.SendScintilla(SCI_GETINDENTATIONGUIDES) def SCISetIndent(self, val): ! self.SendScintilla(SCI_SETINDENT, val) def SCIGetIndent(self, val): ! return self.SendScintilla(SCI_GETINDENT) def SCIGetViewEOL(self): ! return self.SendScintilla(SCI_GETVIEWEOL) def SCISetViewEOL(self, val): ! self.SendScintilla(SCI_SETVIEWEOL, not(val==0)) self.InvalidateRect() def SCISetTabWidth(self, width): ! self.SendScintilla(SCI_SETTABWIDTH, width, 0) def SCIStartStyling(self, pos, mask): ! self.SendScintilla(SCI_STARTSTYLING, pos, mask) def SCISetStyling(self, pos, attr): ! self.SendScintilla(SCI_SETSTYLING, pos, attr) def SCISetStylingEx(self, ray): # ray is an array. address, length = ray.buffer_info() ! self.SendScintilla(SCI_SETSTYLINGEX, length, address) def SCIGetStyleAt(self, pos): ! return self.SendScintilla(SCI_GETSTYLEAT, pos) def SCISetMarginWidth(self, width): ! self.SendScintilla(SCI_SETMARGINWIDTHN, 1, width) def SCISetMarginWidthN(self, n, width): ! self.SendScintilla(SCI_SETMARGINWIDTHN, n, width) def SCISetFoldFlags(self, flags): ! self.SendScintilla(SCI_SETFOLDFLAGS, flags) # Markers def SCIMarkerDefineAll(self, markerNum, markerType, fore, back): --- 102,159 ---- # NOTE - dependent on of we use builtin lexer, so handled below. def SCIGetEndStyled(self): ! return self.SendScintilla(scintillacon.SCI_GETENDSTYLED) def SCIStyleSetFore(self, num, v): ! return self.SendScintilla(scintillacon.SCI_STYLESETFORE, num, v) def SCIStyleSetBack(self, num, v): ! return self.SendScintilla(scintillacon.SCI_STYLESETBACK, num, v) def SCIStyleSetEOLFilled(self, num, v): ! return self.SendScintilla(scintillacon.SCI_STYLESETEOLFILLED, num, v) def SCIStyleSetFont(self, num, name, characterset=0): buff = (name + "\0").encode(default_scintilla_encoding) ## addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_STYLESETFONT, num, buff) ! self.SendScintilla(scintillacon.SCI_STYLESETCHARACTERSET, num, characterset) def SCIStyleSetBold(self, num, bBold): ! self.SendScintilla(scintillacon.SCI_STYLESETBOLD, num, bBold) def SCIStyleSetItalic(self, num, bItalic): ! self.SendScintilla(scintillacon.SCI_STYLESETITALIC, num, bItalic) def SCIStyleSetSize(self, num, size): ! self.SendScintilla(scintillacon.SCI_STYLESETSIZE, num, size) def SCIGetViewWS(self): ! return self.SendScintilla(scintillacon.SCI_GETVIEWWS) def SCISetViewWS(self, val): ! self.SendScintilla(scintillacon.SCI_SETVIEWWS, not (val==0)) self.InvalidateRect() def SCISetIndentationGuides(self, val): ! self.SendScintilla(scintillacon.SCI_SETINDENTATIONGUIDES, val) def SCIGetIndentationGuides(self): ! return self.SendScintilla(scintillacon.SCI_GETINDENTATIONGUIDES) def SCISetIndent(self, val): ! self.SendScintilla(scintillacon.SCI_SETINDENT, val) def SCIGetIndent(self, val): ! return self.SendScintilla(scintillacon.SCI_GETINDENT) def SCIGetViewEOL(self): ! return self.SendScintilla(scintillacon.SCI_GETVIEWEOL) def SCISetViewEOL(self, val): ! self.SendScintilla(scintillacon.SCI_SETVIEWEOL, not(val==0)) self.InvalidateRect() def SCISetTabWidth(self, width): ! self.SendScintilla(scintillacon.SCI_SETTABWIDTH, width, 0) def SCIStartStyling(self, pos, mask): ! self.SendScintilla(scintillacon.SCI_STARTSTYLING, pos, mask) def SCISetStyling(self, pos, attr): ! self.SendScintilla(scintillacon.SCI_SETSTYLING, pos, attr) def SCISetStylingEx(self, ray): # ray is an array. address, length = ray.buffer_info() ! self.SendScintilla(scintillacon.SCI_SETSTYLINGEX, length, address) def SCIGetStyleAt(self, pos): ! return self.SendScintilla(scintillacon.SCI_GETSTYLEAT, pos) def SCISetMarginWidth(self, width): ! self.SendScintilla(scintillacon.SCI_SETMARGINWIDTHN, 1, width) def SCISetMarginWidthN(self, n, width): ! self.SendScintilla(scintillacon.SCI_SETMARGINWIDTHN, n, width) def SCISetFoldFlags(self, flags): ! self.SendScintilla(scintillacon.SCI_SETFOLDFLAGS, flags) # Markers def SCIMarkerDefineAll(self, markerNum, markerType, fore, back): *************** *** 161,181 **** self.SCIMarkerSetBack(markerNum, back) def SCIMarkerDefine(self, markerNum, markerType): ! self.SendScintilla(SCI_MARKERDEFINE, markerNum, markerType) def SCIMarkerSetFore(self, markerNum, fore): ! self.SendScintilla(SCI_MARKERSETFORE, markerNum, fore) def SCIMarkerSetBack(self, markerNum, back): ! self.SendScintilla(SCI_MARKERSETBACK, markerNum, back) def SCIMarkerAdd(self, lineNo, markerNum): ! self.SendScintilla(SCI_MARKERADD, lineNo, markerNum) def SCIMarkerDelete(self, lineNo, markerNum): ! self.SendScintilla(SCI_MARKERDELETE, lineNo, markerNum) def SCIMarkerDeleteAll(self, markerNum=-1): ! self.SendScintilla(SCI_MARKERDELETEALL, markerNum) def SCIMarkerGet(self, lineNo): ! return self.SendScintilla(SCI_MARKERGET, lineNo) def SCIMarkerNext(self, lineNo, markerNum): ! return self.SendScintilla(SCI_MARKERNEXT, lineNo, markerNum) def SCICancel(self): ! self.SendScintilla(SCI_CANCEL) # AutoComplete def SCIAutoCShow(self, text): --- 162,182 ---- self.SCIMarkerSetBack(markerNum, back) def SCIMarkerDefine(self, markerNum, markerType): ! self.SendScintilla(scintillacon.SCI_MARKERDEFINE, markerNum, markerType) def SCIMarkerSetFore(self, markerNum, fore): ! self.SendScintilla(scintillacon.SCI_MARKERSETFORE, markerNum, fore) def SCIMarkerSetBack(self, markerNum, back): ! self.SendScintilla(scintillacon.SCI_MARKERSETBACK, markerNum, back) def SCIMarkerAdd(self, lineNo, markerNum): ! self.SendScintilla(scintillacon.SCI_MARKERADD, lineNo, markerNum) def SCIMarkerDelete(self, lineNo, markerNum): ! self.SendScintilla(scintillacon.SCI_MARKERDELETE, lineNo, markerNum) def SCIMarkerDeleteAll(self, markerNum=-1): ! self.SendScintilla(scintillacon.SCI_MARKERDELETEALL, markerNum) def SCIMarkerGet(self, lineNo): ! return self.SendScintilla(scintillacon.SCI_MARKERGET, lineNo) def SCIMarkerNext(self, lineNo, markerNum): ! return self.SendScintilla(scintillacon.SCI_MARKERNEXT, lineNo, markerNum) def SCICancel(self): ! self.SendScintilla(scintillacon.SCI_CANCEL) # AutoComplete def SCIAutoCShow(self, text): *************** *** 183,200 **** text = ' '.join(text) buff = (text + "\0").encode(default_scintilla_encoding) ! return self.SendScintilla(SCI_AUTOCSHOW, 0, buff) def SCIAutoCCancel(self): ! self.SendScintilla(SCI_AUTOCCANCEL) def SCIAutoCActive(self): ! return self.SendScintilla(SCI_AUTOCACTIVE) def SCIAutoCComplete(self): ! return self.SendScintilla(SCI_AUTOCCOMPLETE) def SCIAutoCStops(self, stops): buff = (stops + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(SCI_AUTOCSTOPS, 0, buff) def SCIAutoCSetAutoHide(self, hide): ! self.SendScintilla(SCI_AUTOCSETAUTOHIDE, hide) def SCIAutoCSetFillups(self, fillups): ! self.SendScintilla(SCI_AUTOCSETFILLUPS, fillups) # Call tips def SCICallTipShow(self, text, pos=-1): --- 184,201 ---- text = ' '.join(text) buff = (text + "\0").encode(default_scintilla_encoding) ! return self.SendScintilla(scintillacon.SCI_AUTOCSHOW, 0, buff) def SCIAutoCCancel(self): ! self.SendScintilla(scintillacon.SCI_AUTOCCANCEL) def SCIAutoCActive(self): ! return self.SendScintilla(scintillacon.SCI_AUTOCACTIVE) def SCIAutoCComplete(self): ! return self.SendScintilla(scintillacon.SCI_AUTOCCOMPLETE) def SCIAutoCStops(self, stops): buff = (stops + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_AUTOCSTOPS, 0, buff) def SCIAutoCSetAutoHide(self, hide): ! self.SendScintilla(scintillacon.SCI_AUTOCSETAUTOHIDE, hide) def SCIAutoCSetFillups(self, fillups): ! self.SendScintilla(scintillacon.SCI_AUTOCSETFILLUPS, fillups) # Call tips def SCICallTipShow(self, text, pos=-1): *************** *** 209,225 **** buff = (text + "\0").encode(default_scintilla_encoding) ## addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(SCI_CALLTIPSHOW, pos, buff) def SCICallTipCancel(self): ! self.SendScintilla(SCI_CALLTIPCANCEL) def SCICallTipActive(self): ! return self.SendScintilla(SCI_CALLTIPACTIVE) def SCICallTipPosStart(self): ! return self.SendScintilla(SCI_CALLTIPPOSSTART) def SCINewline(self): ! self.SendScintilla(SCI_NEWLINE) # Lexer etc def SCISetKeywords(self, keywords, kw_list_no = 0): buff = (keywords+"\0").encode(default_scintilla_encoding) ! self.SendScintilla(SCI_SETKEYWORDS, kw_list_no, buff) def SCISetProperty(self, name, value): name_buff = array.array('b', (name + '\0').encode('utf-8')) --- 210,226 ---- buff = (text + "\0").encode(default_scintilla_encoding) ## addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_CALLTIPSHOW, pos, buff) def SCICallTipCancel(self): ! self.SendScintilla(scintillacon.SCI_CALLTIPCANCEL) def SCICallTipActive(self): ! return self.SendScintilla(scintillacon.SCI_CALLTIPACTIVE) def SCICallTipPosStart(self): ! return self.SendScintilla(scintillacon.SCI_CALLTIPPOSSTART) def SCINewline(self): ! self.SendScintilla(scintillacon.SCI_NEWLINE) # Lexer etc def SCISetKeywords(self, keywords, kw_list_no = 0): buff = (keywords+"\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, buff) def SCISetProperty(self, name, value): name_buff = array.array('b', (name + '\0').encode('utf-8')) *************** *** 227,264 **** address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] ! self.SendScintilla(SCI_SETPROPERTY, address_name_buffer, address_val_buffer) def SCISetStyleBits(self, nbits): ! self.SendScintilla(SCI_SETSTYLEBITS, nbits) # Folding def SCIGetFoldLevel(self, lineno): ! return self.SendScintilla(SCI_GETFOLDLEVEL, lineno) def SCIToggleFold(self, lineno): ! return self.SendScintilla(SCI_TOGGLEFOLD, lineno) def SCIEnsureVisible(self, lineno): ! self.SendScintilla(SCI_ENSUREVISIBLE, lineno) def SCIGetFoldExpanded(self, lineno): ! return self.SendScintilla(SCI_GETFOLDEXPANDED, lineno) # right edge def SCISetEdgeColumn(self, edge): ! self.SendScintilla(SCI_SETEDGECOLUMN, edge) def SCIGetEdgeColumn(self): ! return self.SendScintilla(SCI_GETEDGECOLUMN) def SCISetEdgeMode(self, mode): ! self.SendScintilla(SCI_SETEDGEMODE, mode) def SCIGetEdgeMode(self): ! return self.SendScintilla(SCI_GETEDGEMODE) def SCISetEdgeColor(self, color): ! self.SendScintilla(SCI_SETEDGECOLOUR, color) def SCIGetEdgeColor(self): ! return self.SendScintilla(SCI_GETEDGECOLOR) # Multi-doc def SCIGetDocPointer(self): ! return self.SendScintilla(SCI_GETDOCPOINTER) def SCISetDocPointer(self, p): ! return self.SendScintilla(SCI_SETDOCPOINTER, 0, p) def SCISetWrapMode(self, mode): ! return self.SendScintilla(SCI_SETWRAPMODE, mode) def SCIGetWrapMode(self): ! return self.SendScintilla(SCI_GETWRAPMODE) class CScintillaEditInterface(ScintillaControlInterface): --- 228,265 ---- address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_SETPROPERTY, address_name_buffer, address_val_buffer) def SCISetStyleBits(self, nbits): ! self.SendScintilla(scintillacon.SCI_SETSTYLEBITS, nbits) # Folding def SCIGetFoldLevel(self, lineno): ! return self.SendScintilla(scintillacon.SCI_GETFOLDLEVEL, lineno) def SCIToggleFold(self, lineno): ! return self.SendScintilla(scintillacon.SCI_TOGGLEFOLD, lineno) def SCIEnsureVisible(self, lineno): ! self.SendScintilla(scintillacon.SCI_ENSUREVISIBLE, lineno) def SCIGetFoldExpanded(self, lineno): ! return self.SendScintilla(scintillacon.SCI_GETFOLDEXPANDED, lineno) # right edge def SCISetEdgeColumn(self, edge): ! self.SendScintilla(scintillacon.SCI_SETEDGECOLUMN, edge) def SCIGetEdgeColumn(self): ! return self.SendScintilla(scintillacon.SCI_GETEDGECOLUMN) def SCISetEdgeMode(self, mode): ! self.SendScintilla(scintillacon.SCI_SETEDGEMODE, mode) def SCIGetEdgeMode(self): ! return self.SendScintilla(scintillacon.SCI_GETEDGEMODE) def SCISetEdgeColor(self, color): ! self.SendScintilla(scintillacon.SCI_SETEDGECOLOUR, color) def SCIGetEdgeColor(self): ! return self.SendScintilla(scintillacon.SCI_GETEDGECOLOR) # Multi-doc def SCIGetDocPointer(self): ! return self.SendScintilla(scintillacon.SCI_GETDOCPOINTER) def SCISetDocPointer(self, p): ! return self.SendScintilla(scintillacon.SCI_SETDOCPOINTER, 0, p) def SCISetWrapMode(self, mode): ! return self.SendScintilla(scintillacon.SCI_SETWRAPMODE, mode) def SCIGetWrapMode(self): ! return self.SendScintilla(scintillacon.SCI_GETWRAPMODE) class CScintillaEditInterface(ScintillaControlInterface): *************** *** 290,295 **** def GetSel(self): ! currentPos = self.SendScintilla(SCI_GETCURRENTPOS) ! anchorPos = self.SendScintilla(SCI_GETANCHOR) if currentPos < anchorPos: return (currentPos, anchorPos) --- 291,296 ---- def GetSel(self): ! currentPos = self.SendScintilla(scintillacon.SCI_GETCURRENTPOS) ! anchorPos = self.SendScintilla(scintillacon.SCI_GETANCHOR) if currentPos < anchorPos: return (currentPos, anchorPos) *************** *** 359,363 **** def ReplaceSel(self, str): buff = (str + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(SCI_REPLACESEL, 0, buff) def GetLine(self, line=-1): --- 360,364 ---- def ReplaceSel(self, str): buff = (str + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_REPLACESEL, 0, buff) def GetLine(self, line=-1): |
From: Roger U. <ru...@us...> - 2008-09-02 20:56:07
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32293 Modified Files: coloreditor.py Log Message: Remove import * Index: coloreditor.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color/coloreditor.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** coloreditor.py 13 Jun 2008 20:47:56 -0000 1.13 --- coloreditor.py 2 Sep 2008 20:56:16 -0000 1.14 *************** *** 19,30 **** MARKER_CURRENT = 2 ! # XXX - copied from debugger\dbgcon.py ! DBGSTATE_NOT_DEBUGGING = 0 ! DBGSTATE_RUNNING = 1 ! DBGSTATE_BREAK = 2 ! from pywin.scintilla.document import CScintillaDocument from pywin.framework.editor.document import EditorDocumentBase ! from pywin.scintilla.scintillacon import * # For the marker definitions import pywin.scintilla.view --- 19,26 ---- MARKER_CURRENT = 2 ! from pywin.debugger import dbgcon from pywin.scintilla.document import CScintillaDocument from pywin.framework.editor.document import EditorDocumentBase ! from pywin.scintilla import scintillacon # For the marker definitions import pywin.scintilla.view *************** *** 62,89 **** # Define the markers # self.SCIMarkerDeleteAll() ! self.SCIMarkerDefineAll(MARKER_BOOKMARK, SC_MARK_ROUNDRECT, win32api.RGB(0x0, 0x0, 0x0), win32api.RGB(0, 0xff, 0xff)) ! self.SCIMarkerDefine(MARKER_CURRENT, SC_MARK_ARROW) self.SCIMarkerSetBack(MARKER_CURRENT, win32api.RGB(0xff, 0xff, 0x00)) # Define the folding markers if 1: #traditional markers ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPEN, SC_MARK_MINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDER, SC_MARK_PLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERSUB, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERTAIL, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEREND, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPENMID, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) else: # curved markers ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefine(MARKER_BREAKPOINT, SC_MARK_CIRCLE) # Marker background depends on debugger state self.SCIMarkerSetFore(MARKER_BREAKPOINT, win32api.RGB(0x0, 0, 0)) --- 58,85 ---- # Define the markers # self.SCIMarkerDeleteAll() ! self.SCIMarkerDefineAll(MARKER_BOOKMARK, scintillacon.SC_MARK_ROUNDRECT, win32api.RGB(0x0, 0x0, 0x0), win32api.RGB(0, 0xff, 0xff)) ! self.SCIMarkerDefine(MARKER_CURRENT, scintillacon.SC_MARK_ARROW) self.SCIMarkerSetBack(MARKER_CURRENT, win32api.RGB(0xff, 0xff, 0x00)) # Define the folding markers if 1: #traditional markers ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPEN, scintillacon.SC_MARK_MINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDER, scintillacon.SC_MARK_PLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERSUB, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERTAIL, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEREND, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPENMID, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERMIDTAIL, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) else: # curved markers ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPEN, scintillacon.SC_MARK_CIRCLEMINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDER, scintillacon.SC_MARK_CIRCLEPLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERSUB, scintillacon.SC_MARK_VLINE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERTAIL, scintillacon.SC_MARK_LCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEREND, scintillacon.SC_MARK_CIRCLEPLUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPENMID, scintillacon.SC_MARK_CIRCLEMINUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERMIDTAIL, scintillacon.SC_MARK_TCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefine(MARKER_BREAKPOINT, scintillacon.SC_MARK_CIRCLE) # Marker background depends on debugger state self.SCIMarkerSetFore(MARKER_BREAKPOINT, win32api.RGB(0x0, 0, 0)) *************** *** 92,100 **** import pywin.debugger if pywin.debugger.currentDebugger is None: ! state = DBGSTATE_NOT_DEBUGGING else: state = pywin.debugger.currentDebugger.debuggerState except ImportError: ! state = DBGSTATE_NOT_DEBUGGING self.OnDebuggerStateChange(state) --- 88,96 ---- import pywin.debugger if pywin.debugger.currentDebugger is None: ! state = dbgcon.DBGSTATE_NOT_DEBUGGING else: state = pywin.debugger.currentDebugger.debuggerState except ImportError: ! state = dbgcon.DBGSTATE_NOT_DEBUGGING self.OnDebuggerStateChange(state) *************** *** 115,121 **** if GetEditorOption("Right Edge Enabled", 0): ! mode = EDGE_BACKGROUND else: ! mode = EDGE_NONE self.SCISetEdgeMode(mode) self.SCISetEdgeColumn( GetEditorOption("Right Edge Column", 75) ) --- 111,117 ---- if GetEditorOption("Right Edge Enabled", 0): ! mode = scintillacon.EDGE_BACKGROUND else: ! mode = scintillacon.EDGE_NONE self.SCISetEdgeMode(mode) self.SCISetEdgeColumn( GetEditorOption("Right Edge Column", 75) ) *************** *** 130,134 **** self.bFolding = GetEditorOption("Enable Folding", 1) fold_flags = 0 ! self.SendScintilla(SCI_SETMODEVENTMASK, SC_MOD_CHANGEFOLD); if self.bFolding: if GetEditorOption("Fold Lines", 1): --- 126,130 ---- self.bFolding = GetEditorOption("Enable Folding", 1) fold_flags = 0 ! self.SendScintilla(scintillacon.SCI_SETMODEVENTMASK, scintillacon.SC_MOD_CHANGEFOLD); if self.bFolding: if GetEditorOption("Fold Lines", 1): *************** *** 139,143 **** tt_color = GetEditorOption("Tab Timmy Color", win32api.RGB(0xff, 0, 0)) ! self.SendScintilla(SCI_INDICSETFORE, 1, tt_color) tt_use = GetEditorOption("Use Tab Timmy", 1) --- 135,139 ---- tt_color = GetEditorOption("Tab Timmy Color", win32api.RGB(0xff, 0, 0)) ! self.SendScintilla(scintillacon.SCI_INDICSETFORE, 1, tt_color) tt_use = GetEditorOption("Use Tab Timmy", 1) *************** *** 183,187 **** def OnDebuggerStateChange(self, state): ! if state == DBGSTATE_NOT_DEBUGGING: # Indicate breakpoints arent really usable. # Not quite white - useful when no marker margin, so set as background color. --- 179,183 ---- def OnDebuggerStateChange(self, state): ! if state == dbgcon.DBGSTATE_NOT_DEBUGGING: # Indicate breakpoints arent really usable. # Not quite white - useful when no marker margin, so set as background color. *************** *** 218,222 **** line_click = self.LineFromChar(notify.position) # max_line = self.GetLineCount() ! if self.SCIGetFoldLevel(line_click) & SC_FOLDLEVELHEADERFLAG: # If a fold point. self.SCIToggleFold(line_click) --- 214,218 ---- line_click = self.LineFromChar(notify.position) # max_line = self.GetLineCount() ! if self.SCIGetFoldLevel(line_click) & scintillacon.SC_FOLDLEVELHEADERFLAG: # If a fold point. self.SCIToggleFold(line_click) *************** *** 283,287 **** enable = 0 lineno = self.LineFromChar(self.GetSel()[0]) ! foldable = self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG is_expanded = self.SCIGetFoldExpanded(lineno) if id == win32ui.ID_VIEW_FOLD_EXPAND: --- 279,283 ---- enable = 0 lineno = self.LineFromChar(self.GetSel()[0]) ! foldable = self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG is_expanded = self.SCIGetFoldExpanded(lineno) if id == win32ui.ID_VIEW_FOLD_EXPAND: *************** *** 357,361 **** # Find the first line, and check out its state. for lineSeek in xrange(maxLine): ! if self.SCIGetFoldLevel(lineSeek) & SC_FOLDLEVELHEADERFLAG: expanding = not self.SCIGetFoldExpanded(lineSeek) break --- 353,357 ---- # Find the first line, and check out its state. for lineSeek in xrange(maxLine): ! if self.SCIGetFoldLevel(lineSeek) & scintillacon.SC_FOLDLEVELHEADERFLAG: expanding = not self.SCIGetFoldExpanded(lineSeek) break *************** *** 365,370 **** for lineSeek in xrange(lineSeek, maxLine): level = self.SCIGetFoldLevel(lineSeek) ! level_no = level & SC_FOLDLEVELNUMBERMASK - SC_FOLDLEVELBASE ! is_header = level & SC_FOLDLEVELHEADERFLAG # print lineSeek, level_no, is_header if level_no == 0 and is_header: --- 361,366 ---- for lineSeek in xrange(lineSeek, maxLine): level = self.SCIGetFoldLevel(lineSeek) ! level_no = level & scintillacon.SC_FOLDLEVELNUMBERMASK - scintillacon.SC_FOLDLEVELBASE ! is_header = level & scintillacon.SC_FOLDLEVELHEADERFLAG # print lineSeek, level_no, is_header if level_no == 0 and is_header: *************** *** 382,392 **** ## already formatted parts of file outside visible window. self.Colorize() ! levels=[SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) --- 378,388 ---- ## already formatted parts of file outside visible window. self.Colorize() ! levels=[scintillacon.SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & scintillacon.SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & scintillacon.SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) *************** *** 408,418 **** ## already formatted parts of file outside visible window. self.Colorize() ! levels=[SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) --- 404,414 ---- ## already formatted parts of file outside visible window. self.Colorize() ! levels=[scintillacon.SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in xrange(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & scintillacon.SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & scintillacon.SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) *************** *** 432,436 **** win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 428,432 ---- win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 442,446 **** win32ui.DoWaitCursor(1) for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 438,442 ---- win32ui.DoWaitCursor(1) for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 452,456 **** win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 448,452 ---- win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 463,467 **** self.Colorize() for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 459,463 ---- self.Colorize() for lineno in xrange(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) |
From: Roger U. <ru...@us...> - 2008-09-02 20:41:28
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26146 Modified Files: Tag: py3k coloreditor.py Log Message: Remove import * Index: coloreditor.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color/coloreditor.py,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** coloreditor.py 29 Aug 2008 06:17:09 -0000 1.13.2.1 --- coloreditor.py 2 Sep 2008 20:41:37 -0000 1.13.2.2 *************** *** 19,30 **** MARKER_CURRENT = 2 ! # XXX - copied from debugger\dbgcon.py ! DBGSTATE_NOT_DEBUGGING = 0 ! DBGSTATE_RUNNING = 1 ! DBGSTATE_BREAK = 2 ! from pywin.scintilla.document import CScintillaDocument from pywin.framework.editor.document import EditorDocumentBase ! from pywin.scintilla.scintillacon import * # For the marker definitions import pywin.scintilla.view --- 19,26 ---- MARKER_CURRENT = 2 ! from pywin.debugger import dbgcon from pywin.scintilla.document import CScintillaDocument from pywin.framework.editor.document import EditorDocumentBase ! from pywin.scintilla import scintillacon # For the marker definitions import pywin.scintilla.view *************** *** 62,89 **** # Define the markers # self.SCIMarkerDeleteAll() ! self.SCIMarkerDefineAll(MARKER_BOOKMARK, SC_MARK_ROUNDRECT, win32api.RGB(0x0, 0x0, 0x0), win32api.RGB(0, 0xff, 0xff)) ! self.SCIMarkerDefine(MARKER_CURRENT, SC_MARK_ARROW) self.SCIMarkerSetBack(MARKER_CURRENT, win32api.RGB(0xff, 0xff, 0x00)) # Define the folding markers if 1: #traditional markers ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPEN, SC_MARK_MINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDER, SC_MARK_PLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERSUB, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERTAIL, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEREND, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPENMID, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) else: # curved markers ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefine(MARKER_BREAKPOINT, SC_MARK_CIRCLE) # Marker background depends on debugger state self.SCIMarkerSetFore(MARKER_BREAKPOINT, win32api.RGB(0x0, 0, 0)) --- 58,85 ---- # Define the markers # self.SCIMarkerDeleteAll() ! self.SCIMarkerDefineAll(MARKER_BOOKMARK, scintillacon.SC_MARK_ROUNDRECT, win32api.RGB(0x0, 0x0, 0x0), win32api.RGB(0, 0xff, 0xff)) ! self.SCIMarkerDefine(MARKER_CURRENT, scintillacon.SC_MARK_ARROW) self.SCIMarkerSetBack(MARKER_CURRENT, win32api.RGB(0xff, 0xff, 0x00)) # Define the folding markers if 1: #traditional markers ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPEN, scintillacon.SC_MARK_MINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDER, scintillacon.SC_MARK_PLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERSUB, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERTAIL, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEREND, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPENMID, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERMIDTAIL, scintillacon.SC_MARK_EMPTY, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) else: # curved markers ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPEN, scintillacon.SC_MARK_CIRCLEMINUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDER, scintillacon.SC_MARK_CIRCLEPLUS, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERSUB, scintillacon.SC_MARK_VLINE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERTAIL, scintillacon.SC_MARK_LCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEREND, scintillacon.SC_MARK_CIRCLEPLUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDEROPENMID, scintillacon.SC_MARK_CIRCLEMINUSCONNECTED, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefineAll(scintillacon.SC_MARKNUM_FOLDERMIDTAIL, scintillacon.SC_MARK_TCORNERCURVE, win32api.RGB(0xff, 0xff, 0xff), win32api.RGB(0, 0, 0)) ! self.SCIMarkerDefine(MARKER_BREAKPOINT, scintillacon.SC_MARK_CIRCLE) # Marker background depends on debugger state self.SCIMarkerSetFore(MARKER_BREAKPOINT, win32api.RGB(0x0, 0, 0)) *************** *** 92,100 **** import pywin.debugger if pywin.debugger.currentDebugger is None: ! state = DBGSTATE_NOT_DEBUGGING else: state = pywin.debugger.currentDebugger.debuggerState except ImportError: ! state = DBGSTATE_NOT_DEBUGGING self.OnDebuggerStateChange(state) --- 88,96 ---- import pywin.debugger if pywin.debugger.currentDebugger is None: ! state = dbgcon.DBGSTATE_NOT_DEBUGGING else: state = pywin.debugger.currentDebugger.debuggerState except ImportError: ! state = dbgcon.DBGSTATE_NOT_DEBUGGING self.OnDebuggerStateChange(state) *************** *** 115,121 **** if GetEditorOption("Right Edge Enabled", 0): ! mode = EDGE_BACKGROUND else: ! mode = EDGE_NONE self.SCISetEdgeMode(mode) self.SCISetEdgeColumn( GetEditorOption("Right Edge Column", 75) ) --- 111,117 ---- if GetEditorOption("Right Edge Enabled", 0): ! mode = scintillacon.EDGE_BACKGROUND else: ! mode = scintillacon.EDGE_NONE self.SCISetEdgeMode(mode) self.SCISetEdgeColumn( GetEditorOption("Right Edge Column", 75) ) *************** *** 130,134 **** self.bFolding = GetEditorOption("Enable Folding", 1) fold_flags = 0 ! self.SendScintilla(SCI_SETMODEVENTMASK, SC_MOD_CHANGEFOLD); if self.bFolding: if GetEditorOption("Fold Lines", 1): --- 126,130 ---- self.bFolding = GetEditorOption("Enable Folding", 1) fold_flags = 0 ! self.SendScintilla(scintillacon.SCI_SETMODEVENTMASK, scintillacon.SC_MOD_CHANGEFOLD); if self.bFolding: if GetEditorOption("Fold Lines", 1): *************** *** 139,143 **** tt_color = GetEditorOption("Tab Timmy Color", win32api.RGB(0xff, 0, 0)) ! self.SendScintilla(SCI_INDICSETFORE, 1, tt_color) tt_use = GetEditorOption("Use Tab Timmy", 1) --- 135,139 ---- tt_color = GetEditorOption("Tab Timmy Color", win32api.RGB(0xff, 0, 0)) ! self.SendScintilla(scintillacon.SCI_INDICSETFORE, 1, tt_color) tt_use = GetEditorOption("Use Tab Timmy", 1) *************** *** 183,187 **** def OnDebuggerStateChange(self, state): ! if state == DBGSTATE_NOT_DEBUGGING: # Indicate breakpoints arent really usable. # Not quite white - useful when no marker margin, so set as background color. --- 179,183 ---- def OnDebuggerStateChange(self, state): ! if state == dbgcon.DBGSTATE_NOT_DEBUGGING: # Indicate breakpoints arent really usable. # Not quite white - useful when no marker margin, so set as background color. *************** *** 218,222 **** line_click = self.LineFromChar(notify.position) # max_line = self.GetLineCount() ! if self.SCIGetFoldLevel(line_click) & SC_FOLDLEVELHEADERFLAG: # If a fold point. self.SCIToggleFold(line_click) --- 214,218 ---- line_click = self.LineFromChar(notify.position) # max_line = self.GetLineCount() ! if self.SCIGetFoldLevel(line_click) & scintillacon.SC_FOLDLEVELHEADERFLAG: # If a fold point. self.SCIToggleFold(line_click) *************** *** 283,287 **** enable = 0 lineno = self.LineFromChar(self.GetSel()[0]) ! foldable = self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG is_expanded = self.SCIGetFoldExpanded(lineno) if id == win32ui.ID_VIEW_FOLD_EXPAND: --- 279,283 ---- enable = 0 lineno = self.LineFromChar(self.GetSel()[0]) ! foldable = self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG is_expanded = self.SCIGetFoldExpanded(lineno) if id == win32ui.ID_VIEW_FOLD_EXPAND: *************** *** 357,361 **** # Find the first line, and check out its state. for lineSeek in range(maxLine): ! if self.SCIGetFoldLevel(lineSeek) & SC_FOLDLEVELHEADERFLAG: expanding = not self.SCIGetFoldExpanded(lineSeek) break --- 353,357 ---- # Find the first line, and check out its state. for lineSeek in range(maxLine): ! if self.SCIGetFoldLevel(lineSeek) & scintillacon.SC_FOLDLEVELHEADERFLAG: expanding = not self.SCIGetFoldExpanded(lineSeek) break *************** *** 365,370 **** for lineSeek in range(lineSeek, maxLine): level = self.SCIGetFoldLevel(lineSeek) ! level_no = level & SC_FOLDLEVELNUMBERMASK - SC_FOLDLEVELBASE ! is_header = level & SC_FOLDLEVELHEADERFLAG # print lineSeek, level_no, is_header if level_no == 0 and is_header: --- 361,366 ---- for lineSeek in range(lineSeek, maxLine): level = self.SCIGetFoldLevel(lineSeek) ! level_no = level & scintillacon.SC_FOLDLEVELNUMBERMASK - scintillacon.SC_FOLDLEVELBASE ! is_header = level & scintillacon.SC_FOLDLEVELHEADERFLAG # print lineSeek, level_no, is_header if level_no == 0 and is_header: *************** *** 382,392 **** ## already formatted parts of file outside visible window. self.Colorize() ! levels=[SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in range(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) --- 378,388 ---- ## already formatted parts of file outside visible window. self.Colorize() ! levels=[scintillacon.SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in range(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & scintillacon.SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & scintillacon.SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) *************** *** 408,418 **** ## already formatted parts of file outside visible window. self.Colorize() ! levels=[SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in range(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) --- 404,414 ---- ## already formatted parts of file outside visible window. self.Colorize() ! levels=[scintillacon.SC_FOLDLEVELBASE] ## Scintilla's level number is based on amount of whitespace indentation for lineno in range(self.GetLineCount()): level = self.SCIGetFoldLevel(lineno) ! if not level & scintillacon.SC_FOLDLEVELHEADERFLAG: continue ! curr_level = level & scintillacon.SC_FOLDLEVELNUMBERMASK if curr_level > levels[-1]: levels.append(curr_level) *************** *** 432,436 **** win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 428,432 ---- win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 442,446 **** win32ui.DoWaitCursor(1) for lineno in range(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 438,442 ---- win32ui.DoWaitCursor(1) for lineno in range(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ not self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 452,456 **** win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 448,452 ---- win32ui.DoWaitCursor(1) lineno = self.LineFromChar(self.GetSel()[0]) ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) *************** *** 463,467 **** self.Colorize() for lineno in range(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) --- 459,463 ---- self.Colorize() for lineno in range(0, self.GetLineCount()): ! if self.SCIGetFoldLevel(lineno) & scintillacon.SC_FOLDLEVELHEADERFLAG and \ self.SCIGetFoldExpanded(lineno): self.SCIToggleFold(lineno) |
From: Roger U. <ru...@us...> - 2008-09-02 19:52:23
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6305 Modified Files: document.py Log Message: Remove import * Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** document.py 29 Oct 2000 23:44:42 -0000 1.6 --- document.py 2 Sep 2008 19:52:33 -0000 1.7 *************** *** 2,6 **** from pywin.mfc import docview from pywin import is_platform_unicode, default_platform_encoding, default_scintilla_encoding ! from scintillacon import * import win32con import string --- 2,6 ---- from pywin.mfc import docview from pywin import is_platform_unicode, default_platform_encoding, default_scintilla_encoding ! import scintillacon import win32con import string *************** *** 58,69 **** if view.IsWindow(): # Turn off undo collection while loading ! view.SendScintilla(SCI_SETUNDOCOLLECTION, 0, 0) # Make sure the control isnt read-only view.SetReadOnly(0) doc = self ! view.SendScintilla(SCI_CLEARALL) ! view.SendMessage(SCI_ADDTEXT, buffer(text)) ! view.SendScintilla(SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) --- 58,69 ---- if view.IsWindow(): # Turn off undo collection while loading ! view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 0, 0) # Make sure the control isnt read-only view.SetReadOnly(0) doc = self ! view.SendScintilla(scintillacon.SCI_CLEARALL) ! view.SendMessage(scintillacon.SCI_ADDTEXT, buffer(text)) ! view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) *************** *** 73,83 **** def HookViewNotifications(self, view): parent = view.GetParentFrame() ! parent.HookNotify(ViewNotifyDelegate(self, "OnBraceMatch"), SCN_CHECKBRACE) ! parent.HookNotify(ViewNotifyDelegate(self, "OnMarginClick"), SCN_MARGINCLICK) ! parent.HookNotify(ViewNotifyDelegate(self, "OnNeedShown"), SCN_NEEDSHOWN) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointReached"), SCN_SAVEPOINTREACHED) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointLeft"), SCN_SAVEPOINTLEFT) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnModifyAttemptRO"), SCN_MODIFYATTEMPTRO) # Tell scintilla what characters should abort auto-complete. view.SCIAutoCStops(string.whitespace+"()[]:;+-/*=\\?'!#@$%^&,<>\"'|" ) --- 73,83 ---- def HookViewNotifications(self, view): parent = view.GetParentFrame() ! parent.HookNotify(ViewNotifyDelegate(self, "OnBraceMatch"), scintillacon.SCN_CHECKBRACE) ! parent.HookNotify(ViewNotifyDelegate(self, "OnMarginClick"), scintillacon.SCN_MARGINCLICK) ! parent.HookNotify(ViewNotifyDelegate(self, "OnNeedShown"), scintillacon.SCN_NEEDSHOWN) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointReached"), scintillacon.SCN_SAVEPOINTREACHED) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointLeft"), scintillacon.SCN_SAVEPOINTLEFT) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnModifyAttemptRO"), scintillacon.SCN_MODIFYATTEMPTRO) # Tell scintilla what characters should abort auto-complete. view.SCIAutoCStops(string.whitespace+"()[]:;+-/*=\\?'!#@$%^&,<>\"'|" ) |
From: Roger U. <ru...@us...> - 2008-09-02 19:45:10
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3505 Modified Files: Tag: py3k document.py Log Message: Remove import * Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.2 diff -C2 -d -r1.6.4.1 -r1.6.4.2 *** document.py 29 Aug 2008 06:16:42 -0000 1.6.4.1 --- document.py 2 Sep 2008 19:45:18 -0000 1.6.4.2 *************** *** 2,6 **** from pywin.mfc import docview from pywin import is_platform_unicode, default_platform_encoding, default_scintilla_encoding ! from .scintillacon import * import win32con import string --- 2,6 ---- from pywin.mfc import docview from pywin import is_platform_unicode, default_platform_encoding, default_scintilla_encoding ! from . import scintillacon import win32con import string *************** *** 59,70 **** if view.IsWindow(): # Turn off undo collection while loading ! view.SendScintilla(SCI_SETUNDOCOLLECTION, 0, 0) # Make sure the control isnt read-only view.SetReadOnly(0) doc = self ! view.SendScintilla(SCI_CLEARALL) ! view.SendMessage(SCI_ADDTEXT, text) ! view.SendScintilla(SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) --- 59,70 ---- if view.IsWindow(): # Turn off undo collection while loading ! view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 0, 0) # Make sure the control isnt read-only view.SetReadOnly(0) doc = self ! view.SendScintilla(scintillacon.SCI_CLEARALL) ! view.SendMessage(scintillacon.SCI_ADDTEXT, text) ! view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) *************** *** 74,84 **** def HookViewNotifications(self, view): parent = view.GetParentFrame() ! parent.HookNotify(ViewNotifyDelegate(self, "OnBraceMatch"), SCN_CHECKBRACE) ! parent.HookNotify(ViewNotifyDelegate(self, "OnMarginClick"), SCN_MARGINCLICK) ! parent.HookNotify(ViewNotifyDelegate(self, "OnNeedShown"), SCN_NEEDSHOWN) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointReached"), SCN_SAVEPOINTREACHED) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointLeft"), SCN_SAVEPOINTLEFT) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnModifyAttemptRO"), SCN_MODIFYATTEMPTRO) # Tell scintilla what characters should abort auto-complete. view.SCIAutoCStops(string.whitespace+"()[]:;+-/*=\\?'!#@$%^&,<>\"'|" ) --- 74,84 ---- def HookViewNotifications(self, view): parent = view.GetParentFrame() ! parent.HookNotify(ViewNotifyDelegate(self, "OnBraceMatch"), scintillacon.SCN_CHECKBRACE) ! parent.HookNotify(ViewNotifyDelegate(self, "OnMarginClick"), scintillacon.SCN_MARGINCLICK) ! parent.HookNotify(ViewNotifyDelegate(self, "OnNeedShown"), scintillacon.SCN_NEEDSHOWN) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointReached"), scintillacon.SCN_SAVEPOINTREACHED) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnSavePointLeft"), scintillacon.SCN_SAVEPOINTLEFT) ! parent.HookNotify(DocumentNotifyDelegate(self, "OnModifyAttemptRO"), scintillacon.SCN_MODIFYATTEMPTRO) # Tell scintilla what characters should abort auto-complete. view.SCIAutoCStops(string.whitespace+"()[]:;+-/*=\\?'!#@$%^&,<>\"'|" ) |
From: Roger U. <ru...@us...> - 2008-09-02 09:43:59
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16982 Modified Files: Tag: py3k ToDo.txt Log Message: Mark off a couple of things, and add a couple new things Index: ToDo.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/Attic/ToDo.txt,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** ToDo.txt 30 Aug 2008 22:38:06 -0000 1.1.2.3 --- ToDo.txt 2 Sep 2008 09:44:09 -0000 1.1.2.4 *************** *** 1,5 **** Some things that still need work for Python 3.0 - win32ras - Add constants with unicode names Places where need to call PyType_Ready for all types defined in module --- 1,4 ---- *************** *** 7,11 **** directsound dbi, odbc - win32ras, win2kras win32help --- 6,9 ---- *************** *** 17,23 **** but __argv is NULL Pythonwin - ! LVITEM and TVITEM conversions use PyWinobject_AsTCHAR, result needs to be freed xxx win32uimodule - Python_callback has 64-bit issues with HWND, WPARAM, LPARAM --- 15,23 ---- but __argv is NULL + pythoncom - Get*String routines for looking up error codes return bytes instead of unicode Pythonwin - ! xxx LVITEM and TVITEM conversions use PyWinobject_AsTCHAR, result needs to be freed ! LV_COLUMN conversion - same as above xxx win32uimodule - Python_callback has 64-bit issues with HWND, WPARAM, LPARAM *************** *** 48,50 **** Figure out a clean way to switch between commctrl.*A and commctrl.*W constants for hooking messages ! Add /ENTRY:wWinMainCRTStartup to linker args \ No newline at end of file --- 48,54 ---- Figure out a clean way to switch between commctrl.*A and commctrl.*W constants for hooking messages ! Add /ENTRY:wWinMainCRTStartup to linker args ! ! Need to override GetWindowText for scintilla controls - for WM_GETTEXT, text is returned as utf-8 bytes instead of wide-char ! ! |
From: Roger U. <ru...@us...> - 2008-09-02 09:39:39
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14865 Modified Files: Tag: py3k win2krasmodule.cpp win32rasmodule.cpp Log Message: Call PyType_Ready, add constants with unicode names Index: win2krasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win2krasmodule.cpp,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** win2krasmodule.cpp 29 Aug 2008 04:59:26 -0000 1.6.2.1 --- win2krasmodule.cpp 2 Sep 2008 09:39:31 -0000 1.6.2.2 *************** *** 93,99 **** 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ }; - PyRASEAPUSERIDENTITY::PyRASEAPUSERIDENTITY(RASEAPUSERIDENTITY *identity) { --- 93,117 ---- 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, // tp_flags; + "An object that describes a Win32 RASDIALEXTENSIONS structure", // tp_doc + 0, // tp_traverse; + 0, // tp_clear + 0, // tp_richcompare; + 0, // tp_weaklistoffset; + 0, // tp_iter + 0, // iternextfunc tp_iternext + 0, // tp_methods + 0, // tp_members + 0, // tp_getset; + 0, // tp_base; + 0, // tp_dict; + 0, // tp_descr_get; + 0, // tp_descr_set; + 0, // tp_dictoffset; + 0, // tp_init; + 0, // tp_alloc; + 0, // newfunc tp_new; }; PyRASEAPUSERIDENTITY::PyRASEAPUSERIDENTITY(RASEAPUSERIDENTITY *identity) { *************** *** 175,196 **** }; - int AddConstant(PyObject *dict, char *key, long value) - { - PyObject *okey = PyString_FromString(key); - PyObject *oval = PyInt_FromLong(value); - if (!okey || !oval) { - Py_XDECREF(okey); - Py_XDECREF(oval); - return 1; - } - int rc = PyDict_SetItem(dict,okey, oval); - Py_XDECREF(okey); - Py_XDECREF(oval); - return rc; - } ! #define ADD_CONSTANT(tok) if (rc=AddConstant(dict,#tok, tok)) return rc ! static int AddConstants(PyObject *dict) { int rc; --- 193,200 ---- }; ! #define ADD_CONSTANT(tok) if (rc=PyModule_AddIntConstant(module, #tok, tok)) return rc ! static int AddConstants(PyObject *module) { int rc; *************** *** 237,241 **** #endif ! AddConstants(dict); #ifdef _DEBUG const TCHAR *modName = _T("win32ras_d.pyd"); --- 241,249 ---- #endif ! if (PyType_Ready(&PyRASEAPUSERIDENTITY::type) == -1) ! RETURN_ERROR; ! if (AddConstants(module) != 0) ! RETURN_ERROR; ! #ifdef _DEBUG const TCHAR *modName = _T("win32ras_d.pyd"); Index: win32rasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32rasmodule.cpp,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** win32rasmodule.cpp 29 Aug 2008 04:59:27 -0000 1.10.2.1 --- win32rasmodule.cpp 2 Sep 2008 09:39:31 -0000 1.10.2.2 *************** *** 139,143 **** #define PyRASDIALEXTENSIONS_Check(ob) ((ob)->ob_type == &PyRASDIALEXTENSIONS::type) ! // @object RASDIALEXTENSIONS|An object that describes a Win32 RASDIALPARAMS structure BOOL PyWinObject_AsRASDIALEXTENSIONS(PyObject *ob, RASDIALEXTENSIONS **ppRASDIALEXTENSIONS, BOOL bNoneOK /*= TRUE*/) { --- 139,143 ---- #define PyRASDIALEXTENSIONS_Check(ob) ((ob)->ob_type == &PyRASDIALEXTENSIONS::type) ! // @object RASDIALEXTENSIONS|An object that describes a Win32 RASDIALEXTENSIONS structure BOOL PyWinObject_AsRASDIALEXTENSIONS(PyObject *ob, RASDIALEXTENSIONS **ppRASDIALEXTENSIONS, BOOL bNoneOK /*= TRUE*/) { *************** *** 178,184 **** 0, /* tp_call */ 0, /* tp_str */ ! PyRASDIALEXTENSIONS::getattro, /* tp_getattr */ ! PyRASDIALEXTENSIONS::setattro, /* tp_setattr */ ! 0, /*tp_as_buffer*/ }; --- 178,203 ---- 0, /* tp_call */ 0, /* tp_str */ ! PyRASDIALEXTENSIONS::getattro, /* tp_getattro */ ! PyRASDIALEXTENSIONS::setattro, /* tp_setattro */ ! 0, /*tp_as_buffer*/ ! Py_TPFLAGS_DEFAULT, // tp_flags; ! "An object that describes a Win32 RASDIALEXTENSIONS structure", // tp_doc ! 0, // tp_traverse; ! 0, // tp_clear ! 0, // tp_richcompare; ! 0, // tp_weaklistoffset; ! 0, // tp_iter ! 0, // iternextfunc tp_iternext ! 0, // tp_methods ! 0, // tp_members ! 0, // tp_getset; ! 0, // tp_base; ! 0, // tp_dict; ! 0, // tp_descr_get; ! 0, // tp_descr_set; ! 0, // tp_dictoffset; ! 0, // tp_init; ! 0, // tp_alloc; ! 0, // newfunc tp_new; }; *************** *** 807,832 **** }; ! int AddConstant(PyObject *dict, char *key, long value) ! { ! PyObject *okey = PyString_FromString(key); ! PyObject *oval = PyInt_FromLong(value); ! if (!okey || !oval) { ! Py_XDECREF(okey); ! Py_XDECREF(oval); ! return 1; ! } ! int rc = PyDict_SetItem(dict,okey, oval); ! Py_XDECREF(okey); ! Py_XDECREF(oval); ! return rc; ! } ! #define ADD_CONSTANT(tok) if (rc=AddConstant(dict,#tok, tok)) return rc ! #define ADD_ENUM(parta, partb) if (rc=AddConstant(dict,#parta "_" #partb, parta::partb)) return rc ! #define ADD_ENUM3(parta, partb, partc) if (rc=AddConstant(dict,#parta "_" #partb "_" #partc, parta::partb::partc)) return rc ! ! static int AddConstants(PyObject *dict) { ! int rc; ADD_CONSTANT(RASCS_OpenPort); // @const win32ras|RASCS_OpenPort|Constant for RAS state. ADD_CONSTANT(RASCS_PortOpened); // @const win32ras|RASCS_PortOpened|Constant for RAS state. --- 826,836 ---- }; + #define ADD_CONSTANT(tok) if (rc = PyModule_AddIntConstant(module, #tok, tok)) return rc + #define ADD_ENUM(parta, partb) if (rc = PyModule_AddIntConstant(module, #parta "_" #partb, parta::partb)) return rc + #define ADD_ENUM3(parta, partb, partc) if (rc = PyModule_AddIntConstant(module, #parta "_" #partb "_" #partc, parta::partb::partc)) return rc ! static int AddConstants(PyObject *module) { ! int rc; ADD_CONSTANT(RASCS_OpenPort); // @const win32ras|RASCS_OpenPort|Constant for RAS state. ADD_CONSTANT(RASCS_PortOpened); // @const win32ras|RASCS_PortOpened|Constant for RAS state. *************** *** 895,903 **** return NULL; #endif - module_error = PyWinExc_ApiError; Py_INCREF(module_error); PyDict_SetItemString(dict, "error", module_error); ! AddConstants(dict); #if (PY_VERSION_HEX >= 0x03000000) --- 899,909 ---- return NULL; #endif module_error = PyWinExc_ApiError; Py_INCREF(module_error); PyDict_SetItemString(dict, "error", module_error); ! if (PyType_Ready(&PyRASDIALEXTENSIONS::type) == -1) ! RETURN_ERROR; ! if (AddConstants(module) != 0) ! RETURN_ERROR; #if (PY_VERSION_HEX >= 0x03000000) |
From: Roger U. <ru...@us...> - 2008-09-02 02:14:35
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26302 Modified Files: Tag: py3k win32ctrlList.cpp win32ctrlTree.cpp win32notify.cpp win32ui.h win32util.cpp Log Message: Free string members of LV_ITEM and TV_ITEM Standardize names of conversion functions Index: win32ui.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ui.h,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** win32ui.h 29 Aug 2008 05:53:29 -0000 1.7.2.1 --- win32ui.h 2 Sep 2008 02:14:43 -0000 1.7.2.2 *************** *** 353,364 **** PYW_EXPORT PyObject *MakeParaFormatTuple(PARAFORMAT *pFmt); ! PYW_EXPORT PyObject *MakeLV_ITEMTuple(LV_ITEM *item); ! PYW_EXPORT BOOL ParseLV_ITEMTuple( PyObject *args, LV_ITEM *pItem); PYW_EXPORT PyObject *MakeLV_COLUMNTuple(LV_COLUMN *item); PYW_EXPORT BOOL ParseLV_COLUMNTuple( PyObject *args, LV_COLUMN *pItem); ! PYW_EXPORT BOOL ParseTV_ITEMTuple( PyObject *args, TV_ITEM *pItem); ! PYW_EXPORT PyObject *MakeTV_ITEMTuple(TV_ITEM *item); PyObject *PyWin_GetPythonObjectFromLong(LONG_PTR val); --- 353,366 ---- PYW_EXPORT PyObject *MakeParaFormatTuple(PARAFORMAT *pFmt); ! PYW_EXPORT PyObject *PyWinObject_FromLV_ITEM(LV_ITEM *pItem); ! PYW_EXPORT BOOL PyWinObject_AsLV_ITEM( PyObject *args, LV_ITEM *pItem); ! PYW_EXPORT void PyWinObject_FreeLV_ITEM(LV_ITEM *pItem); PYW_EXPORT PyObject *MakeLV_COLUMNTuple(LV_COLUMN *item); PYW_EXPORT BOOL ParseLV_COLUMNTuple( PyObject *args, LV_COLUMN *pItem); ! PYW_EXPORT BOOL PyWinObject_AsTV_ITEM( PyObject *args, TV_ITEM *pItem); ! PYW_EXPORT PyObject *PyWinObject_FromTV_ITEM(TV_ITEM *pItem); ! PYW_EXPORT void PyWinObject_FreeTV_ITEM(TV_ITEM *pItem); PyObject *PyWin_GetPythonObjectFromLong(LONG_PTR val); Index: win32util.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** win32util.cpp 29 Aug 2008 05:53:30 -0000 1.13.2.1 --- win32util.cpp 2 Sep 2008 02:14:43 -0000 1.13.2.2 *************** *** 315,320 **** // // ! // LV_ITEM ! PyObject *MakeLV_ITEMTuple(LV_ITEM *item) { PyObject *ret = PyTuple_New(7); --- 315,320 ---- // // ! // LV_ITEM ! PyObject *PyWinObject_FromLV_ITEM(LV_ITEM *item) { PyObject *ret = PyTuple_New(7); *************** *** 353,356 **** --- 353,361 ---- } + void PyWinObject_FreeLV_ITEM(LV_ITEM *pItem){ + if (pItem->mask & LVIF_TEXT) + PyWinObject_FreeTCHAR(pItem->pszText); + } + // @object LV_ITEM|Describes an LV_ITEM tuple, used by the <o PyCListCtrl> object. // @tupleitem 0|int|item|The item number. *************** *** 364,371 **** // <nl>When passed from Python, the tuple must be at least 2 items long, and any item may be None. // <nl>userob is any Python object at all, but no reference count is kept, so you must ensure the object remains referenced throught the lists life. ! BOOL ParseLV_ITEMTuple( PyObject *args, LV_ITEM *pItem) { ! PyObject *ob; ! pItem->mask = 0; Py_ssize_t len = PyTuple_Size(args); if (len<2 || len > 7) { --- 369,376 ---- // <nl>When passed from Python, the tuple must be at least 2 items long, and any item may be None. // <nl>userob is any Python object at all, but no reference count is kept, so you must ensure the object remains referenced throught the lists life. ! BOOL PyWinObject_AsLV_ITEM( PyObject *args, LV_ITEM *pItem) { ! ZeroMemory(pItem, sizeof(*pItem)); ! PyObject *ob, *ob2; Py_ssize_t len = PyTuple_Size(args); if (len<2 || len > 7) { *************** *** 373,426 **** return FALSE; } ! // ??? This is questionable, shouldn't be any exceptions left hanging, and if this is called ! // from someplace where an exception legitimately exists, should fetch/restore the exception. ??? ! assert (!PyErr_Occurred()); // PyErr_Clear(); // clear any errors, so I can detect my own. // 0 - iItem. ! if ((ob=PyTuple_GetItem(args, 0))==NULL) return FALSE; ! pItem->iItem = (UINT)PyInt_AsLong(ob); ! if (PyErr_Occurred()) return FALSE; // 1 - iSubItem ! if ((ob=PyTuple_GetItem(args, 1))==NULL) return FALSE; ! pItem->iSubItem = (UINT)PyInt_AsLong(ob); ! if (PyErr_Occurred()) return FALSE; ! // 1/2 - state/stateMask ! if (len<4) return TRUE; ! if ((ob=PyTuple_GetItem(args, 2))==NULL) return FALSE; ! if (ob != Py_None) { ! pItem->state = (UINT)PyInt_AsLong(ob); ! if (PyErr_Occurred() || (ob=PyTuple_GetItem(args, 3))==NULL) return FALSE; - pItem->stateMask = (UINT)PyInt_AsLong(ob); - if (PyErr_Occurred()) return FALSE; pItem->mask |= LVIF_STATE; } if (len<5) return TRUE; ob=PyTuple_GET_ITEM(args, 4); if (!PyWinObject_AsTCHAR(ob, &pItem->pszText, TRUE, (DWORD *)&pItem->cchTextMax)) return FALSE; - // ??? Need to free this somewhere ??? if (pItem->pszText) pItem->mask |= LVIF_TEXT; if (len<6) return TRUE; ! if ((ob=PyTuple_GetItem(args, 5))==NULL) ! return FALSE; if (ob != Py_None) { - pItem->mask |= LVIF_IMAGE; pItem->iImage = PyInt_AsLong(ob); ! if (PyErr_Occurred()) return FALSE; ! } if (len<7) return TRUE; ! if ((ob=PyTuple_GetItem(args, 6))==NULL) return FALSE; ! if (ob != Py_None) { pItem->mask |= LVIF_PARAM; ! pItem->lParam = PyInt_AsLong(ob); ! } return TRUE; } --- 378,446 ---- return FALSE; } ! // 0 - iItem. ! ob=PyTuple_GET_ITEM(args, 0); ! pItem->iItem = PyInt_AsLong(ob); ! if (pItem->iImage == -1 && PyErr_Occurred()) return FALSE; ! // 1 - iSubItem ! ob=PyTuple_GET_ITEM(args, 1); ! pItem->iSubItem = PyInt_AsLong(ob); ! if (pItem->iSubItem == -1 && PyErr_Occurred()) return FALSE; ! ! // 2/3 - state/stateMask ! if (len<3) return TRUE; ! if (len<4){ ! PyErr_SetString(PyExc_TypeError, "LV_ITEM: Statemask must be provided if state if provided"); return FALSE; ! } ! ob=PyTuple_GET_ITEM(args, 2); ! ob2=PyTuple_GET_ITEM(args, 3); ! if (ob==Py_None && ob2==Py_None) ! ; ! else if (ob==Py_None || ob2==Py_None) { ! PyErr_SetString(PyExc_TypeError, "LV_ITEM - state and stateMask must both be None, or both not None"); ! return FALSE; ! } else { ! pItem->state = PyInt_AsLong(ob); ! if (pItem->state == -1 && PyErr_Occurred()) ! return FALSE; ! pItem->stateMask = PyInt_AsLong(ob2); ! if (pItem->stateMask == -1 && PyErr_Occurred()) return FALSE; pItem->mask |= LVIF_STATE; } + // 4 - text if (len<5) return TRUE; ob=PyTuple_GET_ITEM(args, 4); if (!PyWinObject_AsTCHAR(ob, &pItem->pszText, TRUE, (DWORD *)&pItem->cchTextMax)) return FALSE; if (pItem->pszText) pItem->mask |= LVIF_TEXT; + // 5 - image index if (len<6) return TRUE; ! ob=PyTuple_GET_ITEM(args, 5); if (ob != Py_None) { pItem->iImage = PyInt_AsLong(ob); ! if (pItem->iImage == -1 && PyErr_Occurred()){ ! PyWinObject_FreeLV_ITEM(pItem); return FALSE; ! } ! pItem->mask |= LVIF_IMAGE; ! } ! if (len<7) return TRUE; ! ob=PyTuple_GET_ITEM(args, 6); ! if (!PyWinObject_AsPARAM(ob, &pItem->lParam)){ ! PyWinObject_FreeLV_ITEM(pItem); return FALSE; ! } ! if (pItem->lParam) pItem->mask |= LVIF_PARAM; ! return TRUE; } *************** *** 523,527 **** // // TV_ITEM ! PyObject *MakeTV_ITEMTuple(TV_ITEM *item) { PyObject *ret = PyTuple_New(8); --- 543,547 ---- // // TV_ITEM ! PyObject *PyWinObject_FromTV_ITEM(TV_ITEM *item) { PyObject *ret = PyTuple_New(8); *************** *** 576,588 **** } // @object TV_ITEM|Describes a TV_ITEM tuple, used by the <o PyCListCtrl> object. // A tuple of 8 items: // <nl>When returned from a win32ui function, will always be a tuple of size 8, and items may be None if not available. // <nl>When passed to a win32ui function, the tuple may be any length up to 8, and any item may be None. ! BOOL ParseTV_ITEMTuple( PyObject *args, TV_ITEM *pItem) { PyObject *ob; PyObject *ob2; - pItem->mask = 0; Py_ssize_t len = PyTuple_Size(args); if (len > 8) { --- 596,613 ---- } + void PyWinObject_FreeTV_ITEM(TV_ITEM *pItem){ + if (pItem->mask & TVIF_TEXT) + PyWinObject_FreeTCHAR(pItem->pszText); + } + // @object TV_ITEM|Describes a TV_ITEM tuple, used by the <o PyCListCtrl> object. // A tuple of 8 items: // <nl>When returned from a win32ui function, will always be a tuple of size 8, and items may be None if not available. // <nl>When passed to a win32ui function, the tuple may be any length up to 8, and any item may be None. ! BOOL PyWinObject_AsTV_ITEM( PyObject *args, TV_ITEM *pItem) { + ZeroMemory(pItem, sizeof(*pItem)); PyObject *ob; PyObject *ob2; Py_ssize_t len = PyTuple_Size(args); if (len > 8) { *************** *** 590,598 **** return FALSE; } - assert (!PyErr_Occurred()); // PyErr_Clear(); // clear any errors, so I can detect my own. // 0 - hItem if (len<1) return TRUE; ! if ((ob=PyTuple_GetItem(args, 0))==NULL) ! return FALSE; if (ob != Py_None) { // @tupleitem 0|int|hItem|Item handle --- 615,621 ---- return FALSE; } // 0 - hItem if (len<1) return TRUE; ! ob=PyTuple_GET_ITEM(args, 0); if (ob != Py_None) { // @tupleitem 0|int|hItem|Item handle *************** *** 601,604 **** --- 624,628 ---- pItem->mask |= TVIF_HANDLE; } + // 1,2 - state/stateMask if (len<2) return TRUE; *************** *** 607,614 **** return FALSE; } ! if ((ob=PyTuple_GetItem(args, 1))==NULL) ! return FALSE; ! if ((ob2=PyTuple_GetItem(args, 2))==NULL) ! return FALSE; if (ob==Py_None && ob2==Py_None) ; --- 631,636 ---- return FALSE; } ! ob=PyTuple_GET_ITEM(args, 1); ! ob2=PyTuple_GET_ITEM(args, 2); if (ob==Py_None && ob2==Py_None) ; *************** *** 619,625 **** // @tupleitem 1|int|state|Item state. If specified, the stateMask must also be specified. // @tupleitem 2|int|stateMask|Item state mask ! pItem->state = (int)PyInt_AsLong(ob); ! pItem->stateMask = (int)PyInt_AsLong(ob2); ! if (PyErr_Occurred()) return FALSE; pItem->mask |= TVIF_STATE; } --- 641,650 ---- // @tupleitem 1|int|state|Item state. If specified, the stateMask must also be specified. // @tupleitem 2|int|stateMask|Item state mask ! pItem->state = PyInt_AsLong(ob); ! if (pItem->state == -1 && PyErr_Occurred()) ! return FALSE; ! pItem->stateMask = PyInt_AsLong(ob2); ! if (pItem->stateMask == -1 && PyErr_Occurred()) ! return FALSE; pItem->mask |= TVIF_STATE; } *************** *** 630,635 **** // @tupleitem 3|string|text|Item text if (!PyWinObject_AsTCHAR(ob, &pItem->pszText, TRUE, (DWORD *)&pItem->cchTextMax)) ! return FALSE; ! // ??? This need to be freed after use ??? if (pItem->pszText) pItem->mask |= TVIF_TEXT; --- 655,659 ---- // @tupleitem 3|string|text|Item text if (!PyWinObject_AsTCHAR(ob, &pItem->pszText, TRUE, (DWORD *)&pItem->cchTextMax)) ! return FALSE; // last exit without cleanup if (pItem->pszText) pItem->mask |= TVIF_TEXT; *************** *** 637,676 **** // 4 - image if (len<5) return TRUE; ! if ((ob=PyTuple_GetItem(args, 4))==NULL) ! return FALSE; if (ob != Py_None) { pItem->mask |= TVIF_IMAGE; ! // @tupleitem 4|int|iImage|Offset of items image. ! pItem->iImage = (int)PyInt_AsLong(ob); ! } // 5 - imageSelected if (len<6) return TRUE; ! if ((ob=PyTuple_GetItem(args, 5))==NULL) ! return FALSE; if (ob != Py_None) { // @tupleitem 5|int|iSelectedImage|Offset of items selected image. pItem->mask |= TVIF_SELECTEDIMAGE; ! pItem->iSelectedImage = (int)PyInt_AsLong(ob); ! } // 6 - cChildren if (len<7) return TRUE; ! if ((ob=PyTuple_GetItem(args, 6))==NULL) ! return FALSE; if (ob != Py_None) { // @tupleitem 6|int|cChildren|Number of child items. - pItem->mask |= TVIF_CHILDREN; pItem->cChildren = PyInt_AsLong(ob); ! } // 7 - object if (len<8) return TRUE; ! if ((ob=PyTuple_GetItem(args, 7))==NULL) ! return FALSE; if (ob != Py_None) { // @tupleitem 7|int|lParam|User defined integer param. ! pItem->mask |= LVIF_PARAM; ! if (!PyWinObject_AsPARAM(ob, &pItem->lParam)) return FALSE; ! } ! return !PyErr_Occurred(); } --- 661,714 ---- // 4 - image if (len<5) return TRUE; ! ob=PyTuple_GET_ITEM(args, 4); if (ob != Py_None) { + // @tupleitem 4|int|iImage|Image list index of icon for non-seleted state. + pItem->iImage = PyInt_AsLong(ob); + if (pItem->iImage == -1 && PyErr_Occurred()){ + PyWinObject_FreeTV_ITEM(pItem); + return FALSE; + } pItem->mask |= TVIF_IMAGE; ! } ! // 5 - imageSelected if (len<6) return TRUE; ! ob=PyTuple_GET_ITEM(args, 5); if (ob != Py_None) { // @tupleitem 5|int|iSelectedImage|Offset of items selected image. + pItem->iSelectedImage = PyInt_AsLong(ob); + if (pItem->iSelectedImage == -1 && PyErr_Occurred()){ + PyWinObject_FreeTV_ITEM(pItem); + return FALSE; + } pItem->mask |= TVIF_SELECTEDIMAGE; ! } ! // 6 - cChildren if (len<7) return TRUE; ! ob=PyTuple_GET_ITEM(args, 6); if (ob != Py_None) { // @tupleitem 6|int|cChildren|Number of child items. pItem->cChildren = PyInt_AsLong(ob); ! if (pItem->cChildren == -1 && PyErr_Occurred()){ ! PyWinObject_FreeTV_ITEM(pItem); ! return FALSE; ! } ! pItem->mask |= TVIF_CHILDREN; ! } ! // 7 - object if (len<8) return TRUE; ! ob=PyTuple_GET_ITEM(args, 7); if (ob != Py_None) { // @tupleitem 7|int|lParam|User defined integer param. ! if (!PyWinObject_AsPARAM(ob, &pItem->lParam)){ ! PyWinObject_FreeTV_ITEM(pItem); return FALSE; ! } ! pItem->mask |= LVIF_PARAM; ! } ! ! return TRUE; } *************** *** 1064,1069 **** } ! // utility to get a nice printable string from any object. ! // reference neutral. NOT !!!!!!!! - Also needs adjustment for Py3k unicode repr CString GetReprText( PyObject *objectUse ) { --- 1102,1106 ---- } ! // utility to get a nice printable string from any object. (reference neutral) CString GetReprText( PyObject *objectUse ) { Index: win32notify.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32notify.cpp,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** win32notify.cpp 29 Aug 2008 05:53:29 -0000 1.7.2.1 --- win32notify.cpp 2 Sep 2008 02:14:43 -0000 1.7.2.2 *************** *** 87,91 **** case 'T': {// TV_ITEM structure TV_ITEM *ptv = (TV_ITEM *)pUse; ! ob = bIgnore ? NULL : MakeTV_ITEMTuple(ptv); pUse += (sizeof(TV_ITEM)); break; --- 87,91 ---- case 'T': {// TV_ITEM structure TV_ITEM *ptv = (TV_ITEM *)pUse; ! ob = bIgnore ? NULL : PyWinObject_FromTV_ITEM(ptv); pUse += (sizeof(TV_ITEM)); break; *************** *** 93,97 **** case 'L': {// LV_ITEM structure LV_ITEM *plv = (LV_ITEM *)pUse; ! ob = bIgnore ? NULL : MakeLV_ITEMTuple(plv); pUse += (sizeof(LV_ITEM)); break; --- 93,97 ---- case 'L': {// LV_ITEM structure LV_ITEM *plv = (LV_ITEM *)pUse; ! ob = bIgnore ? NULL : PyWinObject_FromLV_ITEM(plv); pUse += (sizeof(LV_ITEM)); break; *************** *** 312,317 **** ob2=Py_BuildValue("iNN(ll)", nmtv->action, ! MakeTV_ITEMTuple(&nmtv->itemOld), ! MakeTV_ITEMTuple(&nmtv->itemNew), nmtv->ptDrag.x, nmtv->ptDrag.y); } --- 312,317 ---- ob2=Py_BuildValue("iNN(ll)", nmtv->action, ! PyWinObject_FromTV_ITEM(&nmtv->itemOld), ! PyWinObject_FromTV_ITEM(&nmtv->itemNew), nmtv->ptDrag.x, nmtv->ptDrag.y); } Index: win32ctrlList.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlList.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 *** win32ctrlList.cpp 29 Aug 2008 05:53:29 -0000 1.3.2.1 --- win32ctrlList.cpp 2 Sep 2008 02:14:43 -0000 1.3.2.2 *************** *** 301,309 **** &obLVItem)) { // @pyparm <om PyCListCtrl.LV_ITEM tuple>|item||A tuple describing the new item. LV_ITEM lvItem; ! if (!ParseLV_ITEMTuple(obLVItem, &lvItem)) return NULL; GUI_BGN_SAVE; ret = pList->InsertItem(&lvItem); GUI_END_SAVE; } else { PyErr_Clear(); --- 301,310 ---- &obLVItem)) { // @pyparm <om PyCListCtrl.LV_ITEM tuple>|item||A tuple describing the new item. LV_ITEM lvItem; ! if (!PyWinObject_AsLV_ITEM(obLVItem, &lvItem)) return NULL; GUI_BGN_SAVE; ret = pList->InsertItem(&lvItem); GUI_END_SAVE; + PyWinObject_FreeLV_ITEM(&lvItem); } else { PyErr_Clear(); *************** *** 329,337 **** return NULL; LV_ITEM lvItem; ! if (!ParseLV_ITEMTuple(obLVItem, &lvItem)) return NULL; GUI_BGN_SAVE; BOOL ok = pList->SetItem(&lvItem); GUI_END_SAVE; if (!ok) RETURN_ERR("SetItem failed"); --- 330,339 ---- return NULL; LV_ITEM lvItem; ! if (!PyWinObject_AsLV_ITEM(obLVItem, &lvItem)) return NULL; GUI_BGN_SAVE; BOOL ok = pList->SetItem(&lvItem); GUI_END_SAVE; + PyWinObject_FreeLV_ITEM(&lvItem); if (!ok) RETURN_ERR("SetItem failed"); *************** *** 476,480 **** if (!ok) RETURN_ERR("GetItem failed"); ! return MakeLV_ITEMTuple(&lvItem); } --- 478,482 ---- if (!ok) RETURN_ERR("GetItem failed"); ! return PyWinObject_FromLV_ITEM(&lvItem); } Index: win32ctrlTree.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlTree.cpp,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** win32ctrlTree.cpp 29 Aug 2008 05:53:29 -0000 1.6.2.1 --- win32ctrlTree.cpp 2 Sep 2008 02:14:43 -0000 1.6.2.2 *************** *** 483,491 **** PyWinObject_AsHANDLE, &tvItem.hInsertAfter, // @pyparm HTREEITEM|hInsertAfter||The item to insert after. Can be an item or TVI_FIRST, TVI_LAST or TVI_SORT &obTVItem)) { // @pyparm <om PyCTreeCtrl.TV_ITEM tuple>|item||A tuple describing the new item. ! if (!ParseTV_ITEMTuple(obTVItem, &tvItem.item)) return NULL; GUI_BGN_SAVE; ret = pList->InsertItem(&tvItem); GUI_END_SAVE; goto done; } --- 483,492 ---- PyWinObject_AsHANDLE, &tvItem.hInsertAfter, // @pyparm HTREEITEM|hInsertAfter||The item to insert after. Can be an item or TVI_FIRST, TVI_LAST or TVI_SORT &obTVItem)) { // @pyparm <om PyCTreeCtrl.TV_ITEM tuple>|item||A tuple describing the new item. ! if (!PyWinObject_AsTV_ITEM(obTVItem, &tvItem.item)) return NULL; GUI_BGN_SAVE; ret = pList->InsertItem(&tvItem); GUI_END_SAVE; + PyWinObject_FreeTV_ITEM(&tvItem.item); goto done; } *************** *** 513,521 **** return NULL; TV_ITEM tvItem; ! if (!ParseTV_ITEMTuple(obTVItem, &tvItem)) return NULL; GUI_BGN_SAVE; BOOL ok = pList->SetItem(&tvItem); GUI_END_SAVE; if (!ok) RETURN_ERR("SetItem failed"); --- 514,523 ---- return NULL; TV_ITEM tvItem; ! if (!PyWinObject_AsTV_ITEM(obTVItem, &tvItem)) return NULL; GUI_BGN_SAVE; BOOL ok = pList->SetItem(&tvItem); GUI_END_SAVE; + PyWinObject_FreeTV_ITEM(&tvItem); if (!ok) RETURN_ERR("SetItem failed"); *************** *** 569,573 **** if (!ok) RETURN_ERR("GetItem failed"); ! return MakeTV_ITEMTuple(&tvItem); } --- 571,575 ---- if (!ok) RETURN_ERR("GetItem failed"); ! return PyWinObject_FromTV_ITEM(&tvItem); } |
From: Roger U. <ru...@us...> - 2008-09-01 08:03:48
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6312 Modified Files: Tag: py3k view.py Log Message: Always set codepage to enable Unicode Remove import * Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.28.2.1 retrieving revision 1.28.2.2 diff -C2 -d -r1.28.2.1 -r1.28.2.2 *** view.py 29 Aug 2008 06:16:42 -0000 1.28.2.1 --- view.py 1 Sep 2008 08:03:57 -0000 1.28.2.2 *************** *** 3,7 **** from pywin.mfc import docview from pywin.mfc import dialog ! from .scintillacon import * import win32con import win32ui --- 3,8 ---- from pywin.mfc import docview from pywin.mfc import dialog ! from . import scintillacon ! import win32con import win32ui *************** *** 77,86 **** command_reflectors = [ (win32ui.ID_EDIT_UNDO, win32con.WM_UNDO), ! (win32ui.ID_EDIT_REDO, SCI_REDO), (win32ui.ID_EDIT_CUT, win32con.WM_CUT), (win32ui.ID_EDIT_COPY, win32con.WM_COPY), (win32ui.ID_EDIT_PASTE, win32con.WM_PASTE), (win32ui.ID_EDIT_CLEAR, win32con.WM_CLEAR), ! (win32ui.ID_EDIT_SELECT_ALL, SCI_SELECTALL), ] --- 78,87 ---- command_reflectors = [ (win32ui.ID_EDIT_UNDO, win32con.WM_UNDO), ! (win32ui.ID_EDIT_REDO, scintillacon.SCI_REDO), (win32ui.ID_EDIT_CUT, win32con.WM_CUT), (win32ui.ID_EDIT_COPY, win32con.WM_COPY), (win32ui.ID_EDIT_PASTE, win32con.WM_PASTE), (win32ui.ID_EDIT_CLEAR, win32con.WM_CLEAR), ! (win32ui.ID_EDIT_SELECT_ALL, scintillacon.SCI_SELECTALL), ] *************** *** 192,204 **** doc = self.GetDocument() ! # Enable Unicode if we can ! if is_platform_unicode: ! self.SendScintilla(SCI_SETCODEPAGE, SC_CP_UTF8, 0) # Create margins ! self.SendScintilla(SCI_SETMARGINTYPEN, 1, SC_MARGIN_SYMBOL); ! self.SendScintilla(SCI_SETMARGINMASKN, 1, 0xF); ! self.SendScintilla(SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL); ! self.SendScintilla(SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS); ! self.SendScintilla(SCI_SETMARGINSENSITIVEN, 2, 1); self.GetDocument().HookViewNotifications(self) # is there an MFC way to grab this? --- 193,204 ---- doc = self.GetDocument() ! # Enable Unicode ! self.SendScintilla(scintillacon.SCI_SETCODEPAGE, scintillacon.SC_CP_UTF8, 0) # Create margins ! self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 1, scintillacon.SC_MARGIN_SYMBOL); ! self.SendScintilla(scintillacon.SCI_SETMARGINMASKN, 1, 0xF); ! self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 2, scintillacon.SC_MARGIN_SYMBOL); ! self.SendScintilla(scintillacon.SCI_SETMARGINMASKN, 2, scintillacon.SC_MASK_FOLDERS); ! self.SendScintilla(scintillacon.SCI_SETMARGINSENSITIVEN, 2, 1); self.GetDocument().HookViewNotifications(self) # is there an MFC way to grab this? *************** *** 321,331 **** cmdui.Enable() def OnCmdViewRightEdge(self, cmd, code): # Handle the menu command ! if self.SCIGetEdgeMode() == EDGE_NONE: ! mode = EDGE_BACKGROUND else: ! mode = EDGE_NONE self.SCISetEdgeMode(mode) def OnUpdateViewRightEdge(self, cmdui): # Update the tick on the UI. ! cmdui.SetCheck(self.SCIGetEdgeMode() != EDGE_NONE) cmdui.Enable() def OnCmdViewEOL(self, cmd, code): # Handle the menu command --- 321,331 ---- cmdui.Enable() def OnCmdViewRightEdge(self, cmd, code): # Handle the menu command ! if self.SCIGetEdgeMode() == scintillacon.EDGE_NONE: ! mode = scintillacon.EDGE_BACKGROUND else: ! mode = scintillacon.EDGE_NONE self.SCISetEdgeMode(mode) def OnUpdateViewRightEdge(self, cmdui): # Update the tick on the UI. ! cmdui.SetCheck(self.SCIGetEdgeMode() != scintillacon.EDGE_NONE) cmdui.Enable() def OnCmdViewEOL(self, cmd, code): # Handle the menu command |
From: Roger U. <ru...@us...> - 2008-08-31 18:46:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10628 Modified Files: Tag: py3k makepy.py Log Message: Use isinstance to determine type of typelibInfo Index: makepy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/makepy.py,v retrieving revision 1.25.2.2 retrieving revision 1.25.2.3 diff -C2 -d -r1.25.2.2 -r1.25.2.3 *** makepy.py 31 Aug 2008 17:22:20 -0000 1.25.2.2 --- makepy.py 31 Aug 2008 18:46:46 -0000 1.25.2.3 *************** *** 67,71 **** """ ! import sys, os, types, pythoncom from win32com.client import genpy --- 67,71 ---- """ ! import sys, os, pythoncom from win32com.client import genpy *************** *** 220,224 **** if bForDemand and file is not None: raise RuntimeError("You can only perform a demand-build when the output goes to the gen_py directory") ! if type(typelibInfo)==type(()): # Tuple typelibCLSID, lcid, major, minor = typelibInfo --- 220,224 ---- if bForDemand and file is not None: raise RuntimeError("You can only perform a demand-build when the output goes to the gen_py directory") ! if isinstance(typelibInfo, tuple): # Tuple typelibCLSID, lcid, major, minor = typelibInfo *************** *** 227,231 **** spec.FromTypelib(tlb, str(typelibCLSID)) typelibs = [(tlb, spec)] ! elif type(typelibInfo)==types.InstanceType: if typelibInfo.dll is None: # Version numbers not always reliable if enumerated from registry. --- 227,231 ---- spec.FromTypelib(tlb, str(typelibCLSID)) typelibs = [(tlb, spec)] ! elif isinstance(typelibInfo, selecttlb.TypelibSpec): if typelibInfo.dll is None: # Version numbers not always reliable if enumerated from registry. *************** *** 236,239 **** --- 236,241 ---- elif hasattr(typelibInfo, "GetLibAttr"): # A real typelib object! + # Could also use isinstance(typelibInfo, PyITypeLib) instead, but PyITypeLib is not directly exposed by pythoncom. + # pythoncom.TypeIIDs[pythoncom.IID_ITypeLib] seems to work tla = typelibInfo.GetLibAttr() guid = tla[0] |
From: Roger U. <ru...@us...> - 2008-08-31 18:22:07
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1005 Modified Files: Tag: py3k selecttlb.py Log Message: Remove string moduel, use sort key Index: selecttlb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/selecttlb.py,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** selecttlb.py 29 Aug 2008 08:58:53 -0000 1.10.2.1 --- selecttlb.py 31 Aug 2008 18:22:15 -0000 1.10.2.2 *************** *** 2,6 **** """ ! import win32api, win32con, string, pythoncom class TypelibSpec: --- 2,6 ---- """ ! import win32api, win32con, pythoncom class TypelibSpec: *************** *** 24,30 **** raise IndexError("Cant index me!") def __cmp__(self, other): ! rc = cmp(string.lower(self.ver_desc or ""), string.lower(other.ver_desc or "")) if rc==0: ! rc = cmp(string.lower(self.desc), string.lower(other.desc)) if rc==0: rc = cmp(self.major, other.major) --- 24,30 ---- raise IndexError("Cant index me!") def __cmp__(self, other): ! rc = cmp((self.ver_desc or "").lower(), (other.ver_desc or "").lower()) if rc==0: ! rc = cmp(self.desc.lower(), other.desc.lower()) if rc==0: rc = cmp(self.major, other.major) *************** *** 85,89 **** continue for version, tlbdesc in EnumKeys(key2): ! major_minor = string.split(version, '.', 1) if len(major_minor) < 2: major_minor.append('0') --- 85,89 ---- continue for version, tlbdesc in EnumKeys(key2): ! major_minor = version.split('.', 1) if len(major_minor) < 2: major_minor.append('0') *************** *** 139,142 **** --- 139,145 ---- return ret + def tlb_sort_key(tlb_item): + return tlb_item.ver_desc + def SelectTlb(title="Select Library", excludeFlags = 0): """Display a list of all the type libraries, and select one. Returns None if cancelled *************** *** 148,152 **** i.major = int(i.major, 16) i.minor = int(i.minor, 16) ! items.sort() rc = pywin.dialogs.list.SelectFromLists(title, items, ["Type Library"]) if rc is None: --- 151,155 ---- i.major = int(i.major, 16) i.minor = int(i.minor, 16) ! items.sort(key=tlb_sort_key) rc = pywin.dialogs.list.SelectFromLists(title, items, ["Type Library"]) if rc is None: |
From: Roger U. <ru...@us...> - 2008-08-31 18:14:53
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30324/tools Modified Files: Tag: py3k browser.py Log Message: Use 0 instead of None for extended style in dialog tuples Index: browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browser.py,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** browser.py 29 Aug 2008 06:16:42 -0000 1.10.2.1 --- browser.py 31 Aug 2008 18:15:01 -0000 1.10.2.2 *************** *** 329,333 **** dt = [ ! ["Python Object Browser", (0, 0, 200, 200), style, None, (8, "MS Sans Serif")], ["SysTreeView32", None, win32ui.IDC_LIST1, (0, 0, 200, 200), cs] ] --- 329,333 ---- dt = [ ! ["Python Object Browser", (0, 0, 200, 200), style, 0, (8, "MS Sans Serif")], ["SysTreeView32", None, win32ui.IDC_LIST1, (0, 0, 200, 200), cs] ] |
From: Roger U. <ru...@us...> - 2008-08-31 18:14:53
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30324/dialogs Modified Files: Tag: py3k list.py Log Message: Use 0 instead of None for extended style in dialog tuples Index: list.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/dialogs/list.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 *** list.py 29 Aug 2008 06:16:41 -0000 1.1.4.1 --- list.py 31 Aug 2008 18:15:01 -0000 1.1.4.2 *************** *** 23,27 **** win32con.WS_VISIBLE ) ! return [ [title, (0, 0, 200, 200), style, None, (8, "MS Sans Serif")], ["SysListView32", None, win32ui.IDC_LIST1, (0, 0, 200, 200), ls], [128, "OK", win32con.IDOK, (10, 0, 50, 14), bs | win32con.BS_DEFPUSHBUTTON], --- 23,27 ---- win32con.WS_VISIBLE ) ! return [ [title, (0, 0, 200, 200), style, 0, (8, "MS Sans Serif")], ["SysListView32", None, win32ui.IDC_LIST1, (0, 0, 200, 200), ls], [128, "OK", win32con.IDOK, (10, 0, 50, 14), bs | win32con.BS_DEFPUSHBUTTON], |
From: Roger U. <ru...@us...> - 2008-08-31 17:22:10
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9239 Modified Files: Tag: py3k makepy.py Log Message: Incorporate changes to generate to a temp file Index: makepy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/makepy.py,v retrieving revision 1.25.2.1 retrieving revision 1.25.2.2 diff -C2 -d -r1.25.2.1 -r1.25.2.2 *** makepy.py 29 Aug 2008 08:58:53 -0000 1.25.2.1 --- makepy.py 31 Aug 2008 17:22:20 -0000 1.25.2.2 *************** *** 69,72 **** --- 69,73 ---- import sys, os, types, pythoncom from win32com.client import genpy + from . import selecttlb from . import gencache *************** *** 267,271 **** else: outputName = full_name + ".py" ! fileUse = open(outputName, "wt") progress.LogBeginGenerate(outputName) else: --- 268,279 ---- else: outputName = full_name + ".py" ! # generate to a temp file (so errors don't leave a 1/2 ! # generated file) and one which can handle unicode! ! try: ! os.unlink(outputName) ! except os.error: ! pass ! encoding = 'mbcs' # could make this a param. ! fileUse = open(outputName + ".temp", "wt", encoding=encoding) progress.LogBeginGenerate(outputName) else: *************** *** 278,282 **** if file is None: fileUse.close() ! if bToGenDir: progress.SetDescription("Importing module") --- 286,290 ---- if file is None: fileUse.close() ! os.rename(outputName + ".temp", outputName) if bToGenDir: progress.SetDescription("Importing module") |
From: Roger U. <ru...@us...> - 2008-08-31 09:47:59
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26353 Modified Files: Tag: py3k dynamic.py Log Message: Fix some new-style exception syntax Index: dynamic.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v retrieving revision 1.22.2.1 retrieving revision 1.22.2.2 diff -C2 -d -r1.22.2.1 -r1.22.2.2 *** dynamic.py 29 Aug 2008 08:58:53 -0000 1.22.2.1 --- dynamic.py 31 Aug 2008 09:48:03 -0000 1.22.2.2 *************** *** 481,485 **** ret = self._oleobj_.Invoke(retEntry.dispid,0,invoke_type,1) except pythoncom.com_error as details: ! if details[0] in ERRORS_BAD_CONTEXT: # May be a method. self._olerepr_.mapFuncs[attr] = retEntry --- 481,485 ---- ret = self._oleobj_.Invoke(retEntry.dispid,0,invoke_type,1) except pythoncom.com_error as details: ! if details.args[0] in ERRORS_BAD_CONTEXT: # May be a method. self._olerepr_.mapFuncs[attr] = retEntry |
From: Roger U. <ru...@us...> - 2008-08-31 09:33:08
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20634 Modified Files: Tag: py3k build.py genpy.py Log Message: Fix some problems with makepy generation Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.55.2.1 retrieving revision 1.55.2.2 diff -C2 -d -r1.55.2.1 -r1.55.2.2 *** genpy.py 29 Aug 2008 08:58:53 -0000 1.55.2.1 --- genpy.py 31 Aug 2008 09:33:17 -0000 1.55.2.2 *************** *** 205,215 **** if vdesc[4] == pythoncom.VAR_CONST: val = vdesc[1] ! if type(val) in (type(0), type(0)): ! if val==0x80000000: # special case ! use = "0x80000000L" # 'L' for future warning ! elif val > 0x80000000 or val < 0: # avoid a FutureWarning ! use = int(val) ! else: ! use = hex(val) else: use = repr(str(val)) --- 205,210 ---- if vdesc[4] == pythoncom.VAR_CONST: val = vdesc[1] ! if isinstance(val, int): ! use=val else: use = repr(str(val)) *************** *** 514,518 **** print('\tdef __getitem__(self, index):', file=stream) print('\t\t"Allow this class to be accessed as a collection"', file=stream) ! print("\t\tif not self.__dict__.has_key('_enum_'):", file=stream) print("\t\t\tself.__dict__['_enum_'] = self._NewEnum()", file=stream) print("\t\treturn self._enum_.__getitem__(index)", file=stream) --- 509,513 ---- print('\tdef __getitem__(self, index):', file=stream) print('\t\t"Allow this class to be accessed as a collection"', file=stream) ! print("\t\tif '_enum_' not in self.__dict__:", file=stream) print("\t\t\tself.__dict__['_enum_'] = self._NewEnum()", file=stream) print("\t\treturn self._enum_.__getitem__(index)", file=stream) Index: build.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/build.py,v retrieving revision 1.31.2.1 retrieving revision 1.31.2.2 diff -C2 -d -r1.31.2.1 -r1.31.2.2 *** build.py 29 Aug 2008 08:58:52 -0000 1.31.2.1 --- build.py 31 Aug 2008 09:33:17 -0000 1.31.2.2 *************** *** 19,23 **** import sys import string ! import types from keyword import iskeyword from win32com.client import NeedUnicodeConversions --- 19,24 ---- import sys import string ! import builtins ! from keyword import iskeyword from win32com.client import NeedUnicodeConversions *************** *** 455,460 **** resultTypeInfo = itypeinfo.GetRefTypeInfo(subrepr) except pythoncom.com_error as details: ! if details[0] in [winerror.TYPE_E_CANTLOADLIBRARY, ! winerror.TYPE_E_LIBNOTREGISTERED]: # an unregistered interface return pythoncom.VT_UNKNOWN, None, None --- 456,460 ---- resultTypeInfo = itypeinfo.GetRefTypeInfo(subrepr) except pythoncom.com_error as details: ! if details.args[0] in [winerror.TYPE_E_CANTLOADLIBRARY, winerror.TYPE_E_LIBNOTREGISTERED]: # an unregistered interface return pythoncom.VT_UNKNOWN, None, None *************** *** 533,537 **** # that if it was a global it would get picked up below className = 'NONE' ! elif is_global and className in __builtins__: # builtins may be mixed case. If capitalizing it doesn't change it, # force to all uppercase (eg, "None", "True" become "NONE", "TRUE" --- 533,537 ---- # that if it was a global it would get picked up below className = 'NONE' ! elif is_global and hasattr(builtins, className): # builtins may be mixed case. If capitalizing it doesn't change it, # force to all uppercase (eg, "None", "True" become "NONE", "TRUE" |