Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17967/scintilla
Modified Files:
Tag: py3k
IDLEenvironment.py bindings.py config.py configui.py
control.py document.py find.py formatter.py keycodes.py
view.py
Log Message:
Changes for Python 3
Index: config.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/config.py,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** config.py 9 Aug 2008 16:47:07 -0000 1.6
--- config.py 29 Aug 2008 06:16:42 -0000 1.6.2.1
***************
*** 11,15 ****
import sys
import string
! import keycodes
import marshal
import stat
--- 11,15 ----
import sys
import string
! from . import keycodes
import marshal
import stat
***************
*** 37,41 ****
if sep_pos == -1:
if line.strip():
! print "Warning: Line %d: %s is an invalid entry" % (lineno, `line`)
return None, None
return "", ""
--- 37,41 ----
if sep_pos == -1:
if line.strip():
! print("Warning: Line %d: %s is an invalid entry" % (lineno, repr(line)))
return None, None
return "", ""
***************
*** 59,63 ****
def find_config_files():
! return map( lambda x: os.path.split(x)[1], map( lambda x: os.path.splitext(x)[0], glob.glob(os.path.join(pywin.__path__[0], "*.cfg"))))
class ConfigManager:
--- 59,63 ----
def find_config_files():
! return [os.path.split(x)[1] for x in [os.path.splitext(x)[0] for x in glob.glob(os.path.join(pywin.__path__[0], "*.cfg"))]]
class ConfigManager:
***************
*** 161,165 ****
ns = {}
try:
! exec codeob in ns
except:
traceback.print_exc()
--- 161,165 ----
ns = {}
try:
! exec(codeob, ns)
except:
traceback.print_exc()
***************
*** 168,172 ****
if ns:
num = 0
! for name, func in ns.items():
if type(func)==types.FunctionType and name[:1] != '_':
bindings.bind(name, func)
--- 168,172 ----
if ns:
num = 0
! for name, func in list(ns.items()):
if type(func)==types.FunctionType and name[:1] != '_':
bindings.bind(name, func)
***************
*** 201,205 ****
map = {}
keymap = subsection_keymap.get(subsection, {})
! for key_info, map_event in keymap.items():
map[map_event] = key_info
self.key_to_events[subsection] = map
--- 201,205 ----
map = {}
keymap = subsection_keymap.get(subsection, {})
! for key_info, map_event in list(keymap.items()):
map[map_event] = key_info
self.key_to_events[subsection] = map
***************
*** 212,218 ****
def report_error(self, msg):
self.last_error = msg
! print "Error in %s: %s" % (self.filename, msg)
def report_warning(self, msg):
! print "Warning in %s: %s" % (self.filename, msg)
def _readline(self, fp, lineno, bStripComments = 1):
--- 212,218 ----
def report_error(self, msg):
self.last_error = msg
! print("Error in %s: %s" % (self.filename, msg))
def report_warning(self, msg):
! print("Warning in %s: %s" % (self.filename, msg))
def _readline(self, fp, lineno, bStripComments = 1):
***************
*** 280,284 ****
c = compile("".join(lines), self.filename, "exec")
self._save_data("extension code", c)
! except SyntaxError, details:
msg = details[0]
errlineno = details[1][1] + start_lineno
--- 280,284 ----
c = compile("".join(lines), self.filename, "exec")
self._save_data("extension code", c)
! except SyntaxError as details:
msg = details[0]
errlineno = details[1][1] + start_lineno
***************
*** 308,312 ****
map = cm.get_data("keys")
took = time.clock()-start
! print "Loaded %s items in %.4f secs" % (len(map), took)
if __name__=='__main__':
--- 308,312 ----
map = cm.get_data("keys")
took = time.clock()-start
! print("Loaded %s items in %.4f secs" % (len(map), took))
if __name__=='__main__':
Index: IDLEenvironment.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/IDLEenvironment.py,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** IDLEenvironment.py 9 Aug 2008 16:47:07 -0000 1.11
--- IDLEenvironment.py 29 Aug 2008 06:16:42 -0000 1.11.2.1
***************
*** 23,27 ****
modname = "pywin.idle." + module
__import__(modname)
! except ImportError, details:
msg = "The IDLE extension '%s' can not be located.\r\n\r\n" \
"Please correct the installation and restart the" \
--- 23,27 ----
modname = "pywin.idle." + module
__import__(modname)
! except ImportError as details:
msg = "The IDLE extension '%s' can not be located.\r\n\r\n" \
"Please correct the installation and restart the" \
***************
*** 42,46 ****
if self.finished:
return ""
! if not self.__dict__.has_key("_scint_lines"):
# XXX - note - assumes this is only called once the file is loaded!
self._scint_lines = self.text.edit.GetTextRange().split("\n")
--- 42,46 ----
if self.finished:
return ""
! if "_scint_lines" not in self.__dict__:
# XXX - note - assumes this is only called once the file is loaded!
self._scint_lines = self.text.edit.GetTextRange().split("\n")
***************
*** 69,73 ****
self.extension_menus = None
try:
! for ext in self.extensions.values():
closer = getattr(ext, "close", None)
if closer is not None:
--- 69,73 ----
self.extension_menus = None
try:
! for ext in list(self.extensions.values()):
closer = getattr(ext, "close", None)
if closer is not None:
***************
*** 84,88 ****
ext = self.extensions[extension] = klass(self)
# Find and bind all the events defined in the extension.
! events = filter(lambda item: item[-6:]=="_event", dir(klass))
for event in events:
name = "<<%s>>" % (event[:-6].replace("_", "-"), )
--- 84,88 ----
ext = self.extensions[extension] = klass(self)
# Find and bind all the events defined in the extension.
! events = [item for item in dir(klass) if item[-6:]=="_event"]
for event in events:
name = "<<%s>>" % (event[:-6].replace("_", "-"), )
***************
*** 94,102 ****
bindings = self.edit.bindings
ret = []
! for ext in self.extensions.values():
menudefs = getattr(ext, "menudefs", [])
for name, items in menudefs:
if name == menu_name:
! for text, event in filter(lambda item: item is not None, items):
text = text.replace("&", "&&")
text = text.replace("_", "&")
--- 94,102 ----
bindings = self.edit.bindings
ret = []
! for ext in list(self.extensions.values()):
menudefs = getattr(ext, "menudefs", [])
for name, items in menudefs:
if name == menu_name:
! for text, event in [item for item in items if item is not None]:
text = text.replace("&", "&&")
text = text.replace("_", "&")
***************
*** 202,206 ****
def TkIndexToOffset(bm, edit, marks):
base, nextTokPos = _NextTok(bm, 0)
! if base is None: raise ValueError, "Empty bookmark ID!"
if base.find(".")>0:
try:
--- 202,206 ----
def TkIndexToOffset(bm, edit, marks):
base, nextTokPos = _NextTok(bm, 0)
! if base is None: raise ValueError("Empty bookmark ID!")
if base.find(".")>0:
try:
***************
*** 208,212 ****
if col=="first" or col=="last":
# Tag name
! if line != "sel": raise ValueError, "Tags arent here!"
sel = edit.GetSel()
if sel[0]==sel[1]:
--- 208,212 ----
if col=="first" or col=="last":
# Tag name
! if line != "sel": raise ValueError("Tags arent here!")
sel = edit.GetSel()
if sel[0]==sel[1]:
***************
*** 226,230 ****
pos = pos + int(col)
except (ValueError, IndexError):
! raise ValueError, "Unexpected literal in '%s'" % base
elif base == 'insert':
pos = edit.GetSel()[0]
--- 226,230 ----
pos = pos + int(col)
except (ValueError, IndexError):
! raise ValueError("Unexpected literal in '%s'" % base)
elif base == 'insert':
pos = edit.GetSel()[0]
***************
*** 238,242 ****
pos = marks[base]
except KeyError:
! raise ValueError, "Unsupported base offset or undefined mark '%s'" % base
while 1:
--- 238,242 ----
pos = marks[base]
except KeyError:
! raise ValueError("Unsupported base offset or undefined mark '%s'" % base)
while 1:
***************
*** 245,252 ****
if word in ['+','-']:
num, nextTokPos = _NextTok(bm, nextTokPos)
! if num is None: raise ValueError, "+/- operator needs 2 args"
what, nextTokPos = _NextTok(bm, nextTokPos)
! if what is None: raise ValueError, "+/- operator needs 2 args"
! if what[0] <> "c": raise ValueError, "+/- only supports chars"
if word=='+':
pos = pos + int(num)
--- 245,252 ----
if word in ['+','-']:
num, nextTokPos = _NextTok(bm, nextTokPos)
! if num is None: raise ValueError("+/- operator needs 2 args")
what, nextTokPos = _NextTok(bm, nextTokPos)
! if what is None: raise ValueError("+/- operator needs 2 args")
! if what[0] != "c": raise ValueError("+/- only supports chars")
if word=='+':
pos = pos + int(num)
***************
*** 268,272 ****
pos = pos + 1
else:
! raise ValueError, "Unsupported relative offset '%s'" % word
return max(pos, 0) # Tkinter is tollerant of -ve indexes - we aren't
--- 268,272 ----
pos = pos + 1
else:
! raise ValueError("Unsupported relative offset '%s'" % word)
return max(pos, 0) # Tkinter is tollerant of -ve indexes - we aren't
***************
*** 349,354 ****
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError, "Empty range"
self.edit.SetSel((pos, pos))
# IDLE only deals with "\n" - we will be nicer
bits = text.split('\n')
--- 349,356 ----
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError("Empty range")
self.edit.SetSel((pos, pos))
+ self.edit.SCIAddText(text)
+ """
# IDLE only deals with "\n" - we will be nicer
bits = text.split('\n')
***************
*** 357,360 ****
--- 359,363 ----
self.edit.SCINewline()
self.edit.SCIAddText(bit)
+ """
def delete(self, start, end=None):
***************
*** 363,367 ****
if end is not None: end = self._getoffset(end)
except EmptyRange:
! raise TextError, "Empty range"
# If end is specified and == start, then we must delete nothing.
if start==end: return
--- 366,370 ----
if end is not None: end = self._getoffset(end)
except EmptyRange:
! raise TextError("Empty range")
# If end is specified and == start, then we must delete nothing.
if start==end: return
***************
*** 396,400 ****
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError, "Empty range '%s'" % pos
if name == "insert":
self.edit.SetSel( pos )
--- 399,403 ----
pos = self._getoffset(pos)
except EmptyRange:
! raise TextError("Empty range '%s'" % pos)
if name == "insert":
self.edit.SetSel( pos )
***************
*** 403,417 ****
def tag_add(self, name, start, end):
! if name != "sel": raise ValueError, "Only sel tag is supported"
try:
start = self._getoffset(start)
end = self._getoffset(end)
except EmptyRange:
! raise TextError, "Empty range"
self.edit.SetSel( start, end )
def tag_remove(self, name, start, end):
if name !="sel" or start != "1.0" or end != "end":
! raise ValueError, "Cant remove this tag"
# Turn the sel into a cursor
self.edit.SetSel(self.edit.GetSel()[0])
--- 406,420 ----
def tag_add(self, name, start, end):
! if name != "sel": raise ValueError("Only sel tag is supported")
try:
start = self._getoffset(start)
end = self._getoffset(end)
except EmptyRange:
! raise TextError("Empty range")
self.edit.SetSel( start, end )
def tag_remove(self, name, start, end):
if name !="sel" or start != "1.0" or end != "end":
! raise ValueError("Cant remove this tag")
# Turn the sel into a cursor
self.edit.SetSel(self.edit.GetSel()[0])
***************
*** 442,451 ****
rc = TkIndexToOffset(index, edit, {})
if rc != expected:
! print "ERROR: Index", index,", expected", expected, "but got", rc
def TestGet(fr, to, t, expected):
got = t.get(fr, to)
if got != expected:
! print "ERROR: get(%s, %s) expected %s, but got %s" % (`fr`, `to`, `expected`, `got`)
def test():
--- 445,454 ----
rc = TkIndexToOffset(index, edit, {})
if rc != expected:
! print("ERROR: Index", index,", expected", expected, "but got", rc)
def TestGet(fr, to, t, expected):
got = t.get(fr, to)
if got != expected:
! print("ERROR: get(%s, %s) expected %s, but got %s" % (repr(fr), repr(to), repr(expected), repr(got)))
def test():
Index: keycodes.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/keycodes.py,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** keycodes.py 9 Aug 2008 16:47:07 -0000 1.5
--- keycodes.py 29 Aug 2008 06:16:42 -0000 1.5.2.1
***************
*** 31,35 ****
def _fillmap():
# Pull the VK_names from win32con
! names = filter(lambda entry: entry[:3]=="VK_", win32con.__dict__.keys())
for name in names:
n = name[3:].lower()
--- 31,35 ----
def _fillmap():
# Pull the VK_names from win32con
! names = [entry for entry in list(win32con.__dict__.keys()) if entry[:3]=="VK_"]
for name in names:
n = name[3:].lower()
***************
*** 126,130 ****
def _psc(char):
sc = get_scan_code(char)
! print "Char %s -> %d -> %s" % (`char`, sc, key_code_to_name.get(sc))
def test1():
--- 126,130 ----
def _psc(char):
sc = get_scan_code(char)
! print("Char %s -> %d -> %s" % (repr(char), sc, key_code_to_name.get(sc)))
def test1():
***************
*** 136,140 ****
def _pkn(n):
scancode, flags = parse_key_name(n)
! print "%s -> %s,%s -> %s" % (n, scancode, flags, make_key_name(scancode, flags))
def test2():
--- 136,140 ----
def _pkn(n):
scancode, flags = parse_key_name(n)
! print("%s -> %s,%s -> %s" % (n, scancode, flags, make_key_name(scancode, flags)))
def test2():
Index: document.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -C2 -d -r1.6 -r1.6.4.1
*** document.py 29 Oct 2000 23:44:42 -0000 1.6
--- document.py 29 Aug 2008 06:16:42 -0000 1.6.4.1
***************
*** 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 .scintillacon import *
import win32con
import string
***************
*** 23,31 ****
f = codecs.open(filename, 'rb', default_platform_encoding)
else:
! f = open(filename, 'rb')
try:
text = f.read()
finally:
f.close()
if is_platform_unicode:
# Translate from locale-specific (MCBS) encoding to UTF-8 for Scintilla
--- 23,32 ----
f = codecs.open(filename, 'rb', default_platform_encoding)
else:
! f = open(filename, 'r')
try:
text = f.read()
finally:
f.close()
+ text = text.encode('utf-8')
if is_platform_unicode:
# Translate from locale-specific (MCBS) encoding to UTF-8 for Scintilla
***************
*** 64,68 ****
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)
--- 65,69 ----
doc = self
view.SendScintilla(SCI_CLEARALL)
! view.SendMessage(SCI_ADDTEXT, text)
view.SendScintilla(SCI_SETUNDOCOLLECTION, 1, 0)
view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0)
***************
*** 126,135 ****
for view in self.GetAllViews():
func = getattr(view, funcName)
! apply(func, args)
def _ApplyOptionalToViews(self, funcName, *args):
for view in self.GetAllViews():
func = getattr(view, funcName, None)
if func is not None:
! apply(func, args)
def GetEditorView(self):
# Find the first frame with a view,
--- 127,136 ----
for view in self.GetAllViews():
func = getattr(view, funcName)
! func(*args)
def _ApplyOptionalToViews(self, funcName, *args):
for view in self.GetAllViews():
func = getattr(view, funcName, None)
if func is not None:
! func(*args)
def GetEditorView(self):
# Find the first frame with a view,
***************
*** 151,155 ****
for v in self.doc.GetAllViews():
if v.GetSafeHwnd() == hwndFrom:
! return apply(getattr(v, self.name), (std, extra))
# Delegate to the document, but only from a single view (as each view sends it seperately)
--- 152,156 ----
for v in self.doc.GetAllViews():
if v.GetSafeHwnd() == hwndFrom:
! return getattr(v, self.name)(*(std, extra))
# Delegate to the document, but only from a single view (as each view sends it seperately)
***************
*** 161,163 ****
(hwndFrom, idFrom, code) = std
if hwndFrom == self.doc.GetEditorView().GetSafeHwnd():
! apply(self.delegate, (std, extra))
--- 162,164 ----
(hwndFrom, idFrom, code) = std
if hwndFrom == self.doc.GetEditorView().GetSafeHwnd():
! self.delegate(*(std, extra))
Index: control.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** control.py 9 Aug 2008 16:47:07 -0000 1.17
--- control.py 29 Aug 2008 06:16:42 -0000 1.17.2.1
***************
*** 6,9 ****
--- 6,10 ----
from pywin.mfc import window
+ from pywin import default_scintilla_encoding
import win32con
import win32ui
***************
*** 13,17 ****
import string
import os
! from scintillacon import *
# Load Scintilla.dll to get access to the control.
--- 14,18 ----
import string
import os
! from .scintillacon import *
# Load Scintilla.dll to get access to the control.
***************
*** 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(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.
***************
*** 64,74 ****
# assumed to apply to the entire string.
if style is not None:
! 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)
--- 65,76 ----
# assumed to apply to the entire string.
if style is not None:
! 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)
***************
*** 107,113 ****
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):
--- 109,115 ----
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):
***************
*** 180,186 ****
if type(text) in [type([]), type(())]:
text = ' '.join(text)
! 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)
--- 182,187 ----
if type(text) in [type([]), type(())]:
text = ' '.join(text)
! buff = (text + "\0").encode(default_scintilla_encoding)
! return self.SendScintilla(SCI_AUTOCSHOW, 0, buff)
def SCIAutoCCancel(self):
self.SendScintilla(SCI_AUTOCCANCEL)
***************
*** 190,196 ****
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)
--- 191,196 ----
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)
***************
*** 200,211 ****
def SCICallTipShow(self, text, pos=-1):
if pos==-1: pos = self.GetSel()[0]
! if isinstance(text, unicode):
# I'm really not sure what the correct encoding
# to use is - but it has gotta be better than total
# failure due to the array module
text = text.encode("mbcs")
! buff = array.array('c', text + "\0")
! addressBuffer = buff.buffer_info()[0]
! self.SendScintilla(SCI_CALLTIPSHOW, pos, addressBuffer)
def SCICallTipCancel(self):
self.SendScintilla(SCI_CALLTIPCANCEL)
--- 200,213 ----
def SCICallTipShow(self, text, pos=-1):
if pos==-1: pos = self.GetSel()[0]
! """
! if isinstance(text, str):
# I'm really not sure what the correct encoding
# to use is - but it has gotta be better than total
# failure due to the array module
text = text.encode("mbcs")
! """
! 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)
***************
*** 218,227 ****
# 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")
! val_buff = array.array("c", str(value) + "\0")
address_name_buffer = name_buff.buffer_info()[0]
address_val_buffer = val_buff.buffer_info()[0]
--- 220,228 ----
# 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'))
! 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]
***************
*** 279,289 ****
"""
findtextex_fmt='llPll'
! buff = array.array('c', findText + "\0")
! addressBuffer = buff.buffer_info()[0]
! ft = struct.pack(findtextex_fmt, range[0], range[1], addressBuffer, 0, 0)
! ftBuff = array.array('c', ft)
! addressFtBuff = ftBuff.buffer_info()[0]
! rc = self.SendScintilla(EM_FINDTEXTEX, flags, addressFtBuff)
! ftUnpacked = struct.unpack(findtextex_fmt, ftBuff.tostring())
return rc, (ftUnpacked[3], ftUnpacked[4])
--- 280,290 ----
"""
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)
! ft_array = array.array('b', ft_buff)
! rc = self.SendScintilla(EM_FINDTEXTEX, flags, ft_array.buffer_info()[0])
! ftUnpacked = struct.unpack(findtextex_fmt, ft_array)
return rc, (ftUnpacked[3], ftUnpacked[4])
***************
*** 299,306 ****
def GetSelText(self):
start, end = self.GetSel()
! txtBuf = array.array('c', " " * ((end-start)+1))
addressTxtBuf = txtBuf.buffer_info()[0]
self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf)
! return txtBuf.tostring()[:-1]
def SetSel(self, start=0, end=None):
--- 300,307 ----
def GetSelText(self):
start, end = self.GetSel()
! txtBuf = array.array('u', " " * ((end-start)+1))
addressTxtBuf = txtBuf.buffer_info()[0]
self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf)
! return txtBuf.tostring().decode(default_scintilla_encoding)
def SetSel(self, start=0, end=None):
***************
*** 315,319 ****
assert end <= self.GetTextLength(), "The end postion is invalid (%d/%d)" % (end, self.GetTextLength())
cr = struct.pack('ll', start, end)
! crBuff = array.array('c', cr)
addressCrBuff = crBuff.buffer_info()[0]
rc = self.SendScintilla(EM_EXSETSEL, 0, addressCrBuff)
--- 316,320 ----
assert end <= self.GetTextLength(), "The end postion is invalid (%d/%d)" % (end, self.GetTextLength())
cr = struct.pack('ll', start, end)
! crBuff = array.array('b', cr)
addressCrBuff = crBuff.buffer_info()[0]
rc = self.SendScintilla(EM_EXSETSEL, 0, addressCrBuff)
***************
*** 347,362 ****
assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid"
initer = "=" * (end - start + 1)
! buff = array.array('c', initer)
addressBuffer = buff.buffer_info()[0]
tr = struct.pack('llP', start, end, addressBuffer)
! trBuff = array.array('c', tr)
addressTrBuff = trBuff.buffer_info()[0]
numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff)
! return buff.tostring()[:numChars]
!
def ReplaceSel(self, str):
! buff = array.array('c', str + "\0")
! self.SendScintilla(SCI_REPLACESEL, 0, buff.buffer_info()[0]);
! buff = None
def GetLine(self, line=-1):
--- 348,363 ----
assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid"
initer = "=" * (end - start + 1)
! buff = array.array('u', initer)
addressBuffer = buff.buffer_info()[0]
tr = struct.pack('llP', start, end, addressBuffer)
! trBuff = array.array('b', tr)
addressTrBuff = trBuff.buffer_info()[0]
numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff)
! ## return buff.tounicode()[:numChars]
! return buff.tostring()[:numChars].decode(default_scintilla_encoding)
!
def ReplaceSel(self, str):
! buff = (str + "\0").encode(default_scintilla_encoding)
! self.SendScintilla(SCI_REPLACESEL, 0, buff)
def GetLine(self, line=-1):
***************
*** 376,381 ****
def SetWordWrap(self, mode):
! if mode <> win32ui.CRichEditView_WrapNone:
! raise ValueError, "We dont support word-wrap (I dont think :-)"
class CScintillaColorEditInterface(CScintillaEditInterface):
--- 377,382 ----
def SetWordWrap(self, mode):
! if mode != win32ui.CRichEditView_WrapNone:
! raise ValueError("We dont support word-wrap (I dont think :-)")
class CScintillaColorEditInterface(CScintillaEditInterface):
***************
*** 391,395 ****
if parent_func is not None:
return parent_func()
! import formatter
## return formatter.PythonSourceFormatter(self)
return formatter.BuiltinPythonSourceFormatter(self)
--- 392,396 ----
if parent_func is not None:
return parent_func()
! from . import formatter
## return formatter.PythonSourceFormatter(self)
return formatter.BuiltinPythonSourceFormatter(self)
Index: find.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/find.py,v
retrieving revision 1.10
retrieving revision 1.10.4.1
diff -C2 -d -r1.10 -r1.10.4.1
*** find.py 16 Jun 2005 08:59:11 -0000 1.10
--- find.py 29 Aug 2008 06:16:42 -0000 1.10.4.1
***************
*** 27,31 ****
def __setattr__(self, attr, val):
if not hasattr(self, attr):
! raise AttributeError, attr
self.__dict__[attr]=val
--- 27,31 ----
def __setattr__(self, attr, val):
if not hasattr(self, attr):
! raise AttributeError(attr)
self.__dict__[attr]=val
***************
*** 104,108 ****
doc = control.GetParent().GetDocument()
except AttributeError:
! print "Cant find a document for the control!"
doc = None
if doc is not None:
--- 104,108 ----
doc = control.GetParent().GetDocument()
except AttributeError:
! print("Cant find a document for the control!")
doc = None
if doc is not None:
***************
*** 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],
Index: configui.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/configui.py,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** configui.py 9 Aug 2008 16:47:07 -0000 1.5
--- configui.py 29 Aug 2008 06:16:42 -0000 1.5.2.1
***************
*** 5,9 ****
import copy
import string
! from scintillacon import *
######################################################
--- 5,9 ----
import copy
import string
! from .scintillacon import *
######################################################
***************
*** 32,36 ****
try:
if self.scintillaClass is None:
! import control
sc = control.CScintillaEdit
else:
--- 32,36 ----
try:
if self.scintillaClass is None:
! from . import control
sc = control.CScintillaEdit
else:
***************
*** 68,72 ****
self.listbox = self.GetDlgItem(win32ui.IDC_LIST1)
self.HookCommand(self.OnListCommand, win32ui.IDC_LIST1)
! names = self.styles.keys()
names.sort()
for name in names:
--- 68,72 ----
self.listbox = self.GetDlgItem(win32ui.IDC_LIST1)
self.HookCommand(self.OnListCommand, win32ui.IDC_LIST1)
! names = list(self.styles.keys())
names.sort()
for name in names:
Index: view.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -C2 -d -r1.28 -r1.28.2.1
*** view.py 9 Aug 2008 16:47:08 -0000 1.28
--- view.py 29 Aug 2008 06:16:42 -0000 1.28.2.1
***************
*** 1,9 ****
! # A general purpose MFC CCtrlView view that uses Scintilla.
!
! import control
! import IDLEenvironment # IDLE emulation.
from pywin.mfc import docview
from pywin.mfc import dialog
! from scintillacon import *
import win32con
import win32ui
--- 1,7 ----
! from . import control
! from . import IDLEenvironment # IDLE emulation.
from pywin.mfc import docview
from pywin.mfc import dialog
! from .scintillacon import *
import win32con
import win32ui
***************
*** 14,19 ****
import types
import __main__ # for attribute lookup
! import bindings
! import keycodes
import struct
import re
--- 12,17 ----
import types
import __main__ # for attribute lookup
! from . import bindings
! from . import keycodes
import struct
import re
***************
*** 139,143 ****
def _MakeColorizer(self):
ext = os.path.splitext(self.GetDocument().GetPathName())[1]
! import formatter
return formatter.BuiltinPythonSourceFormatter(self, ext)
--- 137,141 ----
def _MakeColorizer(self):
ext = os.path.splitext(self.GetDocument().GetPathName())[1]
! from . import formatter
return formatter.BuiltinPythonSourceFormatter(self, ext)
***************
*** 284,288 ****
if cmdid is None:
# No event of that name - no point displaying it.
! print 'View.AppendMenu(): Unknown event "%s" specified for menu text "%s" - ignored' % (event, text)
return
keyname = configManager.get_key_binding( event, self._GetSubConfigNames() )
--- 282,286 ----
if cmdid is None:
# No event of that name - no point displaying it.
! print('View.AppendMenu(): Unknown event "%s" specified for menu text "%s" - ignored' % (event, text))
return
keyname = configManager.get_key_binding( event, self._GetSubConfigNames() )
***************
*** 350,360 ****
def OnCmdEditFind(self, cmd, code):
! import find
find.ShowFindDialog()
def OnCmdEditRepeat(self, cmd, code):
! import find
find.FindNext()
def OnCmdEditReplace(self, cmd, code):
! import find
find.ShowReplaceDialog()
--- 348,358 ----
def OnCmdEditFind(self, cmd, code):
! from . import find
find.ShowFindDialog()
def OnCmdEditRepeat(self, cmd, code):
! from . import find
find.FindNext()
def OnCmdEditReplace(self, cmd, code):
! from . import find
find.ShowReplaceDialog()
***************
*** 379,383 ****
def OnCmdGotoLine(self, cmd, id):
try:
! lineNo = int(raw_input("Enter Line Number"))-1
except (ValueError, KeyboardInterrupt):
return 0
--- 377,381 ----
def OnCmdGotoLine(self, cmd, id):
try:
! lineNo = int(input("Enter Line Number"))-1
except (ValueError, KeyboardInterrupt):
return 0
***************
*** 390,395 ****
s = self.GetTextRange()
if is_platform_unicode:
! s = unicode(s,"utf-8").encode("mbcs")
! f = open(filename, 'wb')
f.write(s)
f.close()
--- 388,393 ----
s = self.GetTextRange()
if is_platform_unicode:
! s = str(s,"utf-8").encode("mbcs")
! f = open(filename, 'w')
f.write(s)
f.close()
***************
*** 433,453 ****
if hasattr(ob, "_oleobj_"):
try:
! for iTI in xrange(0,ob._oleobj_.GetTypeInfoCount()):
typeInfo = ob._oleobj_.GetTypeInfo(iTI)
typeAttr = typeInfo.GetTypeAttr()
! for iFun in xrange(0,typeAttr.cFuncs):
funDesc = typeInfo.GetFuncDesc(iFun)
funName = typeInfo.GetNames(funDesc.memid)[0]
! if not items_dict.has_key(funName):
items_dict[funName] = None
except:
pass
except:
! win32ui.SetStatusText("Error attempting to get object attributes - %s" % (`sys.exc_info()[0]`,))
! # ensure all keys are strings.
! items = map(str, items_dict.keys())
# All names that start with "_" go!
! items = filter(lambda word: word[0]!='_', items)
if not items:
--- 431,451 ----
if hasattr(ob, "_oleobj_"):
try:
! for iTI in range(0,ob._oleobj_.GetTypeInfoCount()):
typeInfo = ob._oleobj_.GetTypeInfo(iTI)
typeAttr = typeInfo.GetTypeAttr()
! for iFun in range(0,typeAttr.cFuncs):
funDesc = typeInfo.GetFuncDesc(iFun)
funName = typeInfo.GetNames(funDesc.memid)[0]
! if funName not in items_dict:
items_dict[funName] = None
except:
pass
except:
! win32ui.SetStatusText("Error attempting to get object attributes - %s" % (repr(sys.exc_info()[0]),))
! # ensure all keys are strings.
! items = [str(k) for k in items_dict.keys()]
# All names that start with "_" go!
! items = [k for k in items if not k.startswith('_')]
if not items:
***************
*** 466,477 ****
text = self.GetTextRange(self.LineIndex(minline),endpos)
try:
! list = re.findall(r"\b"+left+"\.\w+",text)
except re.error:
# parens etc may make an invalid RE, but this code wouldnt
# benefit even if the RE did work :-)
! list = []
prefix = len(left)+1
unique = {}
! for li in list:
unique[li[prefix:]] = 1
# Assuming traditional usage of self...
--- 464,475 ----
text = self.GetTextRange(self.LineIndex(minline),endpos)
try:
! l = re.findall(r"\b"+left+"\.\w+",text)
except re.error:
# parens etc may make an invalid RE, but this code wouldnt
# benefit even if the RE did work :-)
! l = []
prefix = len(left)+1
unique = {}
! for li in l:
unique[li[prefix:]] = 1
# Assuming traditional usage of self...
***************
*** 479,483 ****
self._UpdateWithClassMethods(unique,curclass)
! items = filter(lambda word: word[:2]!='__' or word[-2:]!='__', unique.keys())
# Ignore the word currently to the right of the dot - probably a red-herring.
try:
--- 477,481 ----
self._UpdateWithClassMethods(unique,curclass)
! items = [word for word in unique.keys() if word[:2]!='__' or word[-2:]!='__']
# Ignore the word currently to the right of the dot - probably a red-herring.
try:
***************
*** 530,534 ****
curclass = None
# Find out which class we are in
! for item in clbrdata.values():
if item.module==curmodule:
item_lineno = item.lineno - 1 # Scintilla counts lines from 0, whereas pyclbr - from 1
--- 528,532 ----
curclass = None
# Find out which class we are in
! for item in list(clbrdata.values()):
if item.module==curmodule:
item_lineno = item.lineno - 1 # Scintilla counts lines from 0, whereas pyclbr - from 1
***************
*** 653,659 ****
hdcFormat = dc.GetHandleAttrib()
fr = struct.pack(fmt, hdcRender, hdcFormat, rc[0], rc[1], rc[2], rc[3], rc[0], rc[1], rc[2], rc[3], pageStart, lengthDoc)
! frBuff = array.array('c', fr)
! addressFrBuff = frBuff.buffer_info()[0]
! nextPageStart = self.SendScintilla(EM_FORMATRANGE, draw, addressFrBuff)
return nextPageStart
--- 651,657 ----
hdcFormat = dc.GetHandleAttrib()
fr = struct.pack(fmt, hdcRender, hdcFormat, rc[0], rc[1], rc[2], rc[3], rc[0], rc[1], rc[2], rc[3], pageStart, lengthDoc)
! ## frBuff = array......array('b', fr)
! ## addressFrBuff = frBuff.buffer_info()[0]
! nextPageStart = self.SendScintilla(EM_FORMATRANGE, draw, fr)
return nextPageStart
***************
*** 684,688 ****
global configManager
# Bit of a hack I dont kow what to do about?
! from config import ConfigManager
configName = rc = win32ui.GetProfileVal("Editor", "Keyboard Config", "default")
configManager = ConfigManager(configName)
--- 682,686 ----
global configManager
# Bit of a hack I dont kow what to do about?
! from .config import ConfigManager
configName = rc = win32ui.GetProfileVal("Editor", "Keyboard Config", "default")
configManager = ConfigManager(configName)
Index: bindings.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/bindings.py,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** bindings.py 9 Aug 2008 16:47:07 -0000 1.5
--- bindings.py 29 Aug 2008 06:16:42 -0000 1.5.2.1
***************
*** 1,9 ****
! import IDLEenvironment
import string
import win32ui
import win32api
import win32con
! import keycodes
import sys
HANDLER_ARGS_GUESS=0
--- 1,10 ----
! from . import IDLEenvironment
import string
import win32ui
import win32api
import win32con
! from . import keycodes
import sys
+ import traceback
HANDLER_ARGS_GUESS=0
***************
*** 50,54 ****
def complete_configure(self):
! for id in command_to_events.keys():
self.parent_view.HookCommand(self._OnCommand, id)
--- 51,55 ----
def complete_configure(self):
! for id in list(command_to_events.keys()):
self.parent_view.HookCommand(self._OnCommand, id)
***************
*** 61,65 ****
except win32ui.error:
# No status bar!
! print problem
def update_keymap(self, keymap):
--- 62,66 ----
except win32ui.error:
# No status bar!
! print(problem)
def update_keymap(self, keymap):
***************
*** 81,85 ****
if id is None:
# See if we even have an event of that name!?
! if not self.bindings.has_key(event):
return None
id = self.bind_command(event)
--- 82,86 ----
if id is None:
# See if we even have an event of that name!?
! if event not in self.bindings:
return None
id = self.bind_command(event)
***************
*** 139,143 ****
else:
args = (event_param,)
! rc = apply(binding.handler, args)
if handler_args_type==HANDLER_ARGS_IDLE:
# Convert to our return code.
--- 140,144 ----
else:
args = (event_param,)
! rc = binding.handler(*args)
if handler_args_type==HANDLER_ARGS_IDLE:
# Convert to our return code.
***************
*** 147,154 ****
rc = 1
except:
! import traceback
message = "Firing event '%s' failed." % event
! print message
! traceback.print_exc()
self.report_error(message)
rc = 1 # Let any default handlers have a go!
--- 148,155 ----
rc = 1
except:
! traceback.print_exc(chain=False)
message = "Firing event '%s' failed." % event
! print(message)
!
self.report_error(message)
rc = 1 # Let any default handlers have a go!
Index: formatter.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/formatter.py,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -C2 -d -r1.14 -r1.14.2.1
*** formatter.py 9 Aug 2008 16:47:07 -0000 1.14
--- formatter.py 29 Aug 2008 06:16:42 -0000 1.14.2.1
***************
*** 6,10 ****
import string
import array
! import scintillacon
WM_KICKIDLE = 0x036A
--- 6,10 ----
import string
import array
! from . import scintillacon
WM_KICKIDLE = 0x036A
***************
*** 101,105 ****
assert stylenum is not None, "We must have a style number"
assert style.stylenum is None, "Style has already been registered"
! assert not self.styles.has_key(stylenum), "We are reusing a style number!"
style.stylenum = stylenum
self.styles[style.name] = style
--- 101,105 ----
assert stylenum is not None, "We must have a style number"
assert style.stylenum is None, "Style has already been registered"
! assert stylenum not in self.styles, "We are reusing a style number!"
style.stylenum = stylenum
self.styles[style.name] = style
***************
*** 153,157 ****
defaultStyle.stylenum = scintillacon.STYLE_DEFAULT
self._ReformatStyle(defaultStyle)
! for style in self.styles.values():
if style.aliased is None:
style.NormalizeAgainstDefault(baseFormat)
--- 153,157 ----
defaultStyle.stylenum = scintillacon.STYLE_DEFAULT
self._ReformatStyle(defaultStyle)
! for style in list(self.styles.values()):
if style.aliased is None:
style.NormalizeAgainstDefault(baseFormat)
***************
*** 166,170 ****
self.bUseFixed = int(self.LoadPreference("Use Fixed", 1))
! for style in self.styles.values():
new = self.LoadPreference(style.name, str(style.format))
try:
--- 166,170 ----
self.bUseFixed = int(self.LoadPreference("Use Fixed", 1))
! for style in list(self.styles.values()):
new = self.LoadPreference(style.name, str(style.format))
try:
***************
*** 177,181 ****
except:
! print "Error loading style data for", style.name
def LoadPreference(self, name, default):
--- 177,181 ----
except:
! print("Error loading style data for", style.name)
def LoadPreference(self, name, default):
***************
*** 186,190 ****
self.SavePreference("Base Format Proportional", str(self.baseFormatProp))
self.SavePreference("Use Fixed", self.bUseFixed)
! for style in self.styles.values():
if style.aliased is None:
self.SavePreference(style.name, str(style.format))
--- 186,190 ----
self.SavePreference("Base Format Proportional", str(self.baseFormatProp))
self.SavePreference("Use Fixed", self.bUseFixed)
! for style in list(self.styles.values()):
if style.aliased is None:
self.SavePreference(style.name, str(style.format))
***************
*** 225,229 ****
stylenum = self.styles[styleName].stylenum
while start<end:
! self.style_buffer[start]=chr(stylenum)
start = start+1
#self.scintilla.SCISetStyling(end - start + 1, stylenum)
--- 225,229 ----
stylenum = self.styles[styleName].stylenum
while start<end:
! self.style_buffer[start]=stylenum
start = start+1
#self.scintilla.SCISetStyling(end - start + 1, stylenum)
***************
*** 236,240 ****
def ColorizeString(self, str, charStart, styleStart):
! raise RuntimeError, "You must override this method"
def Colorize(self, start=0, end=-1):
--- 236,240 ----
def ColorizeString(self, str, charStart, styleStart):
! raise RuntimeError("You must override this method")
def Colorize(self, start=0, end=-1):
***************
*** 248,252 ****
# trace("Coloring", start, end, end-start, len(stringVal), styleStart, self.scintilla.SCIGetCharAt(start))
scintilla.SCIStartStyling(start, 31)
! self.style_buffer = array.array("c", chr(0)*len(stringVal))
self.ColorizeString(stringVal, styleStart)
scintilla.SCISetStylingEx(self.style_buffer)
--- 248,252 ----
# trace("Coloring", start, end, end-start, len(stringVal), styleStart, self.scintilla.SCIGetCharAt(start))
scintilla.SCIStartStyling(start, 31)
! self.style_buffer = array.array("b", (0,)*len(stringVal))
self.ColorizeString(stringVal, styleStart)
scintilla.SCISetStylingEx(self.style_buffer)
|