Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TurtleArt/tabasics.py36
-rw-r--r--TurtleArt/tapalette.py3
-rw-r--r--TurtleArt/tatype.py1
-rw-r--r--TurtleArt/tawindow.py2
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py29
-rw-r--r--pyexported/window_setup.py1
-rw-r--r--pysamples/uturn.py6
-rwxr-xr-xsetup.py4
8 files changed, 35 insertions, 47 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py
index 1dcaa56..a57216b 100644
--- a/TurtleArt/tabasics.py
+++ b/TurtleArt/tabasics.py
@@ -108,7 +108,6 @@ from tatype import (TYPE_BOOL, TYPE_BOX, TYPE_CHAR, TYPE_COLOR, TYPE_FLOAT,
TYPE_INT, TYPE_NUMBER, TYPE_NUMERIC_STRING, TYPE_OBJECT,
TYPE_STRING)
from taturtle import Turtle
-from tautils import debug_output
def _millisecond():
@@ -151,11 +150,10 @@ class Palettes():
def _turtle_palette(self):
''' The basic Turtle Art turtle palette '''
- debug_output('creating %s palette' % _('turtle'),
- self.tw.running_sugar)
palette = make_palette('turtle',
colors=["#00FF00", "#00A000"],
- help_string=_('Palette of turtle commands'))
+ help_string=_('Palette of turtle commands'),
+ translation=_('turtle'))
palette.add_block('forward',
style='basic-style-1arg',
@@ -346,11 +344,10 @@ setxy :x :y\npendown\nend\n')
def _pen_palette(self):
''' The basic Turtle Art pen palette '''
- debug_output('creating %s palette' % _('pen'),
- self.tw.running_sugar)
palette = make_palette('pen',
colors=["#00FFFF", "#00A0A0"],
- help_string=_('Palette of pen commands'))
+ help_string=_('Palette of pen commands'),
+ translation=_('pen'))
palette.add_block('fillscreen',
hidden=True,
@@ -540,11 +537,10 @@ pensize\nend\n')
def _color_palette(self):
''' The basic Turtle Art color palette '''
- debug_output('creating %s palette' % _('colors'),
- self.tw.running_sugar)
palette = make_palette('colors',
colors=["#00FFFF", "#00A0A0"],
- help_string=_('Palette of pen colors'))
+ help_string=_('Palette of pen colors'),
+ translation=_('colors'))
color_names = ('red', 'orange', 'yellow', 'green', 'cyan', 'blue',
'purple', 'white', 'black')
@@ -627,11 +623,10 @@ tasetshade :shade \n')
def _numbers_palette(self):
''' The basic Turtle Art numbers palette '''
- debug_output('creating %s palette' % _('numbers'),
- self.tw.running_sugar)
palette = make_palette('numbers',
colors=["#FF00FF", "#A000A0"],
- help_string=_('Palette of numeric operators'))
+ help_string=_('Palette of numeric operators'),
+ translation=_('numbers'))
palette.add_block('plus2',
style='number-style',
@@ -873,11 +868,10 @@ operators'))
def _flow_palette(self):
''' The basic Turtle Art flow palette '''
- debug_output('creating %s palette' % _('flow'),
- self.tw.running_sugar)
palette = make_palette('flow',
colors=["#FFC000", "#A08000"],
- help_string=_('Palette of flow operators'))
+ help_string=_('Palette of flow operators'),
+ translation=_('flow'))
palette.add_block('wait',
style='basic-style-1arg',
@@ -998,11 +992,10 @@ boolean operators from Numbers palette'))
def _blocks_palette(self):
''' The basic Turtle Art blocks palette '''
- debug_output('creating %s palette' % _('blocks'),
- self.tw.running_sugar)
palette = make_palette('blocks',
colors=["#FFFF00", "#A0A000"],
- help_string=_('Palette of variable blocks'))
+ help_string=_('Palette of variable blocks'),
+ translation=_('blocks'))
palette.add_block('start',
style='basic-style-head',
@@ -1190,11 +1183,10 @@ variable'))
def _trash_palette(self):
''' The basic Turtle Art turtle palette '''
- debug_output('creating %s palette' % _('trash'),
- self.tw.running_sugar)
palette = make_palette('trash',
colors=["#FFFF00", "#A0A000"],
- help_string=_('trash'))
+ help_string=_('trash'),
+ translation=_('trash'))
palette.add_block('empty',
style='blank-style',
diff --git a/TurtleArt/tapalette.py b/TurtleArt/tapalette.py
index 6fd347a..9332155 100644
--- a/TurtleArt/tapalette.py
+++ b/TurtleArt/tapalette.py
@@ -90,7 +90,6 @@ except ImportError:
HELP_PALETTE = False
from taconstants import (EXPANDABLE_STYLE, EXPANDABLE_FLOW)
-from tautils import debug_output
from gettext import gettext as _
@@ -224,7 +223,7 @@ class Palette():
def make_palette(palette_name, colors=None, help_string=None, position=None,
- init_on_start=False):
+ init_on_start=False, translation=None):
""" Palette helper function """
if colors is None:
palette = Palette(palette_name)
diff --git a/TurtleArt/tatype.py b/TurtleArt/tatype.py
index 359b5fc..3ca47b9 100644
--- a/TurtleArt/tatype.py
+++ b/TurtleArt/tatype.py
@@ -24,7 +24,6 @@ import ast
from tablock import Media
from taconstants import (Color, CONSTANTS)
-from tautils import debug_output
class Type(object):
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index d665b9f..55a4659 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -66,7 +66,7 @@ from tapalette import (palette_names, palette_blocks, expandable_blocks,
hidden_proto_blocks, string_or_number_args,
make_palette, palette_name_to_index,
palette_init_on_start, palette_i18n_names)
-from talogo import (LogoCode, primitive_dictionary, logoerror)
+from talogo import (LogoCode, logoerror)
from tacanvas import TurtleGraphics
from tablock import (Blocks, Block, Media, media_blocks_dictionary)
from taturtle import (Turtles, Turtle)
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 131d14b..8d5ab91 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -127,12 +127,12 @@ boolean operators from Numbers palette'))
True)
def _media_palette(self):
- debug_output('creating %s palette' % _('media'),
- self.tw.running_sugar)
+
palette = make_palette('media',
colors=["#A0FF00", "#80A000"],
help_string=_('Palette of media objects'),
- position=7)
+ position=7,
+ translation=_('media'))
palette.add_block('journal',
style='box-style-media',
@@ -320,12 +320,12 @@ amplitude, and duration (in seconds)'))
ArgSlot(TYPE_NUMBER)]))
def _sensor_palette(self):
- debug_output('creating %s palette' % _('sensor'),
- self.tw.running_sugar)
+
palette = make_palette('sensor',
colors=["#FF6060", "#A06060"],
help_string=_('Palette of sensor blocks'),
- position=6)
+ position=6,
+ translation=_('sensor'))
palette.add_block('mousebutton',
hidden=True,
@@ -443,12 +443,12 @@ program started'))
call_afterwards=self.after_time))
def _extras_palette(self):
- debug_output('creating %s palette' % _('extras'),
- self.tw.running_sugar)
+
palette = make_palette('extras',
colors=["#FF0000", "#A00000"],
help_string=_('Palette of extra options'),
- position=8)
+ position=8,
+ translation=_('extras'))
palette.add_block('push',
style='basic-style-1arg',
@@ -863,13 +863,13 @@ module found in the Journal'))
help_string=_('top of a collapsed stack'))
def _portfolio_palette(self):
- debug_output('creating %s palette' % _('portfolio'),
- self.tw.running_sugar)
+
palette = make_palette('portfolio',
colors=["#0606FF", "#0606A0"],
help_string=_('Palette of presentation \
templates'),
- position=9)
+ position=9,
+ translation=_('portfolio'))
palette.add_block('hideblocks',
style='basic-style-extended-vertical',
@@ -1101,12 +1101,11 @@ Journal objects'))
os.path.exists(self.tw.macros_path):
files = glob.glob(os.path.join(self.tw.macros_path, '*.tb'))
if len(files) > 0:
- debug_output('creating %s palette' % _('my blocks'),
- self.tw.running_sugar)
palette = make_palette(
'my blocks',
colors=["#FFFF00", "#A0A000"],
- help_string=_('Palette of user-defined operators'))
+ help_string=_('Palette of user-defined operators'),
+ translation=_('my blocks'))
for tafile in files:
data = data_from_file(tafile)
diff --git a/pyexported/window_setup.py b/pyexported/window_setup.py
index 45c7ba4..e8bc4e9 100644
--- a/pyexported/window_setup.py
+++ b/pyexported/window_setup.py
@@ -4,7 +4,6 @@ import cairo
import pygtk
pygtk.require('2.0')
import gtk
-import gobject
import os
from sys import argv
diff --git a/pysamples/uturn.py b/pysamples/uturn.py
index f6ff2e0..60683a0 100644
--- a/pysamples/uturn.py
+++ b/pysamples/uturn.py
@@ -1,4 +1,4 @@
-#Copyright (c) 2011-2013, Walter Bender
+ #Copyright (c) 2011-2013, Walter Bender
# This procedure is invoked when the user-definable block on the
# "extras" palette is selected.
@@ -23,7 +23,7 @@ def myblock(tw, args):
tw.lc.update_label_value('heading', value)
from TurtleArt.tapalette import make_palette, palette_name_to_index
- from TurtleArt.talogo import primitive_dictionary
+ from TurtleArt.taprimitive import Primitive, ConstantArg
from gettext import gettext as _
# Choose a palette for the new block.
@@ -37,7 +37,7 @@ def myblock(tw, args):
help_string=_('turns the turtle 180 degrees'))
# Add its primitive to the LogoCode dictionary.
- tw.lc.def_prim('uturn', 0, lambda self: _prim_uturn(tw))
+ tw.lc.def_prim('uturn', 0, Primitive(_prim_uturn, arg_descs=[ConstantArg(tw)]))
# Regenerate the palette, which will now include the new block.
tw.show_toolbar_palette(palette_name_to_index('turtle'),
diff --git a/setup.py b/setup.py
index e5026ee..6877cb5 100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-import os
+
import sys
if len(sys.argv) > 1 and '--no-sugar' == sys.argv[1]:
@@ -7,7 +7,7 @@ if len(sys.argv) > 1 and '--no-sugar' == sys.argv[1]:
# for distutils
sys.argv.pop(1)
- import glob, os.path, string
+ import glob
from distutils.core import setup
DATA_FILES = [