コード例 #1
0
ファイル: script.py プロジェクト: BackupTheBerlios/grafit-svn
    def __init__(self, parent, locals=project.main_dict, log=''):
        QextScintilla.__init__(self, parent, 'Console')
        self.interpreter = Interpreter(locals)
        self.locals = locals

        self.resize(500, 300)

        lex = QextScintillaLexerPython()
        lex.setDefaultFont(QApplication.font())
        lex.setFont(QApplication.font(), -1)
        self.setLexer(lex)

        #        self.SendScintilla(self.SCI_SETHSCROLLBAR, False)
        self.SendScintilla(self.SCI_SETSCROLLWIDTH, 100)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        sys.stdout = self
        sys.stdin = self

        self.last_lines = []

        self.more = False
        self.reading = False

        # history
        self.history = project.settings['/grafit/console/history']
        if self.history is None:
            self.history = []
        else:
            self.history = self.history.split('\n')
        self.pointer = 0

        sys.ps1 = '>>> '
        sys.ps2 = '... '

        self.clear()
        self.write('# Welcome to Grafit\n>>> ')

        self.completer = rlcompleter.Completer()
コード例 #2
0
ファイル: textview.py プロジェクト: pombredanne/paella-svn
 def __init__(self, parent, name='HighlightTextView'):
     QextScintilla.__init__(self, parent, name)
     self.pylex = QextScintillaLexerPython(self)
     self.lex = QextScintillaLexer(self)
コード例 #3
0
ファイル: trait.py プロジェクト: pombredanne/paella-svn
 def __init__(self, app, parent):
     QextScintilla.__init__(self, parent)
     self.app = app
     self.pylex = QextScintillaLexerPython(self)
     self.lex = QextScintillaLexer(self)