diff options
Diffstat (limited to 'plugins/turtle_blocks_extras/turtle_blocks_extras.py')
-rw-r--r-- | plugins/turtle_blocks_extras/turtle_blocks_extras.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py index 8f5a94d..48a2565 100644 --- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py +++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py @@ -33,7 +33,7 @@ from TurtleArt.talogo import (primitive_dictionary, logoerror, from TurtleArt.taconstants import (DEFAULT_SCALE, ICON_SIZE, CONSTANTS, MEDIA_SHAPES, SKIN_PATHS, BLOCKS_WITH_SKIN, PYTHON_SKIN, PREFIX_DICTIONARY, VOICES, - MACROS, COLORDICT) + MACROS, Color) from TurtleArt.tautils import (round_int, debug_output, get_path, data_to_string, find_group, image_to_base64, hat_on_top, listify, data_from_file) @@ -1080,20 +1080,20 @@ Journal objects')) """ Print object n """ if flag and (self.tw.hide or self.tw.step_time == 0): return - if type(n) == list: + if isinstance(n, list): self.tw.showlabel('print', n) - elif type(n) == str or type(n) == unicode: - if n in COLORDICT: - if COLORDICT[n][0] is None: - self.tw.showlabel('print', '%s %d, %s %d' % - (_('shade'), COLORDICT[n][1], - _('gray'), COLORDICT[n][2])) - else: - self.tw.showlabel('print', '%s %d, %s %d, %s %d' % - (_('color'), COLORDICT[n][0], - _('shade'), COLORDICT[n][1], - _('gray'), COLORDICT[n][2])) - elif n[0:6] == 'media_' and \ + elif isinstance(n, Color): + if n.color is None: + self.tw.showlabel('print', '%s %d, %s %d' % + (_('shade'), n.shade, + _('gray'), n.gray)) + else: + self.tw.showlabel('print', '%s %d, %s %d, %s %d' % + (_('color'), n.color, + _('shade'), n.shade, + _('gray'), n.gray)) + elif isinstance(n, basestring): + if n[0:6] == 'media_' and \ n[6:].lower not in media_blocks_dictionary: try: if self.tw.running_sugar: @@ -1111,7 +1111,7 @@ Journal objects')) self.tw.showlabel('print', n) else: self.tw.showlabel('print', n) - elif type(n) == int: + elif isinstance(n, int): self.tw.showlabel('print', n) else: self.tw.showlabel( |