From 7682f204fba51eaa9fb571b29c66b7fad8b5e08a Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 20 Apr 2014 01:54:16 +0200 Subject: [PATCH] make it possible to show locations with sith.py before something is executed. This makes never ending completions traceable. --- sith.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sith.py b/sith.py index fe81468c..8b9996cc 100755 --- a/sith.py +++ b/sith.py @@ -27,7 +27,7 @@ Note: Line numbers start at 1; columns start at 0 (this is consistent with many text editors, including Emacs). Usage: - sith.py [--pdb|--ipdb|--pudb] [-d] [-n=] [-f] [--record=] random [] + sith.py [--pdb|--ipdb|--pudb] [-d] [-n=] [-f] [--record=] random [-s] [] sith.py [--pdb|--ipdb|--pudb] [-d] [-f] [--record=] redo sith.py [--pdb|--ipdb|--pudb] [-d] [-f] run sith.py show [--record=] @@ -39,6 +39,7 @@ Options: -f, --fs-cache By default, file system cache is off for reproducibility. -n, --maxtries= Maximum of random tries [default: 100] -d, --debug Jedi print debugging when an error is raised. + -s Shows the path/line numbers of every completion before it starts. --pdb Launch pdb when error is raised. --ipdb Launch ipdb when error is raised. --pudb Launch pudb when error is raised. @@ -199,8 +200,13 @@ def main(arguments): else: for _ in range(int(arguments['--maxtries'])): t = TestCase.generate(arguments[''] or '.') + if arguments['-s']: + print('%s %s %s %s ' % (t.operation, t.path, t.line, t.column)) + sys.stdout.flush() + else: + print('.', end='') t.run(debugger, record) - print('.', end='') + sys.stdout.flush() print()