diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-31 22:17:07 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-31 22:17:07 (GMT) |
commit | 16c88b1eeec8fab27f75c01faff111de026e0114 (patch) | |
tree | ed7808ecddf935708264e81b6d1d59c876fd831a /TurtleArt/tabasics.py | |
parent | 5052f0e75b77c279484a74393f4ff6c55a07af7d (diff) |
remove unused code from tabasics and taprimitive
Diffstat (limited to 'TurtleArt/tabasics.py')
-rw-r--r-- | TurtleArt/tabasics.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 8bb50e4..eda9958 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -135,9 +135,6 @@ class Palettes(): "check_number": Primitive(self.check_number, return_type=TYPE_NUMBER, # TODO make this function obsolete (the return type is actually nonsense) arg_descs=[ArgSlot(TYPE_OBJECT)], export_me=False), - "convert_value_for_move": Primitive(self.convert_value_for_move, - return_type=TYPE_NUMBER, # TODO make this function obsolete (the return type is actually nonsense) - arg_descs=[ArgSlot(TYPE_OBJECT)], export_me=False), "convert_for_cmp": Primitive(Primitive.convert_for_cmp, constant_args={'decimal_point': self.tw.decimal_point}), "convert_to_number": Primitive(Primitive.convert_to_number, @@ -330,7 +327,6 @@ turtle (can be used in place of a number block)'), label=['turtle']) # Deprecated - primitive_dictionary['move'] = self._prim_move palette.add_block('setxy', hidden=True, style='basic-style-2arg', @@ -1201,36 +1197,6 @@ variable')) self.tw.lc.ireturn() yield True - def convert_value_for_move(self, value): - ''' Perform type conversion and other preprocessing on the parameter, - so it can be passed to the 'move' primitive. ''' - if value is None: - return value - - def _convert_to_float(val): - if not _num_type(val): - raise logoerror("#notanumber") - return float(val) - - if isinstance(value, (tuple, list)): - (val1, val2) = value - val1_float = _convert_to_float(val1) - val2_float = _convert_to_float(val2) - value_converted = (val1_float, val2_float) - else: - value_converted = _convert_to_float(value) - return value_converted - - def _prim_move(self, cmd, value1, pendown=True, - reverse=False): - ''' Turtle moves by method specified in value1 ''' - - value1_conv = self.convert_value_for_move(value1) - - cmd(value1_conv, pendown=pendown) - - self.after_move() - def after_move(self, *ignored_args, **ignored_kwargs): ''' Update labels after moving the turtle ''' if self.tw.lc.update_values: |