diff --git a/problem_db/gui1.tut/analysis.py b/problem_db/gui1.tut/analysis.py index 5db6a2d..fb27069 100644 --- a/problem_db/gui1.tut/analysis.py +++ b/problem_db/gui1.tut/analysis.py @@ -73,12 +73,19 @@ def _analyse(self): 'pack (in {})'.format(pack.function_name) ) elif pack.keywords['side'] != 'tk.LEFT': - self.add_error( - 'You should be packing to the LEFT (got {} instead ' - 'in {})'.format( - pack.keywords['side'], pack.function_name + if pack.keywords['side'].lower() == 'left': + self.error( + 'You appear to be using \'{}\' as your value for' + 'side. (in {}). Please use tk.LEFT'.format( + pack.keywords['side'], pack.function_name) + ) + else: + self.add_error( + 'You should be packing to the LEFT (got {} instead ' + 'in {})'.format( + pack.keywords['side'], pack.function_name + ) ) - ) elif len(pack.keywords) > 1: self.add_error( 'You only need to provide side as an argument to ' diff --git a/problem_db/gui2.tut/analysis.py b/problem_db/gui2.tut/analysis.py index 6f43eb1..88e093a 100644 --- a/problem_db/gui2.tut/analysis.py +++ b/problem_db/gui2.tut/analysis.py @@ -73,10 +73,17 @@ def _analyse(self): 'pack (in {})'.format(pack.function_name) ) elif pack.keywords['side'] != 'tk.TOP': - self.add_error( - 'You appear to be using the wrong value for side ' - '(in {})'.format(pack.function_name) - ) + if pack.keywords['side'].lower() == 'top': + self.error( + 'You appear to be using \'{}\' as your value for' + 'side. (in {}). Please use tk.TOP'.format( + pack.keywords['side'], pack.function_name) + ) + else: + self.add_error( + 'You appear to be using the wrong value for side ' + '(in {})'.format(pack.function_name) + ) if 'anchor' not in pack.keywords: self.add_error( @@ -84,10 +91,17 @@ def _analyse(self): 'of each other on the left of the frame' ) elif pack.keywords['anchor'] != 'tk.W': - self.add_error( - 'You appear to be using the wrong value for anchor ' - '(in {})'.format(pack.function_name) - ) + if pack.keywords['anchor'].lower() == "w": + self.error( + 'You appear to be using \'{}\' as your anchor' + 'value. (in {}). Please use tk.W'.format( + pack.keywords['anchor'], pack.function_name) + ) + else: + self.add_error( + 'You appear to be using the wrong value for anchor' + ' (in {})'.format(pack.function_name) + ) # first, make sure that they're packing twice if len(pack_calls) != 2: @@ -162,4 +176,4 @@ def _analyse(self): ) -ANALYSER = Analyser(CodeVisitor) \ No newline at end of file +ANALYSER = Analyser(CodeVisitor) diff --git a/problem_db/gui3.tut/analysis.py b/problem_db/gui3.tut/analysis.py index c152205..6579e7d 100644 --- a/problem_db/gui3.tut/analysis.py +++ b/problem_db/gui3.tut/analysis.py @@ -137,12 +137,20 @@ def _analyse(self): 'pack (in {})'.format(pack.function_name) ) elif pack.keywords['side'] != 'tk.{}'.format(side): - self.add_error( - 'You should be packing to the {} (got {} instead ' - 'in {})'.format( - side, pack.keywords['side'], pack.function_name + if pack.keywords['side'].lower() == side.lower(): + self.error( + 'You appear to be using \'{}\' as your value for' + 'side. (in {}). Please use tk.{}'.format( + pack.keywords['side'], pack.function_name, + side) + ) + else: + self.add_error( + 'You should be packing to the {} (got {} instead ' + 'in {})'.format( + side, pack.keywords['side'], pack.function_name + ) ) - ) if 'expand' not in pack.keywords: self.add_error(