コード例 #1
0
ファイル: historical_reader.py プロジェクト: Agochka/pyrepl
def test():
    from pyrepl.unix_console import UnixConsole
    reader = HistoricalReader(UnixConsole())
    reader.ps1 = "h**> "
    reader.ps2 = "h/*> "
    reader.ps3 = "h|*> "
    reader.ps4 = "h\*> "
    while reader.readline():
        pass
コード例 #2
0
def test():
    from pyrepl.unix_console import UnixConsole
    reader = HistoricalReader(UnixConsole())
    reader.ps1 = "h**> "
    reader.ps2 = "h/*> "
    reader.ps3 = "h|*> "
    reader.ps4 = "h\*> "
    while reader.readline():
        pass
コード例 #3
0
def test():
    class TestReader(CompletingReader):
        def get_completions(self, stem):
            return [s for l in map(lambda x:x.split(),self.history)
                    for s in l if s and s.startswith(stem)]
    reader = TestReader()
    reader.ps1 = "c**> "
    reader.ps2 = "c/*> "
    reader.ps3 = "c|*> "
    reader.ps4 = "c\*> "
    while reader.readline():
        pass
コード例 #4
0
def test():
    class TestReader(CompletingReader):
        def get_completions(self, stem):
            return [s for l in map(lambda x:x.split(),self.history)
                    for s in l if s and s.startswith(stem)]
    reader = TestReader()
    reader.ps1 = "c**> "
    reader.ps2 = "c/*> "
    reader.ps3 = "c|*> "
    reader.ps4 = "c\*> "
    while reader.readline():
        pass