From 9f200b43ce178aa87ddfb90fb4c664084b6934c2 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 14 Mar 2014 13:10:25 +0100 Subject: [PATCH] sith readability --- sith.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sith.py b/sith.py index 647e674d..5e3752a2 100755 --- a/sith.py +++ b/sith.py @@ -143,9 +143,10 @@ class TestCase(object): def show_location(self, lineno, column, show=3): # Three lines ought to be enough lower = lineno - show if lineno - show > 0 else 0 + prefix = ' |' for i, line in enumerate(self.script.source.split('\n')[lower:lineno]): - print(lower + i + 1, line) - print(' ' * (column + len(str(lineno))), '^') + print(prefix, lower + i + 1, line) + print(prefix, ' ', ' ' * (column + len(str(lineno))), '^') def show_operation(self): print("%s:\n" % self.operation.capitalize()) @@ -174,6 +175,8 @@ class TestCase(object): def show_goto_definitions(self): for completion in self.objects: print(completion.desc_with_module) + if completion.module_path is None: + continue if os.path.abspath(completion.module_path) == os.path.abspath(self.path): self.show_location(completion.line, completion.column)