From arigo at codespeak.net Mon May 14 19:24:04 2007 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 14 May 2007 19:24:04 +0200 (CEST) Subject: [pyrepl-checkins] r43378 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20070514172404.34549807A@code0.codespeak.net> Author: arigo Date: Mon May 14 19:24:03 2007 New Revision: 43378 Modified: pyrepl/trunk/pyrepl/pyrepl/commands.py Log: As discussed on #pypy: the up key should move into the previous history item when pressed on the first line of the input buffer, and symmetrically for the down key. This should give a feeling of the up/down key going through all the *lines* entered so far. (An experimental check-in, feel free to revert.) Modified: pyrepl/trunk/pyrepl/pyrepl/commands.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/commands.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/commands.py Mon May 14 19:24:03 2007 @@ -203,6 +203,9 @@ for i in range(r.get_arg()): bol1 = r.bol() if bol1 == 0: + if r.historyi > 0: + r.select_item(r.historyi - 1) + return r.pos = 0 r.error("start of buffer") return @@ -222,6 +225,10 @@ bol1 = r.bol() eol1 = r.eol() if eol1 == len(b): + if r.historyi < len(r.history): + r.select_item(r.historyi + 1) + r.pos = r.eol(0) + return r.pos = len(b) r.error("end of buffer") return From fijal at codespeak.net Tue May 15 20:12:28 2007 From: fijal at codespeak.net (fijal at codespeak.net) Date: Tue, 15 May 2007 20:12:28 +0200 (CEST) Subject: [pyrepl-checkins] r43419 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20070515181228.EC194808E@code0.codespeak.net> Author: fijal Date: Tue May 15 20:12:27 2007 New Revision: 43419 Modified: pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py Log: This is obvious typo, not sure how much it works Modified: pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py Tue May 15 20:12:27 2007 @@ -46,7 +46,7 @@ CR_init = CR.__init__ def __init__(self, completions): - self.CR_init() + self.CR_init(self) self.completions = completions def get_completions(self, stem): From fijal at codespeak.net Tue May 15 20:13:45 2007 From: fijal at codespeak.net (fijal at codespeak.net) Date: Tue, 15 May 2007 20:13:45 +0200 (CEST) Subject: [pyrepl-checkins] r43420 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20070515181345.924BE808E@code0.codespeak.net> Author: fijal Date: Tue May 15 20:13:45 2007 New Revision: 43420 Modified: pyrepl/trunk/pyrepl/pyrepl/python_reader.py Log: Try harder to determine whether we've got twisted or not Modified: pyrepl/trunk/pyrepl/pyrepl/python_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/python_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/python_reader.py Tue May 15 20:13:45 2007 @@ -32,6 +32,8 @@ try: import imp imp.find_module("twisted") + from twisted.internet import reactor + from twisted.internet.abstract import FileDescriptor except ImportError: default_interactmethod = "interact" else: