Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2013-02-10 20:57:57 (GMT)
committer Walter Bender <walter.bender@gmail.com>2013-02-10 20:57:57 (GMT)
commitb285375dd227959df9e237965d9ac6b77618f88d (patch)
tree42f9b9382ad4768384334f2eb37266c7b920b65e /TurtleArt
parent1d04f39a895bd7ef625d7c8f5645da33a6f78f41 (diff)
more code cleanup
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/tabasics.py19
-rw-r--r--TurtleArt/tablock.py16
-rw-r--r--TurtleArt/tacanvas.py4
-rw-r--r--TurtleArt/taexportlogo.py7
-rw-r--r--TurtleArt/talogo.py10
-rw-r--r--TurtleArt/tapalette.py6
-rw-r--r--TurtleArt/taturtle.py8
-rw-r--r--TurtleArt/tautils.py4
-rw-r--r--TurtleArt/tawindow.py10
9 files changed, 40 insertions, 44 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py
index 2ef21c2..ffa07a2 100644
--- a/TurtleArt/tabasics.py
+++ b/TurtleArt/tabasics.py
@@ -64,10 +64,10 @@ from random import uniform
from gettext import gettext as _
-from tapalette import make_palette, define_logo_function
-from talogo import primitive_dictionary, logoerror
-from tautils import convert, chr_to_ord, round_int, strtype
-from taconstants import COLORDICT, CONSTANTS, XO30
+from tapalette import (make_palette, define_logo_function)
+from talogo import (primitive_dictionary, logoerror)
+from tautils import (convert, chr_to_ord, round_int, strtype)
+from taconstants import (COLORDICT, CONSTANTS)
def _color_to_num(c):
@@ -436,14 +436,9 @@ pensize\rend\r')
def _color_palette(self):
""" The basic Turtle Art color palette """
- if self.tw.hw == XO30:
- palette = make_palette('pen',
- colors=["#00FFFF", "#00A0A0"],
- help_string=_('Palette of pen colors'))
- else:
- palette = make_palette('colors',
- colors=["#00FFFF", "#00A0A0"],
- help_string=_('Palette of pen colors'))
+ palette = make_palette('colors',
+ colors=["#00FFFF", "#00A0A0"],
+ help_string=_('Palette of pen colors'))
self._make_constant(palette, 'red', _('red'), CONSTANTS['red'])
self._make_constant(palette, 'orange', _('orange'),
diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py
index f42a9b9..3f64066 100644
--- a/TurtleArt/tablock.py
+++ b/TurtleArt/tablock.py
@@ -22,16 +22,16 @@
import gtk
import cairo
-from taconstants import EXPANDABLE, EXPANDABLE_ARGS, OLD_NAMES, CONSTANTS, \
- STANDARD_STROKE_WIDTH, BLOCK_SCALE, BOX_COLORS, GRADIENT_COLOR, \
- EXPANDABLE_FLOW, COLORDICT
-from tapalette import palette_blocks, block_colors, expandable_blocks, \
- content_blocks, block_names, block_primitives, block_styles, \
- special_block_colors
-from tasprite_factory import SVG, svg_str_to_pixbuf
+from taconstants import (EXPANDABLE, EXPANDABLE_ARGS, OLD_NAMES, CONSTANTS,
+ STANDARD_STROKE_WIDTH, BLOCK_SCALE, BOX_COLORS,
+ GRADIENT_COLOR, EXPANDABLE_FLOW, COLORDICT)
+from tapalette import (palette_blocks, block_colors, expandable_blocks,
+ content_blocks, block_names, block_primitives,
+ block_styles, special_block_colors)
+from tasprite_factory import (SVG, svg_str_to_pixbuf)
import sprites
-from tautils import debug_output, error_output
+from tautils import (debug_output, error_output)
class Blocks:
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py
index a040e4c..1d07784 100644
--- a/TurtleArt/tacanvas.py
+++ b/TurtleArt/tacanvas.py
@@ -28,8 +28,8 @@ import pango
import cairo
import pangocairo
-from tautils import image_to_base64, get_path, data_to_string, round_int, \
- debug_output
+from tautils import (image_to_base64, get_path, data_to_string, round_int,
+ debug_output)
from taconstants import COLORDICT
diff --git a/TurtleArt/taexportlogo.py b/TurtleArt/taexportlogo.py
index 7fea030..7d7d1cb 100644
--- a/TurtleArt/taexportlogo.py
+++ b/TurtleArt/taexportlogo.py
@@ -1,4 +1,4 @@
-#Copyright (c) 2008-11, Walter Bender
+#Copyright (c) 2008-13, Walter Bender
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
@@ -24,8 +24,9 @@ try:
except:
HAS_DATASTORE = False
-from TurtleArt.tapalette import logo_commands, logo_functions
-from TurtleArt.taconstants import TITLEXY, CONSTANTS
+from TurtleArt.tapalette import (logo_commands, logo_functions)
+from TurtleArt.taconstants import (TITLEXY, CONSTANTS)
+
def save_logo(tw):
""" Set up the Turtle Art color palette and color processing. """
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py
index 316b314..158857a 100644
--- a/TurtleArt/talogo.py
+++ b/TurtleArt/talogo.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#Copyright (c) 2007-8, Playful Invention Company.
-#Copyright (c) 2008-12, Walter Bender
+#Copyright (c) 2008-13, Walter Bender
#Copyright (c) 2008-10, Raúl Gutiérrez Segalés
#Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,10 +33,10 @@ try:
except ImportError:
GRID_CELL_SIZE = 55
-from taconstants import TAB_LAYER, DEFAULT_SCALE, PREFIX_DICTIONARY
-from tapalette import block_names, value_blocks
-from tautils import get_pixbuf_from_journal, convert, data_from_file, \
- text_media_type, round_int, debug_output, find_group
+from taconstants import (TAB_LAYER, DEFAULT_SCALE, PREFIX_DICTIONARY)
+from tapalette import (block_names, value_blocks)
+from tautils import (get_pixbuf_from_journal, convert, data_from_file,
+ text_media_type, round_int, debug_output, find_group)
try:
from util.RtfParser import RtfTextOnly
diff --git a/TurtleArt/tapalette.py b/TurtleArt/tapalette.py
index cac6cfa..2d903e5 100644
--- a/TurtleArt/tapalette.py
+++ b/TurtleArt/tapalette.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-#Copyright (c) 2011,12 Walter Bender
+#Copyright (c) 2011-13 Walter Bender
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
@@ -81,14 +81,14 @@ import gtk
try:
from sugar.graphics import style
- from util.helpbutton import add_section, add_paragraph
+ from util.helpbutton import (add_section, add_paragraph)
GRID_CELL_SIZE = style.GRID_CELL_SIZE
HELP_PALETTE = True
except ImportError:
GRID_CELL_SIZE = 55
HELP_PALETTE = False
-from taconstants import EXPANDABLE_STYLE, EXPANDABLE_FLOW
+from taconstants import (EXPANDABLE_STYLE, EXPANDABLE_FLOW)
from tautils import debug_output
from gettext import gettext as _
diff --git a/TurtleArt/taturtle.py b/TurtleArt/taturtle.py
index 91118de..7acb90e 100644
--- a/TurtleArt/taturtle.py
+++ b/TurtleArt/taturtle.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-#Copyright (c) 2010,12 Walter Bender
+#Copyright (c) 2010-13 Walter Bender
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@ from math import sin, cos, pi, sqrt
import gtk
import cairo
-from taconstants import TURTLE_LAYER, DEFAULT_TURTLE_COLORS
-from tasprite_factory import SVG, svg_str_to_pixbuf
-from tacanvas import wrap100, COLOR_TABLE
+from taconstants import (TURTLE_LAYER, DEFAULT_TURTLE_COLORS)
+from tasprite_factory import (SVG, svg_str_to_pixbuf)
+from tacanvas import (wrap100, COLOR_TABLE)
from sprites import Sprite
from tautils import debug_output
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index a8e372c..9affe1c 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -42,8 +42,8 @@ except (ImportError, AttributeError):
OLD_SUGAR_SYSTEM = True
from StringIO import StringIO
-from taconstants import (HIT_HIDE, HIT_SHOW, XO1, XO15, XO175, XO4,
- UNKNOWN, MAGICNUMBER, SUFFIX)
+from taconstants import (HIT_HIDE, HIT_SHOW, XO1, XO15, XO175, XO4, UNKNOWN,
+ MAGICNUMBER, SUFFIX)
import logging
_logger = logging.getLogger('turtleart-activity')
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 65c65b5..f6df191 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -58,10 +58,10 @@ from tapalette import (palette_names, palette_blocks, expandable_blocks,
block_names, content_blocks, default_values, special_names, block_styles,
help_strings, hidden_proto_blocks, string_or_number_args,
make_palette, palette_name_to_index, palette_init_on_start)
-from talogo import LogoCode, primitive_dictionary, logoerror
+from talogo import (LogoCode, primitive_dictionary, logoerror)
from tacanvas import TurtleGraphics
-from tablock import Blocks, Block
-from taturtle import Turtles, Turtle
+from tablock import (Blocks, Block)
+from taturtle import (Turtles, Turtle)
from tautils import (magnitude, get_load_name, get_save_name, data_from_file,
data_to_file, round_int, get_id, get_pixbuf_from_journal,
movie_media_type, audio_media_type, image_media_type, save_picture,
@@ -71,8 +71,8 @@ from tautils import (magnitude, get_load_name, get_save_name, data_from_file,
get_hardware, debug_output, error_output, convert,
find_bot_block, restore_clamp, collapse_clamp, data_from_string,
increment_name, get_screen_dpi)
-from tasprite_factory import SVG, svg_str_to_pixbuf, svg_from_file
-from sprites import Sprites, Sprite
+from tasprite_factory import (SVG, svg_str_to_pixbuf, svg_from_file)
+from sprites import (Sprites, Sprite)
if GST_AVAILABLE:
from tagplay import stop_media