本文整理汇总了Python中CScite类的典型用法代码示例。如果您正苦于以下问题:Python CScite类的具体用法?Python CScite怎么用?Python CScite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CScite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __getattr__
def __getattr__(self, s):
if s.startswith("_"):
# if looking for a special method, don't try to do anything.
raise exceptions.AttributeError
elif s.upper() == s and "_" in s:
return CScite.app_GetConstant(s)
else:
return lambda: CScite.app_SciteCommand(s)
示例2: FindText
def FindText(self, s, n1=0, n2=-1, wholeWord=False, matchCase=False, regExp=False, nFlags=0):
if wholeWord:
nFlags |= CScite.ScApp.SCFIND_WHOLEWORD
if matchCase:
nFlags |= CScite.ScApp.SCFIND_MATCHCASE
if regExp:
nFlags |= CScite.ScApp.SCFIND_REGEXP
return CScite.pane_FindText(self.nPane, s, nFlags, n1, n2)
示例3: SetText
def SetText(self, s):
return CScite.pane_ScintillaFn(self.nPane, "SetText", (None, s))
示例4: CopyText
def CopyText(self, s):
return CScite.pane_ScintillaFn(self.nPane, "CopyText", (len(s), s))
示例5: SetProperty
def SetProperty(self, s, v): return CScite.app_SetProperty(s, v)
def UnsetProperty(self, s): return CScite.app_UnsetProperty(s)
示例6: Textrange
def Textrange(self, n1, n2):
return CScite.pane_Textrange(self.nPane, n1, n2)
示例7: InsertText
def InsertText(self, txt, pos):
return CScite.pane_Insert(self.nPane, pos, txt)
示例8: LoadLexerLibrary
def LoadLexerLibrary(self, s):
return CScite.pane_ScintillaFn(self.nPane, "LoadLexerLibrary", (None, s))
示例9: ReplaceSel
def ReplaceSel(self, s):
return CScite.pane_ScintillaFn(self.nPane, "ReplaceSel", (None, s))
示例10: OpenFile
def OpenFile(self, s):
return CScite.app_OpenFile(s)
示例11: MsgBox
def MsgBox(self, s):
return CScite.app_MsgBox(s)
示例12: Trace
def Trace(self, s):
return CScite.app_Trace(s)
示例13: Write
def Write(self, txt, pos=-1):
if pos == -1:
pos = self.GetCurrentPos()
CScite.pane_Insert(self.nPane, pos, txt)
self.GotoPos(pos + len(txt))
示例14: test_1_1
def test_1_1():
CurrentPane.ClearAll()
expectEqual(CurrentPane.GetAllText(), '')
CurrentPane.Write('ab'); CurrentPane.Write('bc')
expectEqual(CurrentPane.GetAllText(), 'abbc')
# append not affected by position
CurrentPane.ClearAll()
CurrentPane.Append('123'); CurrentPane.GotoPos(1); CurrentPane.Append('456')
expectEqual(CurrentPane.GetAllText(), '123456')
# Write -is- affected by position
CurrentPane.ClearAll()
CurrentPane.Write('ABC'); CurrentPane.GotoPos(1); CurrentPane.Write('DEF')
expectEqual(CurrentPane.GetAllText(), 'ADEFBC')
CurrentPane.ClearAll()
CurrentPane.Write('aaaa'); CurrentPane.InsertText('bb',2); CurrentPane.InsertText('cc',3)
expectEqual(CurrentPane.GetAllText(), 'aabccbaa')
CurrentPane.ClearAll()
CurrentPane.Write('123456789'); CurrentPane.Remove(1,1); CurrentPane.Remove(3,5)
expectEqual(CurrentPane.GetAllText(), '134789')
CurrentPane.ClearAll()
CurrentPane.Write('123456789');
expectEqual(CurrentPane.Textrange(1,1), ''); expectEqual(CurrentPane.Textrange(1,2), '2')
expectEqual(CurrentPane.Textrange(1,3), '23'); expectEqual(CurrentPane.Textrange(2,5), '345')
CurrentPane.ClearAll()
CurrentPane.Write('a teststringnotwhole teststring testStringnotwhole testString end');
expectEqual( CurrentPane.FindText('testString',wholeWord=True, matchCase=True), (51,61))
expectEqual( CurrentPane.FindText('testString',matchCase=True), (32,42))
expectEqual( CurrentPane.FindText('testString',wholeWord=True), (21,31))
expectEqual( CurrentPane.FindText('testString'), (2,12))
expectThrow( (lambda:CScite.pane_ScintillaFn(3, 'a', ('b','C'))), 'Invalid pane')
expectThrow( (lambda:CurrentPane.NotAValid()), 'Could not find fn.')
expectThrow( (lambda:CurrentPane.SetNotAValid('f')), 'Could not find prop.')
expectThrow( (lambda:CurrentPane.GetNotAValid()), 'Could not find prop.')
# scintilla fns
expectThrow( (lambda:CurrentPane.ClearAll(1)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.SetWhitespaceBack(1,1,1)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.AppendText('a','b','c','d')), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.AppendText('a','a')), 'int expected')
expectThrow( (lambda:CurrentPane.AppendText(False,False)), 'string expected')
expectThrow( (lambda:CurrentPane.MarkerAdd(1,1,1)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.CanRedo(None)), 'Wrong # of args')
expectThrow( (lambda:CurrentPane.CanRedo(0)), 'Wrong # of args')
# scintilla get/set
expectThrow( (lambda:CurrentPane.SetLineCount(4)), 'prop can\'t be set')
expectThrow( (lambda:CurrentPane.GetWhitespaceChars()), 'prop can\'t be get')
expectThrow( (lambda:CurrentPane.GetLineCount('a')), 'property does not take params')
expectThrow( (lambda:CurrentPane.GetLineCount(1)), 'property does not take params')
expectThrow( (lambda:CurrentPane.GetCharAt()), 'prop needs param')
expectThrow( (lambda:CurrentPane.GetCharAt('a')), 'Int expected')
expectThrow( (lambda:CurrentPane.SetStyleBold('a')), 'prop needs param')
expectThrow( (lambda:CurrentPane.SetStyleBold(True)), 'prop needs param')
expectThrow( (lambda:CurrentPane.SetViewEOL(1)), 'Bool expected')
expectThrow( (lambda:CurrentPane.SetViewEOL(True, 45)), 'property does not take params')
示例15: UpdateStatusBar
def UpdateStatusBar(self, v=None): return CScite.app_UpdateStatusBar(v)
# CScite.app_SciteCommand(self.nPane, s, *args) (see __getattr__)
# CScite.app_GetConstant(self.nPane, s, *args) (see __getattr__)
def __getattr__(self, s):