From antocuni at codespeak.net Sun Nov 7 10:53:54 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Sun, 7 Nov 2010 10:53:54 +0100 (CET) Subject: [pyrepl-checkins] r78803 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101107095354.30C03282B9D@codespeak.net> Author: antocuni Date: Sun Nov 7 10:53:51 2010 New Revision: 78803 Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py pyrepl/trunk/pyrepl/pyrepl/unix_console.py Log: take care of escape sequences when computing the lenght of menu entries, because in that case the length of the string might be different than the number of characters actually displayed. This lets pyrepl to display colored completions Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/completing_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/completing_reader.py Sun Nov 7 10:53:51 2010 @@ -42,16 +42,41 @@ except IndexError: return wordlist[0][j:i] -def build_menu(cons, wordlist, start): - maxlen = min(max(map(len, wordlist)), cons.width - 4) - cols = cons.width / (maxlen + 4) +import re +def stripcolor(s): + return stripcolor.regexp.sub('', s) +stripcolor.regexp = re.compile(r"\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[m|K]") + +def real_len(s): + return len(stripcolor(s)) + +def left_align(s, maxlen): + stripped = stripcolor(s) + if len(stripped) > maxlen: + # too bad, we remove the color + return stripped[:maxlen] + padding = maxlen - len(stripped) + return s + ' '*padding + +USE_BRACKETS = True +def build_menu(cons, wordlist, start, use_brackets=None): + if use_brackets is None: + use_brackets = USE_BRACKETS + if use_brackets: + item = "[ %s ]" + padding = 4 + else: + item = "%s " + padding = 2 + maxlen = min(max(map(real_len, wordlist)), cons.width - padding) + cols = cons.width / (maxlen + padding) rows = (len(wordlist) - 1)/cols + 1 menu = [] i = start for r in range(rows): row = [] for col in range(cols): - row.append("[ %-*s ]"%(maxlen, wordlist[i][:maxlen])) + row.append(item % left_align(wordlist[i], maxlen)) i += 1 if i >= len(wordlist): break Modified: pyrepl/trunk/pyrepl/pyrepl/unix_console.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/unix_console.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/unix_console.py Sun Nov 7 10:53:51 2010 @@ -251,7 +251,11 @@ # avoid writing code generators these days...) x = 0 minlen = min(len(oldline), len(newline)) - while x < minlen and oldline[x] == newline[x]: + # + # reuse the oldline as much as possible, but stop as soon as we + # encounter an ESCAPE, because it might be the start of an escape + # sequene + while x < minlen and oldline[x] == newline[x] and newline[x] != '\x1b': x += 1 if oldline[x:] == newline[x+1:] and self.ich1: if ( y == self.__posxy[1] and x > self.__posxy[0] From antocuni at codespeak.net Fri Nov 12 22:56:26 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Fri, 12 Nov 2010 22:56:26 +0100 (CET) Subject: [pyrepl-checkins] r79048 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101112215626.C0992282B90@codespeak.net> Author: antocuni Date: Fri Nov 12 22:56:23 2010 New Revision: 79048 Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py Log: always set the dirty flag when we press enter: this makes pyrepl to hide (if it's visible) the completion menu before going to the next line Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Fri Nov 12 22:56:23 2010 @@ -136,6 +136,8 @@ class maybe_accept(commands.Command): def do(self): r = self.reader + r.dirty = 1 # this is needed to hide the completion menu, if visible + # # if there are already several lines and the cursor # is not on the last one, always insert a new \n. text = r.get_unicode() From antocuni at codespeak.net Fri Nov 12 23:29:43 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Fri, 12 Nov 2010 23:29:43 +0100 (CET) Subject: [pyrepl-checkins] r79049 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101112222943.65106282B90@codespeak.net> Author: antocuni Date: Fri Nov 12 23:29:41 2010 New Revision: 79049 Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py pyrepl/trunk/pyrepl/pyrepl/readline.py Log: try to match more closely the behaviour of readline in case there is an unique completion followed by a (this semantic is e.g. exploited by fancycompleter to automatically complete unique prefixes) Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/completing_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/completing_reader.py Fri Nov 12 23:29:41 2010 @@ -99,12 +99,19 @@ # the considerations are: # (1) how many completions are possible # (2) whether the last command was a completion +# (3) if we can assume that the completer is going to return the same set of +# completions: this is controlled by the ``assume_immutable_completions`` +# variable on the reader, which is True by default to match the historical +# behaviour of pyrepl, but e.g. False in the ReadlineAlikeReader to match +# more closely readline's semantics (this is needed e.g. by +# fancycompleter) # # if there's no possible completion, beep at the user and point this out. # this is easy. # # if there's only one possible completion, stick it in. if the last thing -# user did was a completion, point out that he isn't getting anywhere. +# user did was a completion, point out that he isn't getting anywhere, but +# only if the ``assume_immutable_completions`` is True. # # now it gets complicated. # @@ -133,7 +140,8 @@ def do(self): r = self.reader stem = r.get_stem() - if r.last_command_is(self.__class__): + if r.assume_immutable_completions and \ + r.last_command_is(self.__class__): completions = r.cmpltn_menu_choices else: r.cmpltn_menu_choices = completions = \ @@ -141,7 +149,8 @@ if len(completions) == 0: r.error("no matches") elif len(completions) == 1: - if len(completions[0]) == len(stem) and \ + if r.assume_immutable_completions and \ + len(completions[0]) == len(stem) and \ r.last_command_is(self.__class__): r.msg = "[ sole completion ]" r.dirty = 1 @@ -187,7 +196,9 @@ * cmpltn_menu, cmpltn_menu_vis, cmpltn_menu_end, cmpltn_choices: * """ - + # see the comment for the complete command + assume_immutable_completions = True + def collect_keymap(self): return super(CompletingReader, self).collect_keymap() + ( (r'\t', 'complete'),) Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Fri Nov 12 23:29:41 2010 @@ -47,6 +47,8 @@ class ReadlineAlikeReader(HistoricalReader, CompletingReader): + assume_immutable_completions = False + def error(self, msg="none"): pass # don't show error messages by default From antocuni at codespeak.net Fri Nov 12 23:32:50 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Fri, 12 Nov 2010 23:32:50 +0100 (CET) Subject: [pyrepl-checkins] r79050 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101112223250.01819282B90@codespeak.net> Author: antocuni Date: Fri Nov 12 23:32:49 2010 New Revision: 79050 Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py pyrepl/trunk/pyrepl/pyrepl/readline.py Log: try to match the behaviour of readline even more: ReadlineALikeReader does not show completions inside brackets, while pyrepl still does Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/completing_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/completing_reader.py Fri Nov 12 23:32:49 2010 @@ -58,10 +58,7 @@ padding = maxlen - len(stripped) return s + ' '*padding -USE_BRACKETS = True -def build_menu(cons, wordlist, start, use_brackets=None): - if use_brackets is None: - use_brackets = USE_BRACKETS +def build_menu(cons, wordlist, start, use_brackets): if use_brackets: item = "[ %s ]" padding = 4 @@ -163,7 +160,8 @@ if not r.cmpltn_menu_vis: r.cmpltn_menu_vis = 1 r.cmpltn_menu, r.cmpltn_menu_end = build_menu( - r.console, completions, r.cmpltn_menu_end) + r.console, completions, r.cmpltn_menu_end, + r.use_brackets) r.dirty = 1 elif stem + p in completions: r.msg = "[ complete but not unique ]" @@ -185,7 +183,7 @@ if w.startswith(stem)] if completions: r.cmpltn_menu, r.cmpltn_menu_end = build_menu( - r.console, completions, 0) + r.console, completions, 0, r.use_brackets) else: r.cmpltn_reset() @@ -198,6 +196,7 @@ """ # see the comment for the complete command assume_immutable_completions = True + use_brackets = True # display completions inside [] def collect_keymap(self): return super(CompletingReader, self).collect_keymap() + ( Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Fri Nov 12 23:32:49 2010 @@ -48,6 +48,7 @@ class ReadlineAlikeReader(HistoricalReader, CompletingReader): assume_immutable_completions = False + use_brackets = False def error(self, msg="none"): pass # don't show error messages by default From antocuni at codespeak.net Sat Nov 13 01:05:08 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Sat, 13 Nov 2010 01:05:08 +0100 (CET) Subject: [pyrepl-checkins] r79051 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101113000508.B3EB1282B90@codespeak.net> Author: antocuni Date: Sat Nov 13 01:05:07 2010 New Revision: 79051 Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py pyrepl/trunk/pyrepl/pyrepl/readline.py Log: emulate readline even more, and sort completions "by column" instead of "by row" Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/completing_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/completing_reader.py Sat Nov 13 01:05:07 2010 @@ -58,7 +58,7 @@ padding = maxlen - len(stripped) return s + ' '*padding -def build_menu(cons, wordlist, start, use_brackets): +def build_menu(cons, wordlist, start, use_brackets, sort_in_column): if use_brackets: item = "[ %s ]" padding = 4 @@ -68,6 +68,19 @@ maxlen = min(max(map(real_len, wordlist)), cons.width - padding) cols = cons.width / (maxlen + padding) rows = (len(wordlist) - 1)/cols + 1 + + if sort_in_column: + # sort_in_column=False (default) sort_in_column=True + # A B C A D G + # D E F B E + # G C F + # + # "fill" the table with empty words, so we always have the same amout + # of rows for each column + missing = cols*rows - len(wordlist) + wordlist = wordlist + ['']*missing + indexes = [(i%cols)*rows + i//cols for i in range(len(wordlist))] + wordlist = [wordlist[i] for i in indexes] menu = [] i = start for r in range(rows): @@ -161,7 +174,7 @@ r.cmpltn_menu_vis = 1 r.cmpltn_menu, r.cmpltn_menu_end = build_menu( r.console, completions, r.cmpltn_menu_end, - r.use_brackets) + r.use_brackets, r.sort_in_column) r.dirty = 1 elif stem + p in completions: r.msg = "[ complete but not unique ]" @@ -183,7 +196,8 @@ if w.startswith(stem)] if completions: r.cmpltn_menu, r.cmpltn_menu_end = build_menu( - r.console, completions, 0, r.use_brackets) + r.console, completions, 0, + r.use_brackets, r.sort_in_column) else: r.cmpltn_reset() @@ -197,6 +211,7 @@ # see the comment for the complete command assume_immutable_completions = True use_brackets = True # display completions inside [] + sort_in_column = False def collect_keymap(self): return super(CompletingReader, self).collect_keymap() + ( Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Sat Nov 13 01:05:07 2010 @@ -49,6 +49,7 @@ assume_immutable_completions = False use_brackets = False + sort_in_column = True def error(self, msg="none"): pass # don't show error messages by default @@ -80,11 +81,7 @@ result.append(next) state += 1 # emulate the behavior of the standard readline that sorts - # the completions before displaying them. Note that the - # screen order is still a bit different because pyrepl - # displays them in this order: and readline in this one: - # [A][B][C] A C E - # [D][E][F] B D F + # the completions before displaying them. result.sort() return result From antocuni at codespeak.net Mon Nov 15 09:02:44 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Mon, 15 Nov 2010 09:02:44 +0100 (CET) Subject: [pyrepl-checkins] r79083 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101115080244.DCD665080F@codespeak.net> Author: antocuni Date: Mon Nov 15 09:02:42 2010 New Revision: 79083 Modified: pyrepl/trunk/pyrepl/pyrepl/reader.py Log: display tab characters as 4 spaces, not as ^I Modified: pyrepl/trunk/pyrepl/pyrepl/reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/reader.py Mon Nov 15 09:02:42 2010 @@ -29,6 +29,7 @@ for i in range(32): c = unichr(i) uc_map[c] = u'^' + unichr(ord('A') + i - 1) + uc_map['\t'] = ' ' # display TABs as 4 characters uc_map['\177'] = u'^?' for i in range(256): c = unichr(i) From antocuni at codespeak.net Tue Nov 16 10:50:56 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Tue, 16 Nov 2010 10:50:56 +0100 (CET) Subject: [pyrepl-checkins] r79140 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101116095056.0F658282B90@codespeak.net> Author: antocuni Date: Tue Nov 16 10:50:55 2010 New Revision: 79140 Modified: pyrepl/trunk/pyrepl/pyrepl/commands.py Log: (antocuni, arigo) we need to reset all the flags on the input file descriptor, else the console will be in "cooked mode" after we resume the job, and things could be messed up (try uncomment the call do prepare() and press CTRL-D or arrow keys immediately after the resuming and see what happens :-)) Modified: pyrepl/trunk/pyrepl/pyrepl/commands.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/commands.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/commands.py Tue Nov 16 10:50:55 2010 @@ -191,6 +191,7 @@ os.kill(os.getpid(), signal.SIGSTOP) ## this should probably be done ## in a handler for SIGCONT? + r.console.prepare() r.pos = p r.posxy = 0, 0 r.dirty = 1 From antocuni at codespeak.net Tue Nov 16 13:10:14 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Tue, 16 Nov 2010 13:10:14 +0100 (CET) Subject: [pyrepl-checkins] r79143 - pyrepl/trunk/pyrepl Message-ID: <20101116121014.1FCD2282B90@codespeak.net> Author: antocuni Date: Tue Nov 16 13:10:12 2010 New Revision: 79143 Modified: pyrepl/trunk/pyrepl/setup.py Log: use setuptools instead of distutils Modified: pyrepl/trunk/pyrepl/setup.py ============================================================================== --- pyrepl/trunk/pyrepl/setup.py (original) +++ pyrepl/trunk/pyrepl/setup.py Tue Nov 16 13:10:12 2010 @@ -17,7 +17,7 @@ # CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -from distutils.core import setup, Extension +from setuptools import setup, Extension long_desc = """\ pyrepl is a Python library, inspired by readline, for building flexible From agaynor at codespeak.net Tue Nov 16 21:37:45 2010 From: agaynor at codespeak.net (agaynor at codespeak.net) Date: Tue, 16 Nov 2010 21:37:45 +0100 (CET) Subject: [pyrepl-checkins] r79166 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101116203745.B2A10282B90@codespeak.net> Author: agaynor Date: Tue Nov 16 21:37:43 2010 New Revision: 79166 Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py Log: Added readline.get_line_buffer Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Tue Nov 16 21:37:43 2010 @@ -282,6 +282,9 @@ def set_startup_hook(self, function=None): self.startup_hook = function + def get_line_buffer(self): + return self.get_reader().get_buffer() + _wrapper = _ReadlineWrapper() # ____________________________________________________________ @@ -303,6 +306,7 @@ replace_history_item = _wrapper.replace_history_item add_history = _wrapper.add_history set_startup_hook = _wrapper.set_startup_hook +get_line_buffer = _wrapper.get_line_buffer # Extension multiline_input = _wrapper.multiline_input @@ -321,7 +325,6 @@ globals()[_name] = stub for _name, _ret in [ - ('get_line_buffer', ''), ('insert_text', None), ('read_init_file', None), ('redisplay', None), From agaynor at codespeak.net Wed Nov 17 00:24:47 2010 From: agaynor at codespeak.net (agaynor at codespeak.net) Date: Wed, 17 Nov 2010 00:24:47 +0100 (CET) Subject: [pyrepl-checkins] r79169 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101116232447.A9E6B282BDC@codespeak.net> Author: agaynor Date: Wed Nov 17 00:24:46 2010 New Revision: 79169 Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py Log: Added an of implementation of readline.get_{beg,end}idx. Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Wed Nov 17 00:24:46 2010 @@ -285,6 +285,22 @@ def get_line_buffer(self): return self.get_reader().get_buffer() + def _get_idxs(self): + start = cursor = self.get_reader().pos + buf = self.get_line_buffer() + for i in xrange(cursor - 1, -1, -1): + if buf[i] in self.get_completer_delims(): + break + start = i + return start, cursor + + def get_begidx(self): + return self._get_idxs()[0] + + def get_endidx(self): + return self._get_idxs()[1] + + _wrapper = _ReadlineWrapper() # ____________________________________________________________ @@ -307,6 +323,8 @@ add_history = _wrapper.add_history set_startup_hook = _wrapper.set_startup_hook get_line_buffer = _wrapper.get_line_buffer +get_begidx = _wrapper.get_begidx +get_endidx = _wrapper.get_endidx # Extension multiline_input = _wrapper.multiline_input @@ -329,8 +347,6 @@ ('read_init_file', None), ('redisplay', None), ('set_pre_input_hook', None), - ('get_begidx', 0), - ('get_endidx', 0), ]: assert _name not in globals(), _name _make_stub(_name, _ret) From agaynor at codespeak.net Thu Nov 18 18:36:19 2010 From: agaynor at codespeak.net (agaynor at codespeak.net) Date: Thu, 18 Nov 2010 18:36:19 +0100 (CET) Subject: [pyrepl-checkins] r79265 - pyrepl/trunk/pyrepl/pyrepl Message-ID: <20101118173619.1E02C282BEC@codespeak.net> Author: agaynor Date: Thu Nov 18 18:36:17 2010 New Revision: 79265 Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py Log: Implemented readline.insert_text. Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Thu Nov 18 18:36:17 2010 @@ -300,6 +300,9 @@ def get_endidx(self): return self._get_idxs()[1] + def insert_text(self, text): + return self.get_reader().insert(text) + _wrapper = _ReadlineWrapper() @@ -325,6 +328,7 @@ get_line_buffer = _wrapper.get_line_buffer get_begidx = _wrapper.get_begidx get_endidx = _wrapper.get_endidx +insert_text = _wrapper.insert_text # Extension multiline_input = _wrapper.multiline_input @@ -343,7 +347,6 @@ globals()[_name] = stub for _name, _ret in [ - ('insert_text', None), ('read_init_file', None), ('redisplay', None), ('set_pre_input_hook', None), From antocuni at codespeak.net Mon Nov 22 22:20:29 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Mon, 22 Nov 2010 22:20:29 +0100 (CET) Subject: [pyrepl-checkins] r79363 - pyrepl/trunk/pyrepl Message-ID: <20101122212029.980D6282BD6@codespeak.net> Author: antocuni Date: Mon Nov 22 22:20:28 2010 New Revision: 79363 Modified: pyrepl/trunk/pyrepl/README pyrepl/trunk/pyrepl/setup.py Log: update readme, bump version Modified: pyrepl/trunk/pyrepl/README ============================================================================== --- pyrepl/trunk/pyrepl/README (original) +++ pyrepl/trunk/pyrepl/README Mon Nov 22 22:20:28 2010 @@ -1,4 +1,4 @@ -This is pyrepl 0.8.1, a readline-a-like in Python. +This is pyrepl 0.8.2, a readline-a-like in Python. http://pyrepl.codespeak.net/ @@ -44,6 +44,20 @@ emails, so don't think I'll be irritated by the banality of your comments!) +Summary of 0.8.2: + + + This is the same version which is distributed with PyPy 1.4, which uses it + as its default interactive interpreter: + + - have the possibility of having a "CPython-like" prompt, with ">>>" as + PS1 and "..." as PS2 + + - add the pyrepl.readline module, which exposes a subset of CPython's + readline implemented on top of pyrepl + + + Add support for colored completions: see e.g. fancycomplete: + http://bitbucket.org/antocuni/fancycompleter + Summary of 0.8.1: + Fixes - in the area of unbound keys and unknown commands Modified: pyrepl/trunk/pyrepl/setup.py ============================================================================== --- pyrepl/trunk/pyrepl/setup.py (original) +++ pyrepl/trunk/pyrepl/setup.py Mon Nov 22 22:20:28 2010 @@ -32,7 +32,7 @@ setup( name = "pyrepl", - version = "0.8.1", + version = "0.8.2", author = "Michael Hudson", author_email = "mwh at python.net", url = "http://codespeak.net/pyrepl/", From antocuni at codespeak.net Mon Nov 22 22:23:59 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Mon, 22 Nov 2010 22:23:59 +0100 (CET) Subject: [pyrepl-checkins] r79364 - pyrepl/tag/pyrepl082 Message-ID: <20101122212359.99512282BD6@codespeak.net> Author: antocuni Date: Mon Nov 22 22:23:58 2010 New Revision: 79364 Added: pyrepl/tag/pyrepl082/ - copied from r79363, pyrepl/trunk/pyrepl/ Log: create a tag for pyrepl 0.8.2 From mwh at codespeak.net Mon Nov 22 23:54:00 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:00 +0100 (CET) Subject: [pyrepl-checkins] r79369 - pyrepl/trunk/pyrepl Message-ID: <20101122225400.D597E282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:53:58 2010 New Revision: 79369 Modified: pyrepl/trunk/pyrepl/encopyright.py pyrepl/trunk/pyrepl/setup.py Log: change my name and email address Modified: pyrepl/trunk/pyrepl/encopyright.py ============================================================================== --- pyrepl/trunk/pyrepl/encopyright.py (original) +++ pyrepl/trunk/pyrepl/encopyright.py Mon Nov 22 23:53:58 2010 @@ -22,7 +22,7 @@ import os, time, sys header = """\ -# Copyright 2000-%s Michael Hudson mwh at python.net +# Copyright 2000-%s Michael Hudson-Doyle micahel at gmail.com # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/setup.py ============================================================================== --- pyrepl/trunk/pyrepl/setup.py (original) +++ pyrepl/trunk/pyrepl/setup.py Mon Nov 22 23:53:58 2010 @@ -33,8 +33,8 @@ setup( name = "pyrepl", version = "0.8.2", - author = "Michael Hudson", - author_email = "mwh at python.net", + author = "Michael Hudson-Doyle", + author_email = "micahel at gmail.com", url = "http://codespeak.net/pyrepl/", license = "MIT X11 style", description = "A library for building flexible command line interfaces", From mwh at codespeak.net Mon Nov 22 23:54:09 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:09 +0100 (CET) Subject: [pyrepl-checkins] r79370 - pyrepl/trunk/pyrepl Message-ID: <20101122225409.D18E1282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:54:08 2010 New Revision: 79370 Modified: pyrepl/trunk/pyrepl/encopyright.py Log: hack on encopyright.py to go by modification date of file Modified: pyrepl/trunk/pyrepl/encopyright.py ============================================================================== --- pyrepl/trunk/pyrepl/encopyright.py (original) +++ pyrepl/trunk/pyrepl/encopyright.py Mon Nov 22 23:54:08 2010 @@ -20,9 +20,10 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import os, time, sys +import bzrlib.branch -header = """\ -# Copyright 2000-%s Michael Hudson-Doyle micahel at gmail.com +header_template = """\ +# Copyright 2000-%s Michael Hudson-Doyle # # All Rights Reserved # @@ -40,9 +41,14 @@ # RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF # CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\ -"""%(time.localtime()[0]) +""" + +branch, path = bzrlib.branch.Branch.open_containing(sys.argv[0]) +rev_tree = branch.basis_tree() +branch.lock_read() +print rev_tree +#sys.exit(0) -header_lines = header.split("\n") def process(thing): if os.path.isdir(thing): @@ -56,6 +62,10 @@ def process_file(file): ilines = open(file).readlines() + last_modified = rev_tree.get_file_mtime(rev_tree.path2id(file)) + modified_year = time.gmtime(last_modified)[0] + header = header_template % (modified_year, ) + header_lines = header.splitlines() prelines = [] old_copyright = [] @@ -64,7 +74,6 @@ return i = 0 - diff = 0 if ilines[0][:2] == '#!': prelines.append(ilines[0]) From mwh at codespeak.net Mon Nov 22 23:54:15 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:15 +0100 (CET) Subject: [pyrepl-checkins] r79371 - in pyrepl/trunk/pyrepl/pyrepl: . test tests Message-ID: <20101122225415.611BD282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:54:12 2010 New Revision: 79371 Modified: pyrepl/trunk/pyrepl/pyrepl/__init__.py pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py pyrepl/trunk/pyrepl/pyrepl/commands.py pyrepl/trunk/pyrepl/pyrepl/completer.py pyrepl/trunk/pyrepl/pyrepl/completing_reader.py pyrepl/trunk/pyrepl/pyrepl/console.py pyrepl/trunk/pyrepl/pyrepl/copy_code.py pyrepl/trunk/pyrepl/pyrepl/curses.py pyrepl/trunk/pyrepl/pyrepl/fancy_termios.py pyrepl/trunk/pyrepl/pyrepl/historical_reader.py pyrepl/trunk/pyrepl/pyrepl/input.py pyrepl/trunk/pyrepl/pyrepl/keymap.py pyrepl/trunk/pyrepl/pyrepl/keymaps.py pyrepl/trunk/pyrepl/pyrepl/module_lister.py pyrepl/trunk/pyrepl/pyrepl/pygame_console.py pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py pyrepl/trunk/pyrepl/pyrepl/python_reader.py pyrepl/trunk/pyrepl/pyrepl/reader.py pyrepl/trunk/pyrepl/pyrepl/readline.py pyrepl/trunk/pyrepl/pyrepl/simple_interact.py pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py pyrepl/trunk/pyrepl/pyrepl/tests/__init__.py pyrepl/trunk/pyrepl/pyrepl/tests/basic.py pyrepl/trunk/pyrepl/pyrepl/tests/bugs.py pyrepl/trunk/pyrepl/pyrepl/tests/infrastructure.py pyrepl/trunk/pyrepl/pyrepl/tests/wishes.py pyrepl/trunk/pyrepl/pyrepl/unix_console.py pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py Log: run encopyright.py Modified: pyrepl/trunk/pyrepl/pyrepl/__init__.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/__init__.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/__init__.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2008 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2007 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/commands.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/commands.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/commands.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2010 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/completer.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/completer.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/completer.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/completing_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/completing_reader.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2010 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/console.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/console.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/console.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/copy_code.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/copy_code.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/copy_code.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/curses.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/curses.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/curses.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,23 @@ +# Copyright 2000-2010 Michael Hudson-Doyle +# +# All Rights Reserved +# +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose is hereby granted without fee, +# provided that the above copyright notice appear in all copies and +# that both that copyright notice and this permission notice appear in +# supporting documentation. +# +# THE AUTHOR MICHAEL HUDSON DISCLAIMS ALL WARRANTIES WITH REGARD TO +# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, +# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + # Some try-import logic for two purposes: avoiding to bring in the whole # pure Python curses package if possible; and, in _curses is not actually # present, falling back to _minimal_curses (which is either a ctypes-based Modified: pyrepl/trunk/pyrepl/pyrepl/fancy_termios.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/fancy_termios.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/fancy_termios.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/historical_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/historical_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/historical_reader.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/input.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/input.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/input.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/keymap.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/keymap.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/keymap.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2008 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/keymaps.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/keymaps.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/keymaps.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/module_lister.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/module_lister.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/module_lister.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/pygame_console.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/pygame_console.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/pygame_console.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2008 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/python_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/python_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/python_reader.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2007 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/reader.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2010 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Mon Nov 22 23:54:12 2010 @@ -1,3 +1,22 @@ +# Copyright 2000-2010 Michael Hudson-Doyle +# +# All Rights Reserved +# +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose is hereby granted without fee, +# provided that the above copyright notice appear in all copies and +# that both that copyright notice and this permission notice appear in +# supporting documentation. +# +# THE AUTHOR MICHAEL HUDSON DISCLAIMS ALL WARRANTIES WITH REGARD TO +# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, +# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + """A compatibility wrapper reimplementing the 'readline' standard module on top of pyrepl. Not all functionalities are supported. Contains extensions for multiline input. Modified: pyrepl/trunk/pyrepl/pyrepl/simple_interact.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/simple_interact.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/simple_interact.py Mon Nov 22 23:54:12 2010 @@ -1,3 +1,22 @@ +# Copyright 2000-2010 Michael Hudson-Doyle +# +# All Rights Reserved +# +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose is hereby granted without fee, +# provided that the above copyright notice appear in all copies and +# that both that copyright notice and this permission notice appear in +# supporting documentation. +# +# THE AUTHOR MICHAEL HUDSON DISCLAIMS ALL WARRANTIES WITH REGARD TO +# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, +# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + """This is an alternative to python_reader which tries to emulate the CPython prompt as closely as possible, with the exception of allowing multiline input and multiline history entries. Modified: pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py Mon Nov 22 23:54:12 2010 @@ -1,3 +1,22 @@ +# Copyright 2000-2007 Michael Hudson-Doyle +# +# All Rights Reserved +# +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose is hereby granted without fee, +# provided that the above copyright notice appear in all copies and +# that both that copyright notice and this permission notice appear in +# supporting documentation. +# +# THE AUTHOR MICHAEL HUDSON DISCLAIMS ALL WARRANTIES WITH REGARD TO +# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, +# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + # some functional tests, to see if this is really working import py Modified: pyrepl/trunk/pyrepl/pyrepl/tests/__init__.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/tests/__init__.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/tests/__init__.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/tests/basic.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/tests/basic.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/tests/basic.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/tests/bugs.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/tests/bugs.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/tests/bugs.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/tests/infrastructure.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/tests/infrastructure.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/tests/infrastructure.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/tests/wishes.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/tests/wishes.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/tests/wishes.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2004 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/unix_console.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/unix_console.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/unix_console.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2010 Michael Hudson-Doyle # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py Mon Nov 22 23:54:12 2010 @@ -1,4 +1,4 @@ -# Copyright 2000-2004 Michael Hudson mwh at python.net +# Copyright 2000-2008 Michael Hudson-Doyle # # All Rights Reserved # From mwh at codespeak.net Mon Nov 22 23:54:17 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:17 +0100 (CET) Subject: [pyrepl-checkins] r79372 - pyrepl/trunk/pyrepl Message-ID: <20101122225417.49DC7282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:54:15 2010 New Revision: 79372 Modified: pyrepl/trunk/pyrepl/CREDITS Log: add some names to credits Modified: pyrepl/trunk/pyrepl/CREDITS ============================================================================== --- pyrepl/trunk/pyrepl/CREDITS (original) +++ pyrepl/trunk/pyrepl/CREDITS Mon Nov 22 23:54:15 2010 @@ -2,9 +2,13 @@ Gary Bishop Alejandro Dubrovsky +Antonio Cuni Eugene V. Dvurechenski John Eikenberry Martijn Fassen +Maciek Fijalkowski +Alex Gaynor +Bob Ippolito Jon Kozak Holger Krekel Erno Kuusela From mwh at codespeak.net Mon Nov 22 23:54:19 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:19 +0100 (CET) Subject: [pyrepl-checkins] r79373 - pyrepl/trunk/pyrepl Message-ID: <20101122225419.C9ABC282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:54:17 2010 New Revision: 79373 Modified: pyrepl/trunk/pyrepl/encopyright.py Log: add committer names to the copyright header Modified: pyrepl/trunk/pyrepl/encopyright.py ============================================================================== --- pyrepl/trunk/pyrepl/encopyright.py (original) +++ pyrepl/trunk/pyrepl/encopyright.py Mon Nov 22 23:54:17 2010 @@ -21,9 +21,10 @@ import os, time, sys import bzrlib.branch +import bzrlib.log header_template = """\ -# Copyright 2000-%s Michael Hudson-Doyle +# Copyright 2000-%s Michael Hudson-Doyle %s # # All Rights Reserved # @@ -43,12 +44,11 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\ """ +author_template = "\n#%s%%s"%(' '*(header_template.index("Michael")+1),) + branch, path = bzrlib.branch.Branch.open_containing(sys.argv[0]) rev_tree = branch.basis_tree() branch.lock_read() -print rev_tree -#sys.exit(0) - def process(thing): if os.path.isdir(thing): @@ -60,11 +60,37 @@ else: print "W `%s' not file or directory"%(thing,) +author_map = { + u'mwh': None, + u'Michael Hudson ': None, + u'arigo': u"Armin Rigo", + u'antocuni': u'Antonio Cuni', + u'bob': u'Bob Ippolito', + u'fijal': u'Maciek Fijalkowski', + u'agaynor': u'Alex Gaynor', + u'hpk': u'Holger Krekel', + } + def process_file(file): ilines = open(file).readlines() - last_modified = rev_tree.get_file_mtime(rev_tree.path2id(file)) + file_id = rev_tree.path2id(file) + last_modified = rev_tree.get_file_mtime(file_id) modified_year = time.gmtime(last_modified)[0] - header = header_template % (modified_year, ) + rev_ids = [rev_id for (revno, rev_id, what) + in bzrlib.log.find_touching_revisions(branch, file_id)] + revs = branch.repository.get_revisions(rev_ids) + authors = set() + for rev in revs: + authors.update(rev.get_apparent_authors()) + extra_authors = [] + for a in authors: + if a not in author_map: + print 'E: need real name for %r' % a + ea = author_map.get(a) + if ea: + extra_authors.append(ea) + extra_authors.sort() + header = header_template % (modified_year, ''.join([author_template%ea for ea in extra_authors])) header_lines = header.splitlines() prelines = [] old_copyright = [] From mwh at codespeak.net Mon Nov 22 23:54:22 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:22 +0100 (CET) Subject: [pyrepl-checkins] r79374 - pyrepl/trunk/pyrepl Message-ID: <20101122225422.69F2F282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:54:20 2010 New Revision: 79374 Modified: pyrepl/trunk/pyrepl/encopyright.py Log: only consider revisions that do not mention "encopyright" for the purposes of updating the header Modified: pyrepl/trunk/pyrepl/encopyright.py ============================================================================== --- pyrepl/trunk/pyrepl/encopyright.py (original) +++ pyrepl/trunk/pyrepl/encopyright.py Mon Nov 22 23:54:20 2010 @@ -74,11 +74,18 @@ def process_file(file): ilines = open(file).readlines() file_id = rev_tree.path2id(file) - last_modified = rev_tree.get_file_mtime(file_id) - modified_year = time.gmtime(last_modified)[0] rev_ids = [rev_id for (revno, rev_id, what) in bzrlib.log.find_touching_revisions(branch, file_id)] revs = branch.repository.get_revisions(rev_ids) + revs = sorted(revs, key=lambda x:x.timestamp) + modified_year = None + for rev in reversed(revs): + if 'encopyright' not in rev.message: + modified_year = time.gmtime(rev.timestamp)[0] + break + if not modified_year: + print 'E: no sensible modified_year found for %s' % file, + modified_year = time.gmtime(time.time())[0] authors = set() for rev in revs: authors.update(rev.get_apparent_authors()) From mwh at codespeak.net Mon Nov 22 23:54:26 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:26 +0100 (CET) Subject: [pyrepl-checkins] r79375 - pyrepl/trunk/pyrepl Message-ID: <20101122225426.1A479282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:54:24 2010 New Revision: 79375 Modified: pyrepl/trunk/pyrepl/encopyright.py Log: make matching fuzz depend on number of extra authors Modified: pyrepl/trunk/pyrepl/encopyright.py ============================================================================== --- pyrepl/trunk/pyrepl/encopyright.py (original) +++ pyrepl/trunk/pyrepl/encopyright.py Mon Nov 22 23:54:24 2010 @@ -120,7 +120,7 @@ old_copyright.append(ilines[i]) i += 1 - if abs(len(old_copyright) - len(header_lines)) < 2: + if abs(len(old_copyright) - len(header_lines)) < 2 + len(extra_authors): for x, y in zip(old_copyright, header_lines): if x[:-1] != y: print "C change needed in", file From mwh at codespeak.net Mon Nov 22 23:54:30 2010 From: mwh at codespeak.net (mwh at codespeak.net) Date: Mon, 22 Nov 2010 23:54:30 +0100 (CET) Subject: [pyrepl-checkins] r79376 - in pyrepl/trunk/pyrepl/pyrepl: . test Message-ID: <20101122225430.CE1E1282BDC@codespeak.net> Author: mwh Date: Mon Nov 22 23:54:29 2010 New Revision: 79376 Modified: pyrepl/trunk/pyrepl/pyrepl/__init__.py pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py pyrepl/trunk/pyrepl/pyrepl/commands.py pyrepl/trunk/pyrepl/pyrepl/completing_reader.py pyrepl/trunk/pyrepl/pyrepl/curses.py pyrepl/trunk/pyrepl/pyrepl/keymap.py pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py pyrepl/trunk/pyrepl/pyrepl/python_reader.py pyrepl/trunk/pyrepl/pyrepl/reader.py pyrepl/trunk/pyrepl/pyrepl/readline.py pyrepl/trunk/pyrepl/pyrepl/simple_interact.py pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py pyrepl/trunk/pyrepl/pyrepl/unix_console.py pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py Log: run encopyright Modified: pyrepl/trunk/pyrepl/pyrepl/__init__.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/__init__.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/__init__.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2008 Michael Hudson-Doyle +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/cmdrepl.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2007 Michael Hudson-Doyle +# Maciek Fijalkowski # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/commands.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/commands.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/commands.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,6 @@ # Copyright 2000-2010 Michael Hudson-Doyle +# Antonio Cuni +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/completing_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/completing_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/completing_reader.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2010 Michael Hudson-Doyle +# Antonio Cuni # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/curses.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/curses.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/curses.py Mon Nov 22 23:54:29 2010 @@ -1,5 +1,6 @@ # Copyright 2000-2010 Michael Hudson-Doyle +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/keymap.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/keymap.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/keymap.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2008 Michael Hudson-Doyle +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/pygame_keymap.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2008 Michael Hudson-Doyle +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/python_reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/python_reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/python_reader.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,6 @@ # Copyright 2000-2007 Michael Hudson-Doyle +# Bob Ippolito +# Maciek Fijalkowski # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/reader.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/reader.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/reader.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,6 @@ # Copyright 2000-2010 Michael Hudson-Doyle +# Antonio Cuni +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/readline.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/readline.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/readline.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,8 @@ # Copyright 2000-2010 Michael Hudson-Doyle +# Alex Gaynor +# Antonio Cuni +# Armin Rigo +# Holger Krekel # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/simple_interact.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/simple_interact.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/simple_interact.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2010 Michael Hudson-Doyle +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/test/test_functional.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2007 Michael Hudson-Doyle +# Maciek Fijalkowski # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/unix_console.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/unix_console.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/unix_console.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,6 @@ # Copyright 2000-2010 Michael Hudson-Doyle +# Antonio Cuni +# Armin Rigo # # All Rights Reserved # Modified: pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py ============================================================================== --- pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py (original) +++ pyrepl/trunk/pyrepl/pyrepl/unix_eventqueue.py Mon Nov 22 23:54:29 2010 @@ -1,4 +1,5 @@ # Copyright 2000-2008 Michael Hudson-Doyle +# Armin Rigo # # All Rights Reserved # From antocuni at codespeak.net Tue Nov 23 00:38:49 2010 From: antocuni at codespeak.net (antocuni at codespeak.net) Date: Tue, 23 Nov 2010 00:38:49 +0100 (CET) Subject: [pyrepl-checkins] r79378 - pyrepl/trunk/pyrepl Message-ID: <20101122233849.EEFBF5080B@codespeak.net> Author: antocuni Date: Tue Nov 23 00:38:48 2010 New Revision: 79378 Modified: pyrepl/trunk/pyrepl/PKG-INFO Log: updated PKG-INFO Modified: pyrepl/trunk/pyrepl/PKG-INFO ============================================================================== --- pyrepl/trunk/pyrepl/PKG-INFO (original) +++ pyrepl/trunk/pyrepl/PKG-INFO Tue Nov 23 00:38:48 2010 @@ -1,18 +1,18 @@ Metadata-Version: 1.0 Name: pyrepl -Version: 0.7.2 +Version: 0.8.2 Summary: A library for building flexible command line interfaces -Home-page: http://starship.python.net/crew/mwh/hacks/pyrepl.html -Author: Michael Hudson -Author-email: mwh at python.net -License: UNKNOWN +Home-page: http://codespeak.net/pyrepl/ +Author: Michael Hudson-Doyle +Author-email: micahel at gmail.com +License: MIT X11 style Description: pyrepl is a Python library, inspired by readline, for building flexible command line interfaces, featuring: - * sane multi-line editing - * history, with incremental search - * completion, including displaying of available options - * a fairly large subset of the readline emacs-mode keybindings - * a liberal, Python-style, license - * a new python top-level. + * sane multi-line editing + * history, with incremental search + * completion, including displaying of available options + * a fairly large subset of the readline emacs-mode keybindings + * a liberal, Python-style, license + * a new python top-level. Platform: unix Platform: linux