commit xonsh for openSUSE:Factory
Hello community, here is the log from the commit of package xonsh for openSUSE:Factory checked in at 2018-05-29 10:38:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xonsh (Old) and /work/SRC/openSUSE:Factory/.xonsh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "xonsh" Tue May 29 10:38:01 2018 rev:5 rq:611051 version:0.6.4 Changes: -------- --- /work/SRC/openSUSE:Factory/xonsh/xonsh.changes 2018-05-11 09:19:11.236532291 +0200 +++ /work/SRC/openSUSE:Factory/.xonsh.new/xonsh.changes 2018-05-29 10:38:07.723532753 +0200 @@ -1,0 +2,15 @@ +Mon May 21 06:52:00 UTC 2018 - sebix+novell.com@sebix.at + +- update to version 0.6.4: + * Changed: + * Error message improved for sourcing foreign shells, when file cannot be found + or there is a syntax error. + * Fixed: + * Fixed issues with readline completer tab completing entries + with spaces. + * Fixed ``xonsh.tools.columnize()`` bug the prevented single-row + input from being columnized correctly. + * Now honor ASYNC and AWAIT as keywords in tokenizer on + Python 3.7. + +------------------------------------------------------------------- Old: ---- 0.6.3.tar.gz New: ---- 0.6.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xonsh.spec ++++++ --- /var/tmp/diff_new_pack.vFgEkL/_old 2018-05-29 10:38:08.275512374 +0200 +++ /var/tmp/diff_new_pack.vFgEkL/_new 2018-05-29 10:38:08.279512226 +0200 @@ -17,7 +17,7 @@ Name: xonsh -Version: 0.6.3 +Version: 0.6.4 Release: 0 Summary: A general purpose, Python-ish shell License: BSD-3-Clause AND BSD-2-Clause ++++++ 0.6.3.tar.gz -> 0.6.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/.appveyor.yml new/xonsh-0.6.4/.appveyor.yml --- old/xonsh-0.6.3/.appveyor.yml 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/.appveyor.yml 2018-05-17 19:50:38.000000000 +0200 @@ -1,4 +1,4 @@ -version: 0.6.3.{build} +version: 0.6.4.{build} os: Windows Server 2012 R2 environment: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/CHANGELOG.rst new/xonsh-0.6.4/CHANGELOG.rst --- old/xonsh-0.6.3/CHANGELOG.rst 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/CHANGELOG.rst 2018-05-17 19:50:38.000000000 +0200 @@ -4,6 +4,27 @@ .. current developments +v0.6.4 +==================== + +**Changed:** + +* Error message improved for sourcing foreign shells, when file cannot be found + or there is a syntax error. + + +**Fixed:** + +* Fixed issues with readline completer tab completing entries + with spaces. +* Fixed ``xonsh.tools.columnize()`` bug the prevented single-row + input from being columnized correctly. +* Now honor ASYNC and AWAIT as keywords in tokenizer on + Python 3.7. + + + + v0.6.3 ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/docs/intro.rst new/xonsh-0.6.4/docs/intro.rst --- old/xonsh-0.6.3/docs/intro.rst 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/docs/intro.rst 2018-05-17 19:50:38.000000000 +0200 @@ -42,6 +42,7 @@ "Conches for the xonsh god!", "Python-powered, cross-platform, Unix-gazing shell", "Tab completion in Alderaan places", + "This fix was trickier than expected", "Exploiting the workers and hanging on to outdated imperialist dogma since 2015." ]; document.write(taglines[Math.floor(Math.random() * taglines.length)]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/__init__.py new/xonsh-0.6.4/xonsh/__init__.py --- old/xonsh-0.6.3/xonsh/__init__.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/__init__.py 2018-05-17 19:50:38.000000000 +0200 @@ -1,4 +1,4 @@ -__version__ = '0.6.3' +__version__ = '0.6.4' # amalgamate exclude jupyter_kernel parser_table parser_test_table pyghooks diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/aliases.py new/xonsh-0.6.4/xonsh/aliases.py --- old/xonsh-0.6.3/xonsh/aliases.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/aliases.py 2018-05-17 19:50:38.000000000 +0200 @@ -239,7 +239,8 @@ if ns.dryrun: return else: - msg = 'xonsh: error: Source failed: {}\n'.format(ns.prevcmd) + msg = 'xonsh: error: Source failed: {0!r}\n'.format(ns.prevcmd) + msg += 'xonsh: error: Possible reasons: File not found or syntax error\n' return (None, msg, 1) # apply results env = builtins.__xonsh_env__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/completers/bash_completion.py new/xonsh-0.6.4/xonsh/completers/bash_completion.py --- old/xonsh-0.6.3/xonsh/completers/bash_completion.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/completers/bash_completion.py 2018-05-17 19:50:38.000000000 +0200 @@ -14,7 +14,7 @@ import functools import subprocess -__version__ = '0.1.0' +__version__ = '0.2.1' @functools.lru_cache(1) @@ -192,7 +192,7 @@ if end in s: s = s.replace(end, ''.join('\\%s' % i for i in end)) out.add(start + s + end) - return out + return out, need_quotes BASH_COMPLETE_SCRIPT = r""" @@ -283,7 +283,8 @@ from the environment and platform. quote_paths : callable, optional A functions that quotes file system paths. You shouldn't normally need - this as the default is acceptable 99+% of the time. + this as the default is acceptable 99+% of the time. This function should + a set of the new paths and a boolean for whether the paths were quoted. Returns ------- @@ -348,7 +349,8 @@ strip_len += 1 if '-o noquote' not in complete_stmt: - out = quote_paths(out, '', '') + out, need_quotes = quote_paths(out, '', '') + strip_len += int(need_quotes) if '-o nospace' in complete_stmt: out = set([x.rstrip() for x in out]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/completers/path.py new/xonsh-0.6.4/xonsh/completers/path.py --- old/xonsh-0.6.3/xonsh/completers/path.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/completers/path.py 2018-05-17 19:50:38.000000000 +0200 @@ -164,7 +164,7 @@ s = s.replace(end, ''.join('\\%s' % i for i in end)) s = start + s + end if append_end else start + s out.add(s) - return out + return out, need_quotes def _joinpath(path): @@ -298,10 +298,10 @@ if cdpath: _add_cdpaths(paths, prefix) paths = set(filter(filtfunc, paths)) - paths = _quote_paths({_normpath(s) for s in paths}, - path_str_start, - path_str_end, - append_end) + paths, _ = _quote_paths({_normpath(s) for s in paths}, + path_str_start, + path_str_end, + append_end) paths.update(filter(filtfunc, _dots(prefix))) paths.update(filter(filtfunc, _env(prefix))) return paths, lprefix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/lexer.py new/xonsh-0.6.4/xonsh/lexer.py --- old/xonsh-0.6.3/xonsh/lexer.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/lexer.py 2018-05-17 19:50:38.000000000 +0200 @@ -59,7 +59,7 @@ tm[NEWLINE] = 'NEWLINE' tm[INDENT] = 'INDENT' tm[DEDENT] = 'DEDENT' - if PYTHON_VERSION_INFO >= (3, 5, 0): + if (3, 5, 0) <= PYTHON_VERSION_INFO < (3, 7, 0): from xonsh.tokenize import ASYNC, AWAIT tm[ASYNC] = 'ASYNC' tm[AWAIT] = 'AWAIT' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/readline_shell.py new/xonsh-0.6.4/xonsh/readline_shell.py --- old/xonsh-0.6.3/xonsh/readline_shell.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/readline_shell.py 2018-05-17 19:50:38.000000000 +0200 @@ -269,6 +269,43 @@ self._current_indent = '' self._current_prompt = '' self._force_hide = None + self._complete_only_last_table = { + # Truth table for completions, keys are: + # (prefix_begs_quote, prefix_ends_quote, i_ends_quote, + # last_starts_with_prefix, i_has_space) + (True, True, True, True, True): True, + (True, True, True, True, False): True, + (True, True, True, False, True): False, + (True, True, True, False, False): True, + (True, True, False, True, True): False, + (True, True, False, True, False): False, + (True, True, False, False, True): False, + (True, True, False, False, False): False, + (True, False, True, True, True): True, + (True, False, True, True, False): False, + (True, False, True, False, True): False, + (True, False, True, False, False): True, + (True, False, False, True, True): False, + (True, False, False, True, False): False, + (True, False, False, False, True): False, + (True, False, False, False, False): False, + (False, True, True, True, True): True, + (False, True, True, True, False): True, + (False, True, True, False, True): True, + (False, True, True, False, False): True, + (False, True, False, True, True): False, + (False, True, False, True, False): False, + (False, True, False, False, True): False, + (False, True, False, False, False): False, + (False, False, True, True, True): True, + (False, False, True, True, False): False, + (False, False, True, False, True): False, + (False, False, True, False, False): True, + (False, False, False, True, True): True, + (False, False, False, True, False): False, + (False, False, False, False, True): False, + (False, False, False, False, False): False, + } self.cmdqueue = collections.deque() def __del__(self): @@ -297,11 +334,15 @@ return '', line, line def _querycompletions(self, completions, loc): - """Returns whether or not we should show completions""" + """Returns whether or not we should show completions. 0 means that prefixes + should not be shown, 1 means that there is a common prefix among all completions + and they should be shown, while 2 means that there is no common prefix but + we are under the query limit and they should be shown. + """ if os.path.commonprefix([c[loc:] for c in completions]): - return True + return 1 elif len(completions) <= builtins.__xonsh_env__.get('COMPLETION_QUERY_LIMIT'): - return True + return 2 msg = '\nDisplay all {} possibilities? '.format(len(completions)) msg += '({GREEN}y{NO_COLOR} or {RED}n{NO_COLOR})' self.print_color(msg, end='', flush=True, file=sys.stderr) @@ -312,7 +353,7 @@ print() if not show_completions: rl_on_new_line() - return False + return 0 w, h = shutil.get_terminal_size() lines = columnize(completions, width=w) more_msg = self.format_color('{YELLOW}==={NO_COLOR} more or ' @@ -326,10 +367,10 @@ print(flush=True, file=sys.stderr) if q == 'q': rl_on_new_line() - return False + return 0 print(''.join(lines), end='', flush=True, file=sys.stderr) rl_on_new_line() - return False + return 0 def completedefault(self, prefix, line, begidx, endidx): """Implements tab-completion for text.""" @@ -342,9 +383,31 @@ begidx, endidx, ctx=self.ctx) chopped = prefix[:-l] - rtn_completions = [chopped + i for i in completions] + if chopped: + rtn_completions = [chopped + i for i in completions] + else: + rtn_completions = completions + rtn = [] + prefix_begs_quote = prefix.startswith("'") or prefix.startswith('"') + prefix_ends_quote = prefix.endswith("'") or prefix.endswith('"') + for i in rtn_completions: + i_ends_quote = i.endswith("'") or i.endswith('"') + last = i.rsplit(' ', 1)[-1] + last_starts_prefix = last.startswith(prefix) + i_has_space = ' ' in i + key = (prefix_begs_quote, prefix_ends_quote, i_ends_quote, + last_starts_prefix, i_has_space) + rtn.append(last if self._complete_only_last_table[key] else i) + # return based on show completions show_completions = self._querycompletions(completions, endidx - begidx) - return rtn_completions if show_completions else [] + if show_completions == 0: + return [] + elif show_completions == 1: + return rtn + elif show_completions == 2: + return completions + else: + raise ValueError('query completions flag not understood.') # tab complete on first index too completenames = completedefault diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/tokenize.py new/xonsh-0.6.4/xonsh/tokenize.py --- old/xonsh-0.6.3/xonsh/tokenize.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/tokenize.py 2018-05-17 19:50:38.000000000 +0200 @@ -52,7 +52,7 @@ "NL", "untokenize", "ENCODING", "TokenInfo", "TokenError", 'SEARCHPATH', 'ATDOLLAR', 'ATEQUAL', 'DOLLARNAME', 'IOREDIRECT'] -PY35 = PYTHON_VERSION_INFO >= (3, 5, 0) +PY35 = (3, 5, 0) <= PYTHON_VERSION_INFO < (3, 7, 0) if PY35: ASYNC = token.ASYNC AWAIT = token.AWAIT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/tools.py new/xonsh-0.6.4/xonsh/tools.py --- old/xonsh-0.6.3/xonsh/tools.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/tools.py 2018-05-17 19:50:38.000000000 +0200 @@ -1925,12 +1925,21 @@ The newline character will be appended to the end of each line. """ sizes = [len(e) + 1 for e in elems] + total = sum(sizes) nelem = len(elems) - ncols = 1 - nrows = len(sizes) - columns = [sizes] - last_longest_row = max(sizes) - while True: + if total - 1 <= width: + ncols = len(sizes) + nrows = 1 + columns = [sizes] + last_longest_row = total + enter_loop = False + else: + ncols = 1 + nrows = len(sizes) + columns = [sizes] + last_longest_row = max(sizes) + enter_loop = True + while enter_loop: longest_row = sum(map(max, columns)) if longest_row - 1 <= width: # we might be able to fit another column. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xonsh-0.6.3/xonsh/xonfig.py new/xonsh-0.6.4/xonsh/xonfig.py --- old/xonsh-0.6.3/xonsh/xonfig.py 2018-05-04 21:53:23.000000000 +0200 +++ new/xonsh-0.6.4/xonsh/xonfig.py 2018-05-17 19:50:38.000000000 +0200 @@ -652,6 +652,7 @@ "Conches for the xonsh god!", "Python-powered, cross-platform, Unix-gazing shell", "Tab completion in Alderaan places", + "This fix was trickier than expected", ]
participants (1)
-
root@hilbert.suse.de