From 5665b24048a2577d50a39bd4b6928754972e988a Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Mon, 29 Aug 2011 04:16:16 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:turtleart/mainline --- diff --git a/NEWS b/NEWS index cdb3e4c..c0058f2 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,25 @@ +114 + +ENHANCEMENTS +* Toolbar cleanup to be consistent with new design-team guidelines +* Support for accelerometer on XO 1.75 hardware + +BUG FIXES +* Fixed race-condition that sometimes prevented turtle art from + launching (#3044) + 113 ENHANCEMENTS -* Reenabled initial setting of a default palette toolbar (accidently removed in v111 when fixing keyboard acceration problem #2986) -* Enbaled scaling of box-style-media (used to improve the display of currency with currency plugin) +* Enabled scaling of box-style-media (used to improve the display of + currency with currency plug-in) + See http://wiki.sugarlabs.org/go/Activities/TurtleArt#currency * Update to mn translations -BUG FIX +BUG FIXES +* Re-enabled initial setting of a default Palette Toolbar + (accidentally removed in Version 111 when fixing keyboard acceleration + problem #2986) * Fixed problem with scaling some blocks with image overlays 112 @@ -23,7 +37,7 @@ ENHANCEMENTS * New python block example for csound * Translation updates for .de -BUG FIX +BUG FIXES * Reverted default action name to 'action' instead of 'stack' * Reverted accelerator-key work-around (#2050) in light of #2986 diff --git a/TurtleArt/taconstants.py b/TurtleArt/taconstants.py index 44d4d01..2bb9049 100644 --- a/TurtleArt/taconstants.py +++ b/TurtleArt/taconstants.py @@ -72,6 +72,7 @@ SHOW_WHITE = "#F0F0F0" DEFAULT_SCALE = 33 XO1 = 'xo1' XO15 = 'xo1.5' +XO175 = 'xo1.75' UNKNOWN = 'unknown' CONSTANTS = {'leftpos': None, 'toppos': None, 'rightpos': None, diff --git a/TurtleArt/tasprite_factory.py b/TurtleArt/tasprite_factory.py index c9fc4c4..4b6fd78 100755 --- a/TurtleArt/tasprite_factory.py +++ b/TurtleArt/tasprite_factory.py @@ -509,6 +509,8 @@ class SVG: svg += self.style() if self._show is True: svg += self._show_dot() + if self._hide is True: + svg += self._hide_dot() svg += self.footer() return self.header() + svg diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py index ed14784..f4b6bdc 100644 --- a/TurtleArt/tautils.py +++ b/TurtleArt/tautils.py @@ -42,7 +42,7 @@ except (ImportError, AttributeError): from StringIO import StringIO from taconstants import HIDE_LAYER, COLLAPSIBLE, BLOCK_LAYER, HIT_HIDE, \ - HIT_SHOW, XO1, XO15, UNKNOWN + HIT_SHOW, XO1, XO15, XO175, UNKNOWN import logging _logger = logging.getLogger('turtleart-activity') @@ -803,7 +803,9 @@ def get_hardware(): """ Determine whether we are using XO 1.0, 1.5, or "unknown" hardware """ product = _get_dmi('product_name') if product is None: - if os.path.exists('/etc/olpc-release') or \ + if os.path.exists('/sys/devices/platform/lis3lv02d/position'): + return XO175 # FIXME: temporary check for XO 1.75 + elif os.path.exists('/etc/olpc-release') or \ os.path.exists('/sys/power/olpc-pm'): return XO1 else: @@ -816,7 +818,7 @@ def get_hardware(): elif version == '1.5': return XO15 else: - return UNKNOWN + return XO175 def _get_dmi(node): diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index f38b503..992e291 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -57,8 +57,8 @@ from taconstants import HORIZONTAL_PALETTE, VERTICAL_PALETTE, BLOCK_SCALE, \ MACROS, TOP_LAYER, BLOCK_LAYER, OLD_NAMES, DEFAULT_TURTLE, TURTLE_LAYER, \ CURSOR, EXPANDABLE, COLLAPSIBLE, DEAD_DICTS, DEAD_KEYS, NO_IMPORT, \ TEMPLATES, PYTHON_SKIN, PALETTE_HEIGHT, STATUS_LAYER, OLD_DOCK, \ - EXPANDABLE_ARGS, XO1, XO15, UNKNOWN, TITLEXY, CONTENT_ARGS, CONSTANTS, \ - EXPAND_SKIN + EXPANDABLE_ARGS, XO1, XO15, XO175, UNKNOWN, TITLEXY, CONTENT_ARGS, \ + CONSTANTS, EXPAND_SKIN from tapalette import palette_names, palette_blocks, expandable_blocks, \ block_names, content_blocks, default_values, special_names, block_styles, \ help_strings @@ -109,7 +109,8 @@ class TurtleArtWindow(): self.gc = self.area.new_gc() else: # We lose... - debug_output('drawable area is None... punting') + debug_output('drawable area is None... punting', + self.running_sugar) exit() self._setup_events() elif type(win) == gtk.gdk.Pixmap: @@ -155,7 +156,7 @@ class TurtleArtWindow(): self.orientation = HORIZONTAL_PALETTE self.hw = get_hardware() - if self.hw in (XO1, XO15): + if self.hw in (XO1, XO15, XO175): self.lead = 1.0 self.scale = 0.67 if self.hw == XO1: @@ -298,9 +299,16 @@ class TurtleArtWindow(): try: exec f in globals(), plugins self._plugins.append(plugins.values()[0](self)) - # debug_output('successfully importing %s' % (plugin_class)) + debug_output('successfully importing %s' % (plugin_class), + self.running_sugar) except ImportError: - debug_output('failed to import %s' % (plugin_class)) + debug_output('failed to import %s' % (plugin_class), + self.running_sugar) + ''' + exec f in globals(), plugins + self._plugins.append(plugins.values()[0](self)) + debug_output('successfully importing %s' % (plugin_class)) + ''' # Add the icon dir for each plugin to the icon_theme search path for plugin_dir in self._get_plugins_from_plugins_dir( @@ -540,9 +548,6 @@ class TurtleArtWindow(): if blk.status != 'collapsed': blk.spr.set_layer(BLOCK_LAYER) self.show_palette() - if self.activity is not None and self.activity.has_toolbarbox: - self.activity.palette_buttons[0].set_icon( - palette_names[0] + 'on') self.hide = False if self.running_sugar: self.activity.recenter() @@ -786,7 +791,8 @@ class TurtleArtWindow(): # Hide the selectors for i in range(len(palette_blocks)): self.selectors[i].hide() - elif self.selected_palette is not None: + elif self.selected_palette is not None and \ + not self.activity.has_toolbarbox: self.activity.palette_buttons[self.selected_palette].set_icon( palette_names[self.selected_palette] + 'off') self.selected_palette = None @@ -1021,12 +1027,14 @@ class TurtleArtWindow(): not self.activity.has_toolbarbox: self._select_category(self.selectors[i]) else: - if self.selected_palette is not None: + if self.selected_palette is not None and \ + not self.activity.has_toolbarbox: self.activity.palette_buttons[ self.selected_palette].set_icon( palette_names[self.selected_palette] + 'off') - self.activity.palette_buttons[i].set_icon( - palette_names[i] + 'on') + if not self.activity.has_toolbarbox: + self.activity.palette_buttons[i].set_icon( + palette_names[i] + 'on') self.show_palette(i) else: self.orientation = 1 - self.orientation @@ -1796,7 +1804,6 @@ class TurtleArtWindow(): elif blk.name in COLLAPSIBLE or blk.name == 'sandwichtop_no_label': if blk.name == 'sandwichtop_no_label': - debug_output('>>>>>>>>> HIT SANDWICHTOP') if hide_button_hit(blk.spr, x, y): collapse_stack(blk) else: diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 820a9e3..75803e8 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -36,6 +36,7 @@ try: # 0.86 toolbar widgets except ImportError: HAS_TOOLBARBOX = False from sugar.graphics.toolbutton import ToolButton +from sugar.graphics.radiotoolbutton import RadioToolButton from sugar.datastore import datastore from sugar import profile @@ -47,7 +48,7 @@ import tarfile from gettext import gettext as _ from TurtleArt.tapalette import palette_names, help_strings -from TurtleArt.taconstants import ICON_SIZE, BLOCK_SCALE, XO1, XO15 +from TurtleArt.taconstants import ICON_SIZE, BLOCK_SCALE, XO1, XO15, XO175 from TurtleArt.taexporthtml import save_html from TurtleArt.taexportlogo import save_logo from TurtleArt.tautils import data_to_file, data_to_string, data_from_string, \ @@ -63,16 +64,20 @@ class TurtleArtActivity(activity.Activity): super(TurtleArtActivity, self).__init__(handle) self._check_ver_change(get_path(activity, 'data')) - self._setup_visibility_handler() self.has_toolbarbox = HAS_TOOLBARBOX + _logger.debug('_setup_toolbar') self._setup_toolbar() + _logger.debug('_setup_canvas') self._setup_canvas(self._setup_scrolled_window()) + _logger.debug('_setup_palette_toolbar') self._setup_palette_toolbar() + self._setup_help_toolbar() + _logger.debug('_setup_sharing') self._setup_sharing() # Activity toolbar callbacks @@ -80,7 +85,7 @@ class TurtleArtActivity(activity.Activity): def do_save_as_html_cb(self, button): ''' Write html out to datastore. ''' self.save_as_html.set_icon('htmlon') - _logger.debug('saving html code') + _logger.debug('saving HTML code') # Until we have URLs for datastore objects, always embed images. embed_flag = True @@ -217,15 +222,16 @@ class TurtleArtActivity(activity.Activity): def do_palette_buttons_cb(self, button, i): ''' Palette selector buttons ''' if self.tw.selected_palette is not None: - self.palette_buttons[self.tw.selected_palette].set_icon( - palette_names[self.tw.selected_palette] + 'off') + if not self.has_toolbarbox: + self.palette_buttons[self.tw.selected_palette].set_icon( + palette_names[self.tw.selected_palette] + 'off') if self.tw.selected_palette == i: # Hide the palette if it is already selected. self.tw.hideshow_palette(False) self.do_hidepalette() return - - self.palette_buttons[i].set_icon(palette_names[i] + 'on') + if not self.has_toolbarbox: + self.palette_buttons[i].set_icon(palette_names[i] + 'on') self.tw.show_palette(i) self.do_showpalette() @@ -466,153 +472,156 @@ class TurtleArtActivity(activity.Activity): self._palette_toolbar = gtk.Toolbar() self._palette_toolbar_button = ToolbarButton( page=self._palette_toolbar, icon_name='palette') - help_toolbar = gtk.Toolbar() + self._help_toolbar = gtk.Toolbar() help_toolbar_button = ToolbarButton(label=_('Help'), - page=help_toolbar, + page=self._help_toolbar, icon_name='help-toolbar') - journal_toolbar = gtk.Toolbar() - journal_toolbar_button = ToolbarButton(page=journal_toolbar, - icon_name='activity-journal') + self._make_load_save_buttons(activity_toolbar_button) activity_toolbar_button.show() self._toolbox.toolbar.insert(activity_toolbar_button, -1) edit_toolbar_button.show() self._toolbox.toolbar.insert(edit_toolbar_button, -1) - journal_toolbar_button.show() - self._toolbox.toolbar.insert(journal_toolbar_button, -1) view_toolbar_button.show() self._toolbox.toolbar.insert(view_toolbar_button, -1) self._palette_toolbar_button.show() self._toolbox.toolbar.insert(self._palette_toolbar_button, -1) - help_toolbar_button.show() - self._toolbox.toolbar.insert(help_toolbar_button, -1) - - self._add_separator(self._toolbox.toolbar) self._make_project_buttons(self._toolbox.toolbar) - self._add_separator(self._toolbox.toolbar, True) + self._add_separator(self._toolbox.toolbar, expand=True, + visible=False) + + self.samples_button = self._add_button( + 'ta-open', _('Load example'), self.do_samples_cb, + self._toolbox.toolbar) + + help_toolbar_button.show() + self._toolbox.toolbar.insert(help_toolbar_button, -1) stop_button = StopButton(self) stop_button.props.accelerator = 'Q' self._toolbox.toolbar.insert(stop_button, -1) stop_button.show() + _logger.debug('set_toolbar_box') + self.set_toolbar_box(self._toolbox) + self._palette_toolbar_button.set_expanded(True) else: self._toolbox = activity.ActivityToolbox(self) self.set_toolbox(self._toolbox) project_toolbar = gtk.Toolbar() self._toolbox.add_toolbar(_('Project'), project_toolbar) - view_toolbar = gtk.Toolbar() self._toolbox.add_toolbar(_('View'), view_toolbar) - view_toolbar_button = view_toolbar edit_toolbar = gtk.Toolbar() self._toolbox.add_toolbar(_('Edit'), edit_toolbar) - edit_toolbar_button = edit_toolbar journal_toolbar = gtk.Toolbar() self._toolbox.add_toolbar(_('Import/Export'), journal_toolbar) - journal_toolbar_button = journal_toolbar - help_toolbar = gtk.Toolbar() - self._toolbox.add_toolbar(_('Help'), help_toolbar) - help_toolbar_button = help_toolbar + self._help_toolbar = gtk.Toolbar() + self._toolbox.add_toolbar(_('Help'), self._help_toolbar) self._make_palette_buttons(project_toolbar, palette_button=True) self._add_separator(project_toolbar) self._make_project_buttons(project_toolbar) + self._make_load_save_buttons(journal_toolbar) - self.keep_button = self._add_button( - 'filesaveoff', _('Save snapshot'), self.do_keep_cb, - journal_toolbar_button) - self.save_as_html = self._add_button( - 'htmloff', _('Save as HTML'), self.do_save_as_html_cb, - journal_toolbar_button) - self.save_as_logo = self._add_button( - 'logo-saveoff', _('Save as Logo'), self.do_save_as_logo_cb, - journal_toolbar_button) - self.save_as_image = self._add_button( - 'image-saveoff', _('Save as image'), self.do_save_as_image_cb, - journal_toolbar_button) - self.load_ta_project = self._add_button( - 'load-from-journal', _('Import project from the Journal'), - self.do_load_ta_project_cb, journal_toolbar_button) - self._add_separator(journal_toolbar) - self.load_python = self._add_button( - 'pippy-openoff', _('Load Python block'), self.do_load_python_cb, - journal_toolbar_button) - self.samples_button = self._add_button( - 'ta-open', _('Load example'), self.do_samples_cb, - journal_toolbar_button) self._add_button('edit-copy', _('Copy'), self._copy_cb, - edit_toolbar_button, 'c') + edit_toolbar, 'c') self._add_button('edit-paste', _('Paste'), self._paste_cb, - edit_toolbar_button, 'v') + edit_toolbar, 'v') self._add_button('view-fullscreen', _('Fullscreen'), - self.do_fullscreen_cb, view_toolbar_button, - 'Return') + self.do_fullscreen_cb, view_toolbar, 'Return') self._add_button('view-Cartesian', _('Cartesian coordinates'), - self.do_cartesian_cb, view_toolbar_button) + self.do_cartesian_cb, view_toolbar) self._add_button('view-polar', _('Polar coordinates'), - self.do_polar_cb, view_toolbar_button) - if get_hardware() in [XO1, XO15]: + self.do_polar_cb, view_toolbar) + if get_hardware() in [XO1, XO15, XO175]: self._add_button('view-metric', _('Metric coordinates'), - self.do_metric_cb, view_toolbar_button) - self._add_separator(view_toolbar) + self.do_metric_cb, view_toolbar) + self._add_separator(view_toolbar, visible=False) self.coordinates_label = self._add_label(_('xcor') + ' = 0 ' + \ _('ycor') + ' = 0 ' + _('heading') + ' = 0', view_toolbar) - self._add_separator(view_toolbar, True) + self._add_separator(view_toolbar, expand=True, visible=False) self.rescale_button = self._add_button( 'expand-coordinates', _('Rescale coordinates up'), - self.do_rescale_cb, view_toolbar_button) + self.do_rescale_cb, view_toolbar) self.resize_up_button = self._add_button( - 'resize+', _('Grow blocks'), self.do_grow_blocks_cb, - view_toolbar_button) + 'resize+', _('Grow blocks'), self.do_grow_blocks_cb, view_toolbar) self.resize_down_button = self._add_button( 'resize-', _('Shrink blocks'), self.do_shrink_blocks_cb, - view_toolbar_button) - if gtk.gtk_version[0] > 2 or gtk.gtk_version[1] > 16: - self.hover_help_label = self._add_label( - _('Move the cursor over the orange palette for help.'), - help_toolbar, gtk.gdk.screen_width() - 2 * ICON_SIZE) - else: - self.hover_help_label = self._add_label( - _('Move the cursor over the orange palette for help.'), - help_toolbar) + view_toolbar) edit_toolbar.show() view_toolbar.show() - help_toolbar.show() + self._help_toolbar.show() self._toolbox.show() - # Setup palette toolbar only *after* initializing the plugins - if self.has_toolbarbox: - self._palette_toolbar_button.set_expanded(True) - else: + if not self.has_toolbarbox: self._toolbox.set_current_toolbar(1) + def _setup_help_toolbar(self): + ''' The help toolbar must be setup we determine what hardware + is in use. ''' + # FIXME: Temporary work-around gtk problem with XO175 + if get_hardware() not in [XO175] and \ + (gtk.gtk_version[0] > 2 or gtk.gtk_version[1] > 16): + self.hover_help_label = self._add_label( + _('Move the cursor over the orange palette for help.'), + self._help_toolbar, gtk.gdk.screen_width() - 2 * ICON_SIZE) + else: + self.hover_help_label = self._add_label( + _('Move the cursor over the orange palette for help.'), + self._help_toolbar) + def _setup_palette_toolbar(self): - # The palette toolbar must be setup *after* plugins are loaded. + ''' The palette toolbar must be setup *after* plugins are loaded. ''' if self.has_toolbarbox: self.palette_buttons = [] - for i, name in enumerate(palette_names): - if i > 0: - suffix = 'off' + for i, palette_name in enumerate(palette_names): + if i == 0: + palette_group = None else: - suffix = 'on' - self.palette_buttons.append(self._add_button(name + suffix, - help_strings[name], self.do_palette_buttons_cb, - self._palette_toolbar_button, None, i)) - self._add_separator(self._palette_toolbar, True) - - self._make_palette_buttons(self._palette_toolbar_button) - - self.set_toolbar_box(self._toolbox) + palette_group = self.palette_buttons[0] + _logger.debug('palette_buttons.append %s', palette_name) + self.palette_buttons.append(self._radio_button_factory( + palette_name + 'off', + self._palette_toolbar, + self.do_palette_buttons_cb, i, + help_strings[palette_name], + palette_group)) + self._add_separator(self._palette_toolbar, expand=True, + visible=False) + self._make_palette_buttons(self._palette_toolbar) self._palette_toolbar.show() + def _make_load_save_buttons(self, toolbar): + self.save_as_image = self._add_button( + 'image-saveoff', _('Save as image'), self.do_save_as_image_cb, + toolbar) + self.save_as_html = self._add_button( + 'htmloff', _('Save as HTML'), self.do_save_as_html_cb, toolbar) + self.save_as_logo = self._add_button( + 'logo-saveoff', _('Save as Logo'), self.do_save_as_logo_cb, + toolbar) + self.keep_button = self._add_button( + 'filesaveoff', _('Save snapshot'), self.do_keep_cb, toolbar) + if not self.has_toolbarbox: + self._add_separator(toolbar) + self.load_ta_project = self._add_button( + 'load-from-journal', _('Import project from the Journal'), + self.do_load_ta_project_cb, toolbar) + self.load_python = self._add_button( + 'pippy-openoff', _('Load Python block'), self.do_load_python_cb, + toolbar) + if not self.has_toolbarbox: + self.samples_button = self._add_button( + 'ta-open', _('Load example'), self.do_samples_cb, toolbar) + def _make_palette_buttons(self, toolbar, palette_button=False): ''' Creates the palette and block buttons for both toolbar types''' if palette_button: # old-style toolbars need this button @@ -802,12 +811,15 @@ class TurtleArtActivity(activity.Activity): toolitem.show() return label - def _add_separator(self, toolbar, expand=False): + def _add_separator(self, toolbar, expand=False, visible=True): ''' Add a separator to a toolbar. ''' separator = gtk.SeparatorToolItem() - separator.props.draw = True + separator.props.draw = visible separator.set_expand(expand) - toolbar.insert(separator, -1) + if hasattr(toolbar, 'insert'): + toolbar.insert(separator, -1) + else: + toolbar.props.page.insert(separator, -1) separator.show() def _add_button(self, name, tooltip, callback, toolbar, accelerator=None, @@ -833,3 +845,22 @@ class TurtleArtActivity(activity.Activity): if not name in help_strings: help_strings[name] = tooltip return button + + def _radio_button_factory(self, button_name, toolbar, cb, arg, tooltip, + group): + ''' Add a radio button to a toolbar ''' + button = RadioToolButton(group=group) + button.set_named_icon(button_name) + if cb is not None: + if arg is None: + button.connect('clicked', cb) + else: + button.connect('clicked', cb, arg) + if hasattr(toolbar, 'insert'): # Add button to the main toolbar... + toolbar.insert(button, -1) + else: # ...or a secondary toolbar. + toolbar.props.page.insert(button, -1) + button.show() + if tooltip is not None: + button.set_tooltip(tooltip) + return button diff --git a/activity/activity.info b/activity/activity.info index 640e489..bd38e7c 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,6 +1,6 @@ [Activity] name = Turtle Art -activity_version = 113 +activity_version = 114 license = MIT bundle_id = org.laptop.TurtleArtActivity exec = sugar-activity TurtleArtActivity.TurtleArtActivity diff --git a/icons/blocksoff.svg b/icons/blocksoff.svg index e7db290..63efb3c 100644 --- a/icons/blocksoff.svg +++ b/icons/blocksoff.svg @@ -25,13 +25,6 @@ - - image/svg+xml + id="svg2" + xml:space="preserve" + inkscape:version="0.48.1 r9760" + sodipodi:docname="filesaveoff.svg">image/svg+xml + + + + + + + + + + + + + @@ -28,46 +64,138 @@ - - + + + + + + + + + + + + + + + + style="fill:none;stroke:#ffffff;stroke-opacity:1" + id="g4310"> + inkscape:connector-curvature="0" + style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" + id="path4312" + d="m 6.736,49.002 h 24.52 c 2.225,0 3.439,-1.447 3.439,-3.441 v -27.28 c 0,-1.73 -1.732,-3.441 -3.439,-3.441 h -4.389" /> + style="fill:none;stroke:#ffffff;stroke-opacity:1" + id="g4314" + transform="translate(-80.093659,12.220029)"> + style="fill:none;stroke:#ffffff;stroke-opacity:1" + id="g4316"> + inkscape:connector-curvature="0" + style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" + id="path4318" + d="m 26.867,38.592 c 0,1.836 -1.345,3.201 -3.441,4.047 L 6.736,49.002 V 14.84 l 16.69,-8.599 c 2.228,-0.394 3.441,0.84 3.441,2.834 v 29.517 z" /> - \ No newline at end of file + inkscape:connector-curvature="0" + style="fill:none;stroke:#ffffff;stroke-width:2.25;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" + id="path4320" + d="m -70.669659,54.827029 c 0,0 -1.351,-0.543 -2.702,-0.543 -1.351,0 -2.703,0.543 -2.703,0.543" /> \ No newline at end of file diff --git a/icons/flowoff.svg b/icons/flowoff.svg index eba738e..13b11c5 100644 --- a/icons/flowoff.svg +++ b/icons/flowoff.svg @@ -10,13 +10,6 @@ id="svg2"> - - + id="svg2" > + style="fill:#FFFFFF" /> + style="fill:#282828;stroke:#282828;stroke-width:0.25;stroke-miterlimit:4;" /> diff --git a/icons/htmloff.svg b/icons/htmloff.svg index d6f83c6..92f1fd2 100644 --- a/icons/htmloff.svg +++ b/icons/htmloff.svg @@ -1,23 +1,128 @@ - - -]> - - - - - - - - - - - - - - - - - - - + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/htmlon.svg b/icons/htmlon.svg index c4e50b8..fe8fa71 100644 --- a/icons/htmlon.svg +++ b/icons/htmlon.svg @@ -2,69 +2,127 @@ image/svg+xml - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/image-saveoff.svg b/icons/image-saveoff.svg index b1b485f..365f578 100644 --- a/icons/image-saveoff.svg +++ b/icons/image-saveoff.svg @@ -1,16 +1,116 @@ - - -]> - - - - - - - - - - - - + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/image-saveon.svg b/icons/image-saveon.svg index b4e9270..71a91ff 100644 --- a/icons/image-saveon.svg +++ b/icons/image-saveon.svg @@ -2,46 +2,115 @@ + xml:space="preserve">image/svg+xml + + + + + + + + + + - - - - - - - - + + + + + + + + \ No newline at end of file + transform="matrix(1.1623273,0,0,1.1623273,-14.520241,-13.061294)" + id="circle3892" + style="fill:#00ff00;fill-opacity:1;stroke:#00ff00;stroke-opacity:1;display:inline" /> \ No newline at end of file diff --git a/icons/load-from-journal.svg b/icons/load-from-journal.svg index f30a6f1..d0869da 100644 --- a/icons/load-from-journal.svg +++ b/icons/load-from-journal.svg @@ -2,83 +2,157 @@ + xml:space="preserve">image/svg+xml + + + + + + + + + + + + + + + + + + + + + - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/logo-saveoff.svg b/icons/logo-saveoff.svg index 0c3dfe2..0954a62 100644 --- a/icons/logo-saveoff.svg +++ b/icons/logo-saveoff.svg @@ -2,14 +2,20 @@ image/svg+xml @@ -23,74 +29,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - \ No newline at end of file + transform="matrix(0.75578519,0,0,0.75578519,-4.9396196,-1.2911009)" + id="clipping-text" + style="fill:none;stroke:#ffffff;stroke-opacity:1;display:block"> + + + + + + + + + + \ No newline at end of file diff --git a/icons/logo-saveon.svg b/icons/logo-saveon.svg index 9c9ae52..f2bfc31 100644 --- a/icons/logo-saveon.svg +++ b/icons/logo-saveon.svg @@ -2,14 +2,20 @@ image/svg+xml @@ -24,74 +30,117 @@ - + + + + + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/numbersoff.svg b/icons/numbersoff.svg index 1ce67c7..cffabf7 100644 --- a/icons/numbersoff.svg +++ b/icons/numbersoff.svg @@ -10,13 +10,6 @@ id="svg2"> - - image/svg+xml + width="55" + height="55" + viewBox="0 0 54.999998 55.000001" + id="Icon" + xml:space="preserve" + style="overflow:visible">image/svg+xml + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + transform="matrix(-0.469241,0.469241,-0.469241,-0.469241,66.2906,1019.03)" /> \ No newline at end of file diff --git a/icons/pippy-openon.svg b/icons/pippy-openon.svg index 888fe0c..a3bc335 100644 --- a/icons/pippy-openon.svg +++ b/icons/pippy-openon.svg @@ -9,35 +9,62 @@ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" - width="45" - height="45" - viewBox="0 0 45 45" - id="svg2" - xml:space="preserve">image/svg+xml + width="55" + height="55" + viewBox="0 0 54.999998 55.000001" + id="Icon" + xml:space="preserve" + style="overflow:visible">image/svg+xml + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file + transform="matrix(-0.469241,0.469241,-0.469241,-0.469241,66.2906,1019.03)" /> \ No newline at end of file diff --git a/icons/run-slowoff.svg b/icons/run-slowoff.svg index ac1fef5..72b9734 100644 --- a/icons/run-slowoff.svg +++ b/icons/run-slowoff.svg @@ -2,6 +2,9 @@ + xml:space="preserve">image/svg+xml -` +` + style="fill:#a0ffa0;fill-opacity:1;stroke:#00c000;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> \ No newline at end of file diff --git a/icons/run-slowon.svg b/icons/run-slowon.svg index 1a0883b..5ea8990 100644 --- a/icons/run-slowon.svg +++ b/icons/run-slowon.svg @@ -2,6 +2,9 @@ image/svg+xml \ No newline at end of file + style="fill:#ffffff;fill-opacity:1;stroke:none" /> \ No newline at end of file diff --git a/icons/ta-open.svg b/icons/ta-open.svg index af3fc35..d7677e0 100644 --- a/icons/ta-open.svg +++ b/icons/ta-open.svg @@ -8,39 +8,176 @@ xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" - width="45" - height="45" - viewBox="0 0 44.999998 45.000001" + width="55" + height="55" + viewBox="0 0 54.999998 55.000001" id="Icon" xml:space="preserve" style="overflow:visible">image/svg+xml + id="defs24"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - \ No newline at end of file + transform="translate(2,-2)" + id="g3829"> + + + + + + + + + + + + + + \ No newline at end of file diff --git a/icons/trashoff.svg b/icons/trashoff.svg index c444807..8ebfb39 100644 --- a/icons/trashoff.svg +++ b/icons/trashoff.svg @@ -10,13 +10,6 @@ id="svg2"> - + + + + image/svg+xml + + + + + - + style="fill:#ffffff;fill-opacity:1;stroke:none"> + style="fill:#ffffff;fill-opacity:1;stroke:none" /> + style="fill:#ffffff;fill-opacity:1;stroke:none" /> + style="fill:#ffffff;fill-opacity:1;stroke:none" /> + style="fill:#ffffff;fill-opacity:1;stroke:none" /> + style="fill:#ffffff;fill-opacity:1;stroke:none" /> + style="fill:#ffffff;fill-opacity:1;stroke:none" /> diff --git a/icons/turtleon.svg b/icons/turtleon.svg index bd19cff..4d955de 100644 --- a/icons/turtleon.svg +++ b/icons/turtleon.svg @@ -2,12 +2,27 @@ + + + + image/svg+xml + + + + + + id="g3854"> + style="fill:none;stroke:#00ff00;stroke-width:1.20000005;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.20000005;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + style="fill:#00ff00;fill-opacity:1;stroke:none"> + style="fill:#00ff00;fill-opacity:1;stroke:none" /> + style="fill:#00ff00;fill-opacity:1;stroke:none" /> + style="fill:#00ff00;fill-opacity:1;stroke:none" /> + style="fill:#00ff00;fill-opacity:1;stroke:none" /> + style="fill:#00ff00;fill-opacity:1;stroke:none" /> + style="fill:#00ff00;fill-opacity:1;stroke:none" /> diff --git a/plugins/accelerometer/__init__.py b/plugins/accelerometer/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/accelerometer/__init__.py diff --git a/plugins/accelerometer/accelerometer.py b/plugins/accelerometer/accelerometer.py new file mode 100644 index 0000000..615b253 --- /dev/null +++ b/plugins/accelerometer/accelerometer.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +#Copyright (c) 2011 Walter Bender +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os + +from gettext import gettext as _ + +from plugins.plugin import Plugin + +from TurtleArt.tapalette import make_palette +from TurtleArt.talogo import primitive_dictionary +from TurtleArt.tautils import debug_output + +import logging +_logger = logging.getLogger('turtleart-activity accelerometer plugin') + + +ACCELEROMETER_DEVICE = '/sys/devices/platform/lis3lv02d/position' + + +class Accelerometer(Plugin): + + def __init__(self, parent): + self._parent = parent + if os.path.exists(ACCELEROMETER_DEVICE): + self._status = True + else: + self._status = False + self.running_sugar = self._parent.running_sugar + + def setup(self): + # set up accelerometer specific blocks + palette = make_palette('sensor', + colors=["#FF6060", "#A06060"], + help_string=_('Palette of sensor blocks')) + + primitive_dictionary['xyz'] = self.prim_xyz + if self._status: + palette.add_block('xyz', + style='basic-style-extended-vertical', + label=_('acceleration'), + help_string=\ + _('push accereration in x, y, z to heap'), + prim_name='xyz') + else: + palette.add_block('xyz', + style='basic-style-extended-vertical', + label=_('acceleration'), + help_string=\ + _('push accereration in x, y, z to heap'), + hidden=True, + prim_name='xyz') + + self._parent.lc.def_prim( + 'xyz', 0, lambda self: primitive_dictionary['xyz']()) + + def _status_report(self): + debug_output('Reporting accelerator status: %s' % (str(self._status))) + return self._status + + # Block primitives used in talogo + + def prim_xyz(self): + ''' push accelerometer xyz to stack ''' + if not self._status: + self._parent.lc.heap.append(0) + self._parent.lc.heap.append(0) + self._parent.lc.heap.append(0) + else: + fh = open(ACCELEROMETER_DEVICE) + string = fh.read() + xyz = string[1:-2].split(',') + self._parent.lc.heap.append(float(xyz[2]) / 18) + self._parent.lc.heap.append(float(xyz[1]) / 18) + self._parent.lc.heap.append(float(xyz[0]) / 18) + fh.close() diff --git a/plugins/accelerometer/icons/sensoroff.svg b/plugins/accelerometer/icons/sensoroff.svg new file mode 100644 index 0000000..2d56090 --- /dev/null +++ b/plugins/accelerometer/icons/sensoroff.svg @@ -0,0 +1,36 @@ + + + +image/svg+xml + + + + + + \ No newline at end of file diff --git a/plugins/accelerometer/icons/sensoron.svg b/plugins/accelerometer/icons/sensoron.svg new file mode 100644 index 0000000..e902656 --- /dev/null +++ b/plugins/accelerometer/icons/sensoron.svg @@ -0,0 +1,41 @@ + + + +image/svg+xml + + + + + \ No newline at end of file diff --git a/plugins/audio_sensors/audio_sensors.py b/plugins/audio_sensors/audio_sensors.py index 22298a0..bf28776 100644 --- a/plugins/audio_sensors/audio_sensors.py +++ b/plugins/audio_sensors/audio_sensors.py @@ -32,7 +32,7 @@ from plugins.audio_sensors.audiograb import AudioGrab_Unknown, AudioGrab_XO1, \ from plugins.audio_sensors.ringbuffer import RingBuffer1d from TurtleArt.tapalette import make_palette -from TurtleArt.taconstants import XO1, XO15 +from TurtleArt.taconstants import XO1, XO15, XO175 from TurtleArt.talogo import primitive_dictionary from TurtleArt.tautils import debug_output @@ -132,6 +132,7 @@ class Audio_sensors(Plugin): primitive_dictionary['resistance'] = self.prim_resistance primitive_dictionary['voltage'] = self.prim_voltage + # FIXME: XO175 drivers don't work yet if self.hw in [XO1, XO15] and self._status: if self.hw == XO1: self.voltage_gain = 0.00002225 diff --git a/plugins/audio_sensors/icons/sensoroff.svg b/plugins/audio_sensors/icons/sensoroff.svg index ec55f03..2d56090 100644 --- a/plugins/audio_sensors/icons/sensoroff.svg +++ b/plugins/audio_sensors/icons/sensoroff.svg @@ -16,13 +16,8 @@ id="metadata15">image/svg+xml + diff --git a/plugins/camera_sensor/camera_sensor.py b/plugins/camera_sensor/camera_sensor.py index 7228b8b..5bd21ee 100644 --- a/plugins/camera_sensor/camera_sensor.py +++ b/plugins/camera_sensor/camera_sensor.py @@ -39,6 +39,7 @@ class Camera_sensor(Plugin): def __init__(self, parent): self._parent = parent self._status = False + self._camera = None v4l2src = gst.element_factory_make('v4l2src') if v4l2src.props.device_name is not None: @@ -49,7 +50,6 @@ class Camera_sensor(Plugin): else: self._imagepath = '/tmp/turtlepic.png' - self._camera = None self._status = True def setup(self): @@ -97,7 +97,8 @@ is pushed to the stack'), hidden=True, style='box-style', label=_('brightness'), - help_string=_('light level detected by camera'), + help_string=\ + _('light level detected by camera'), value_block=True, prim_name='read_camera') self._parent.lc.def_prim('luminance', 0, @@ -133,7 +134,7 @@ is pushed to the stack'), ''' Initialize the camera if there is an camera block in use ''' if len(self._parent.block_list.get_similar_blocks('block', ['camera', 'read_camera', 'luminance'])) > 0: - if self._camera is None: + if self._status and self._camera is None: self._camera = Camera(self._imagepath) def stop(self): diff --git a/plugins/camera_sensor/icons/sensoroff.svg b/plugins/camera_sensor/icons/sensoroff.svg index ec55f03..2d56090 100644 --- a/plugins/camera_sensor/icons/sensoroff.svg +++ b/plugins/camera_sensor/icons/sensoroff.svg @@ -16,13 +16,8 @@ id="metadata15">image/svg+xml + diff --git a/plugins/light_sensor/__init__.py b/plugins/light_sensor/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/plugins/light_sensor/__init__.py diff --git a/plugins/light_sensor/icons/sensoroff.svg b/plugins/light_sensor/icons/sensoroff.svg new file mode 100644 index 0000000..2d56090 --- /dev/null +++ b/plugins/light_sensor/icons/sensoroff.svg @@ -0,0 +1,36 @@ + + + +image/svg+xml + + + + + + \ No newline at end of file diff --git a/plugins/light_sensor/icons/sensoron.svg b/plugins/light_sensor/icons/sensoron.svg new file mode 100644 index 0000000..e902656 --- /dev/null +++ b/plugins/light_sensor/icons/sensoron.svg @@ -0,0 +1,41 @@ + + + +image/svg+xml + + + + + \ No newline at end of file diff --git a/plugins/light_sensor/light_sensor.py b/plugins/light_sensor/light_sensor.py new file mode 100644 index 0000000..bf07f95 --- /dev/null +++ b/plugins/light_sensor/light_sensor.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +#Copyright (c) 2011 Walter Bender +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os + +from gettext import gettext as _ + +from plugins.plugin import Plugin + +from TurtleArt.tapalette import make_palette +from TurtleArt.talogo import primitive_dictionary +from TurtleArt.tautils import debug_output + +import logging +_logger = logging.getLogger('turtleart-activity light-sensor plugin') + + +LIGHT_SENSOR_DEVICE = '/sys/devices/platform/olpc-ols.0/power_state' + + +class Light_sensor(Plugin): + + def __init__(self, parent): + self._parent = parent + if os.path.exists(LIGHT_SENSOR_DEVICE): + self._status = True + else: + self._status = False + self.running_sugar = self._parent.running_sugar + + def setup(self): + # set up light-sensor specific blocks + palette = make_palette('sensor', + colors=["#FF6060", "#A06060"], + help_string=_('Palette of sensor blocks')) + + primitive_dictionary['lightsensor'] = self.prim_lightsensor + if self._status: + palette.add_block('lightsensor', + style='box-style', + label=_('brightness'), + help_string=\ + _('light level detected by light sensor'), + prim_name='lightsensor') + else: + palette.add_block('lightsensor', + style='box-style', + label=_('brightness'), + help_string=\ + _('light level detected by light sensor'), + hidden=True, + prim_name='lightsensor') + + self._parent.lc.def_prim( + 'lightsensor', 0, + lambda self: primitive_dictionary['lightsensor']()) + + def _status_report(self): + debug_output('Reporting light-sensor status: %s' % (str(self._status))) + return self._status + + # Block primitives used in talogo + + def prim_lightsensor(self): + ''' push accelerometer xyz to stack ''' + if not self._status: + return -1 + else: + fh = open(LIGHT_SENSOR_DEVICE) + string = fh.read() + fh.close() + return float(string) diff --git a/plugins/rfid/icons/sensoroff.svg b/plugins/rfid/icons/sensoroff.svg index ec55f03..2d56090 100644 --- a/plugins/rfid/icons/sensoroff.svg +++ b/plugins/rfid/icons/sensoroff.svg @@ -16,13 +16,8 @@ id="metadata15">image/svg+xml + diff --git a/plugins/turtle_blocks_extras/icons/extrasoff.svg b/plugins/turtle_blocks_extras/icons/extrasoff.svg index 7975a9d..e944152 100644 --- a/plugins/turtle_blocks_extras/icons/extrasoff.svg +++ b/plugins/turtle_blocks_extras/icons/extrasoff.svg @@ -25,13 +25,6 @@ - diff --git a/plugins/turtle_blocks_extras/icons/mediaoff.svg b/plugins/turtle_blocks_extras/icons/mediaoff.svg index b2f460a..69fdda8 100644 --- a/plugins/turtle_blocks_extras/icons/mediaoff.svg +++ b/plugins/turtle_blocks_extras/icons/mediaoff.svg @@ -9,13 +9,6 @@ width="55" height="55" id="svg2"> - ` diff --git a/plugins/turtle_blocks_extras/icons/portfoliooff.svg b/plugins/turtle_blocks_extras/icons/portfoliooff.svg index d404bab..9f9ad44 100644 --- a/plugins/turtle_blocks_extras/icons/portfoliooff.svg +++ b/plugins/turtle_blocks_extras/icons/portfoliooff.svg @@ -24,15 +24,6 @@ - - - ` diff --git a/plugins/turtle_blocks_extras/icons/sensoroff.svg b/plugins/turtle_blocks_extras/icons/sensoroff.svg index ec55f03..2d56090 100644 --- a/plugins/turtle_blocks_extras/icons/sensoroff.svg +++ b/plugins/turtle_blocks_extras/icons/sensoroff.svg @@ -16,13 +16,8 @@ id="metadata15">image/svg+xml + diff --git a/po/TurtleArt.pot b/po/TurtleArt.pot index 3bd2f64..7de2ffa 100644 --- a/po/TurtleArt.pot +++ b/po/TurtleArt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-03 10:07-0400\n" +"POT-Creation-Date: 2011-08-28 17:46-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: activity/activity.info:2 turtleart.py:272 pysamples/grecord.py:205 -#: TurtleArt/tawindow.py:1560 TurtleArt/tawindow.py:2785 +#: TurtleArt/tawindow.py:1568 TurtleArt/tawindow.py:2793 #: TurtleArt/taexporthtml.py:127 TurtleArt/taexporthtml.py:129 msgid "Turtle Art" msgstr "" @@ -56,15 +56,15 @@ msgstr "" msgid "Save as" msgstr "" -#: turtleart.py:308 TurtleArtActivity.py:538 +#: turtleart.py:308 TurtleArtActivity.py:604 msgid "Save as image" msgstr "" -#: turtleart.py:310 TurtleArtActivity.py:532 +#: turtleart.py:310 TurtleArtActivity.py:607 msgid "Save as HTML" msgstr "" -#: turtleart.py:312 TurtleArtActivity.py:535 +#: turtleart.py:312 TurtleArtActivity.py:609 msgid "Save as Logo" msgstr "" @@ -76,11 +76,11 @@ msgstr "" msgid "File" msgstr "" -#: turtleart.py:318 TurtleArtActivity.py:557 +#: turtleart.py:318 TurtleArtActivity.py:539 msgid "Cartesian coordinates" msgstr "" -#: turtleart.py:320 TurtleArtActivity.py:559 +#: turtleart.py:320 TurtleArtActivity.py:541 msgid "Polar coordinates" msgstr "" @@ -88,11 +88,11 @@ msgstr "" msgid "Rescale coordinates" msgstr "" -#: turtleart.py:324 TurtleArtActivity.py:572 +#: turtleart.py:324 TurtleArtActivity.py:554 msgid "Grow blocks" msgstr "" -#: turtleart.py:326 TurtleArtActivity.py:575 +#: turtleart.py:326 TurtleArtActivity.py:556 msgid "Shrink blocks" msgstr "" @@ -100,27 +100,27 @@ msgstr "" msgid "Reset block size" msgstr "" -#: turtleart.py:330 TurtleArtActivity.py:463 TurtleArtActivity.py:510 +#: turtleart.py:330 TurtleArtActivity.py:469 TurtleArtActivity.py:518 msgid "View" msgstr "" -#: turtleart.py:333 TurtleArtActivity.py:550 +#: turtleart.py:333 TurtleArtActivity.py:533 msgid "Copy" msgstr "" -#: turtleart.py:334 TurtleArtActivity.py:552 +#: turtleart.py:334 TurtleArtActivity.py:535 msgid "Paste" msgstr "" -#: turtleart.py:335 TurtleArtActivity.py:459 TurtleArtActivity.py:513 +#: turtleart.py:335 TurtleArtActivity.py:465 TurtleArtActivity.py:520 msgid "Edit" msgstr "" -#: turtleart.py:338 TurtleArtActivity.py:238 +#: turtleart.py:338 TurtleArtActivity.py:244 msgid "Show palette" msgstr "" -#: turtleart.py:340 TurtleArtActivity.py:244 TurtleArtActivity.py:620 +#: turtleart.py:340 TurtleArtActivity.py:250 TurtleArtActivity.py:629 msgid "Hide palette" msgstr "" @@ -132,19 +132,19 @@ msgstr "" msgid "Tools" msgstr "" -#: turtleart.py:347 TurtleArtActivity.py:629 +#: turtleart.py:347 TurtleArtActivity.py:638 msgid "Clean" msgstr "" -#: turtleart.py:348 TurtleArtActivity.py:631 +#: turtleart.py:348 TurtleArtActivity.py:640 msgid "Run" msgstr "" -#: turtleart.py:349 TurtleArtActivity.py:633 +#: turtleart.py:349 TurtleArtActivity.py:642 msgid "Step" msgstr "" -#: turtleart.py:350 TurtleArtActivity.py:635 +#: turtleart.py:350 TurtleArtActivity.py:644 msgid "Debug" msgstr "" @@ -164,117 +164,499 @@ msgstr "" msgid "Save project?" msgstr "" -#: TurtleArtActivity.py:120 +#: TurtleArtActivity.py:125 msgid "presentation" msgstr "" -#: TurtleArtActivity.py:191 +#: TurtleArtActivity.py:196 msgid "snapshot" msgstr "" -#: TurtleArtActivity.py:251 TurtleArtActivity.py:264 +#: TurtleArtActivity.py:257 TurtleArtActivity.py:270 msgid "Show blocks" msgstr "" -#: TurtleArtActivity.py:254 TurtleArtActivity.py:272 TurtleArtActivity.py:623 +#: TurtleArtActivity.py:260 TurtleArtActivity.py:278 TurtleArtActivity.py:632 msgid "Hide blocks" msgstr "" -#: TurtleArtActivity.py:392 +#: TurtleArtActivity.py:398 msgid "Rescale coordinates down" msgstr "" -#: TurtleArtActivity.py:396 TurtleArtActivity.py:569 +#: TurtleArtActivity.py:402 TurtleArtActivity.py:551 msgid "Rescale coordinates up" msgstr "" -#: TurtleArtActivity.py:470 TurtleArtActivity.py:519 +#: TurtleArtActivity.py:476 TurtleArtActivity.py:524 msgid "Help" msgstr "" -#: TurtleArtActivity.py:507 -msgid "Project" +#: TurtleArtActivity.py:497 TurtleArtActivity.py:623 +msgid "Load example" msgstr "" #: TurtleArtActivity.py:516 -msgid "Import/Export" -msgstr "" - -#: TurtleArtActivity.py:529 -msgid "Save snapshot" -msgstr "" - -#: TurtleArtActivity.py:541 -msgid "Import project from the Journal" -msgstr "" - -#: TurtleArtActivity.py:545 -msgid "Load Python block" +msgid "Project" msgstr "" -#: TurtleArtActivity.py:548 -msgid "Load example" +#: TurtleArtActivity.py:522 +msgid "Import/Export" msgstr "" -#: TurtleArtActivity.py:554 +#: TurtleArtActivity.py:537 msgid "Fullscreen" msgstr "" -#: TurtleArtActivity.py:562 +#: TurtleArtActivity.py:544 msgid "Metric coordinates" msgstr "" -#: TurtleArtActivity.py:565 TurtleArt/tawindow.py:2781 -#: TurtleArt/tawindow.py:2785 TurtleArt/tabasics.py:216 +#: TurtleArtActivity.py:547 TurtleArt/tawindow.py:2789 +#: TurtleArt/tawindow.py:2793 TurtleArt/tabasics.py:216 msgid "xcor" msgstr "" -#: TurtleArtActivity.py:566 TurtleArt/tawindow.py:2781 -#: TurtleArt/tawindow.py:2785 TurtleArt/tabasics.py:227 +#: TurtleArtActivity.py:548 TurtleArt/tawindow.py:2789 +#: TurtleArt/tawindow.py:2793 TurtleArt/tabasics.py:227 msgid "ycor" msgstr "" -#: TurtleArtActivity.py:566 TurtleArt/tawindow.py:2781 -#: TurtleArt/tawindow.py:2785 TurtleArt/tabasics.py:238 +#: TurtleArtActivity.py:548 TurtleArt/tawindow.py:2789 +#: TurtleArt/tawindow.py:2793 TurtleArt/tabasics.py:238 msgid "heading" msgstr "" -#: TurtleArtActivity.py:579 TurtleArtActivity.py:583 +#: TurtleArtActivity.py:574 TurtleArtActivity.py:578 msgid "Move the cursor over the orange palette for help." msgstr "" -#: TurtleArtActivity.py:621 +#: TurtleArtActivity.py:612 +msgid "Save snapshot" +msgstr "" + +#: TurtleArtActivity.py:616 +msgid "Import project from the Journal" +msgstr "" + +#: TurtleArtActivity.py:619 +msgid "Load Python block" +msgstr "" + +#: TurtleArtActivity.py:630 msgid "p" msgstr "" -#: TurtleArtActivity.py:624 +#: TurtleArtActivity.py:633 msgid "b" msgstr "" -#: TurtleArtActivity.py:629 +#: TurtleArtActivity.py:638 msgid "e" msgstr "" -#: TurtleArtActivity.py:631 +#: TurtleArtActivity.py:640 msgid "r" msgstr "" -#: TurtleArtActivity.py:633 +#: TurtleArtActivity.py:642 msgid "w" msgstr "" -#: TurtleArtActivity.py:635 +#: TurtleArtActivity.py:644 msgid "d" msgstr "" -#: TurtleArtActivity.py:637 +#: TurtleArtActivity.py:646 msgid "Stop turtle" msgstr "" -#: TurtleArtActivity.py:638 +#: TurtleArtActivity.py:647 msgid "s" msgstr "" +#: taextras.py:36 +msgid "Turtle Art Mini" +msgstr "" + +#: taextras.py:40 +msgid "Turtle Confusion" +msgstr "" + +#: taextras.py:41 +msgid "Select a challenge" +msgstr "" + +#: taextras.py:47 +msgid "Palette of Mexican pesos" +msgstr "" + +#: taextras.py:48 +msgid "Palette of Colombian pesos" +msgstr "" + +#: taextras.py:49 +msgid "Palette of Rwandan francs" +msgstr "" + +#: taextras.py:50 +msgid "Palette of US currencies" +msgstr "" + +#: taextras.py:51 +msgid "Palette of Australian currencies" +msgstr "" + +#: taextras.py:52 +msgid "Palette of Guaranies" +msgstr "" + +#. TRANS: Butia is the Arduino Robot Project from Uruguay +#. (http://www.fing.edu.uy/inco/proyectos/butia/) +#: taextras.py:58 +msgid "Turtle Art Butia" +msgstr "" + +#: taextras.py:59 +msgid "Adjust LED intensity between 0 and 255." +msgstr "" + +#: taextras.py:60 +msgid "" +"Returns the object gray level encountered him as a number between 0 and 1023." +msgstr "" + +#: taextras.py:62 +msgid "Returns 1 when the button is press and 0 otherwise." +msgstr "" + +#: taextras.py:63 +msgid "" +"Returns the level of ligth in the ambient as a number between 0 and 1023." +msgstr "" + +#: taextras.py:65 +msgid "Returns the temperature in the ambient as a number between 0 and 255." +msgstr "" + +#: taextras.py:66 +msgid "" +"Returns the distance from the object in front of the sensor as a number " +"between 0 and 255." +msgstr "" + +#: taextras.py:68 +msgid "Returns 0 or 1 depending on the sensor inclination." +msgstr "" + +#: taextras.py:69 +msgid "Returns 1 when the sensors detects a magnetic field, 0 otherwise." +msgstr "" + +#: taextras.py:70 +msgid "Switchs from 0 to 1, the frecuency depends on the vibration." +msgstr "" + +#: taextras.py:71 +msgid "LED" +msgstr "" + +#: taextras.py:72 +msgid "pushbutton" +msgstr "" + +#: taextras.py:73 +msgid "grayscale" +msgstr "" + +#: taextras.py:74 +msgid "ambient light" +msgstr "" + +#: taextras.py:75 +msgid "temperature" +msgstr "" + +#: taextras.py:76 +msgid "distance" +msgstr "" + +#: taextras.py:77 +msgid "tilt" +msgstr "" + +#: taextras.py:78 +msgid "magnetic induction" +msgstr "" + +#: taextras.py:79 +msgid "vibration" +msgstr "" + +#: taextras.py:80 +msgid "Butia Robot" +msgstr "" + +#: taextras.py:81 +msgid "delay Butia" +msgstr "" + +#: taextras.py:82 +msgid "wait for argument seconds" +msgstr "" + +#: taextras.py:83 +msgid "Butia battery charge" +msgstr "" + +#: taextras.py:84 +msgid "Returns the battery charge as a number between 0 and 255." +msgstr "" + +#: taextras.py:85 +msgid "Butia speed" +msgstr "" + +#: taextras.py:86 +msgid "" +"Set the moving speed of the Butia motors as the value between 0 and 1023, " +"passed by argument." +msgstr "" + +#: taextras.py:88 +msgid "forward Butia" +msgstr "" + +#: taextras.py:89 +msgid "Move the Butia robot forward." +msgstr "" + +#: taextras.py:90 +msgid "forward distance" +msgstr "" + +#: taextras.py:91 +msgid "Move the Butia robot forward a predefined distance." +msgstr "" + +#: taextras.py:92 +msgid "backward Butia" +msgstr "" + +#: taextras.py:93 taextras.py:97 taextras.py:99 taextras.py:103 +msgid "Move the Butia robot backward." +msgstr "" + +#: taextras.py:94 +msgid "backward distance" +msgstr "" + +#: taextras.py:95 +msgid "Move the Butia robot backward a predefined distance." +msgstr "" + +#: taextras.py:96 +msgid "left Butia" +msgstr "" + +#: taextras.py:98 +msgid "right Butia" +msgstr "" + +#: taextras.py:100 +msgid "Turn x degrees" +msgstr "" + +#: taextras.py:101 +msgid "Turn the Butia robot x degrees." +msgstr "" + +#: taextras.py:102 +msgid "stop Butia" +msgstr "" + +#: taextras.py:104 +msgid "print Butia" +msgstr "" + +#: taextras.py:105 +msgid "Print text in Butia robot 32-character ASCII display." +msgstr "" + +#: taextras.py:106 +msgid "Butia" +msgstr "" + +#: taextras.py:110 +msgid "The camera was not found." +msgstr "" + +#: taextras.py:111 +msgid "Error on the init of the camera." +msgstr "" + +#: taextras.py:112 +msgid "FollowMe" +msgstr "" + +#: taextras.py:113 +msgid "follow a RGB color" +msgstr "" + +#: taextras.py:114 +msgid "follow a turtle color" +msgstr "" + +#: taextras.py:115 +msgid "calibrate a color to follow" +msgstr "" + +#: taextras.py:116 +msgid "x position" +msgstr "" + +#: taextras.py:117 +msgid "return x position" +msgstr "" + +#: taextras.py:118 +msgid "y position" +msgstr "" + +#: taextras.py:119 +msgid "return y position" +msgstr "" + +#: taextras.py:123 +msgid "Sumo Butia" +msgstr "" + +#: taextras.py:124 +msgid "submit speed​​" +msgstr "" + +#: taextras.py:125 +msgid "Send speeds the robot." +msgstr "" + +#: taextras.py:126 +msgid "set speed" +msgstr "" + +#: taextras.py:127 +msgid "Set the default speed for the movement commands." +msgstr "" + +#: taextras.py:128 +msgid "move" +msgstr "" + +#: taextras.py:129 TurtleArt/tabasics.py:131 +msgid "back" +msgstr "" + +#: taextras.py:130 pysamples/grecord.py:215 +msgid "stop" +msgstr "" + +#: taextras.py:131 +msgid "turn left" +msgstr "" + +#: taextras.py:132 +msgid "turn right" +msgstr "" + +#: taextras.py:133 +msgid "angle to center" +msgstr "" + +#. TRANS: dojo is the playing field +#: taextras.py:135 +msgid "Get the angle to the center of the dojo." +msgstr "" + +#: taextras.py:136 +msgid "angle to the opponent" +msgstr "" + +#: taextras.py:137 +msgid "Get the angle to the center of the opponent." +msgstr "" + +#: taextras.py:138 +msgid "x coor." +msgstr "" + +#: taextras.py:139 +msgid "Get the x coordinate of the robot." +msgstr "" + +#: taextras.py:140 +msgid "y coor." +msgstr "" + +#: taextras.py:141 +msgid "Get the y coordinate of the robot." +msgstr "" + +#: taextras.py:142 +msgid "opponent x coor." +msgstr "" + +#: taextras.py:143 +msgid "Get the x coordinate of the opponent." +msgstr "" + +#: taextras.py:144 +msgid "opponent y coor." +msgstr "" + +#: taextras.py:145 +msgid "Get the y coordinate of the opponent." +msgstr "" + +#: taextras.py:146 +msgid "rotation" +msgstr "" + +#: taextras.py:147 +msgid "Get SumBot rotation." +msgstr "" + +#: taextras.py:148 +msgid "opponent rotation" +msgstr "" + +#: taextras.py:149 +msgid "Get the rotation of the opponent." +msgstr "" + +#: taextras.py:150 +msgid "distance to center" +msgstr "" + +#. TRANS: dojo is the playing field +#: taextras.py:152 +msgid "Get the distance to the center of the dojo." +msgstr "" + +#: taextras.py:153 +msgid "distance to opponent" +msgstr "" + +#: taextras.py:154 +msgid "Get the distance to the opponent." +msgstr "" + +#: taextras.py:155 +msgid "update information" +msgstr "" + +#: taextras.py:156 +msgid "Update information from the server." +msgstr "" + #: pysamples/grecord.py:205 plugins/audio_sensors/audio_sensors.py:82 #: plugins/audio_sensors/audio_sensors.py:97 msgid "sound" @@ -284,10 +666,6 @@ msgstr "" msgid "start" msgstr "" -#: pysamples/grecord.py:215 -msgid "stop" -msgstr "" - #: pysamples/grecord.py:217 msgid "play" msgstr "" @@ -408,29 +786,33 @@ msgstr "" #: plugins/camera_sensor/camera_sensor.py:58 plugins/rfid/rfid.py:86 #: plugins/turtle_blocks_extras/turtle_blocks_extras.py:269 +#: plugins/light_sensor/light_sensor.py:49 #: plugins/audio_sensors/audio_sensors.py:75 +#: plugins/accelerometer/accelerometer.py:49 msgid "Palette of sensor blocks" msgstr "" #: plugins/camera_sensor/camera_sensor.py:69 #: plugins/camera_sensor/camera_sensor.py:81 #: plugins/camera_sensor/camera_sensor.py:99 -#: plugins/camera_sensor/camera_sensor.py:111 +#: plugins/camera_sensor/camera_sensor.py:112 +#: plugins/light_sensor/light_sensor.py:55 +#: plugins/light_sensor/light_sensor.py:62 msgid "brightness" msgstr "" #: plugins/camera_sensor/camera_sensor.py:70 -#: plugins/camera_sensor/camera_sensor.py:100 +#: plugins/camera_sensor/camera_sensor.py:101 msgid "light level detected by camera" msgstr "" #: plugins/camera_sensor/camera_sensor.py:82 -#: plugins/camera_sensor/camera_sensor.py:112 +#: plugins/camera_sensor/camera_sensor.py:113 msgid "Average RGB color from camera is pushed to the stack" msgstr "" #: plugins/camera_sensor/camera_sensor.py:93 -#: plugins/camera_sensor/camera_sensor.py:124 +#: plugins/camera_sensor/camera_sensor.py:125 msgid "camera output" msgstr "" @@ -917,9 +1299,9 @@ msgstr "" #: plugins/turtle_blocks_extras/turtle_blocks_extras.py:816 #: plugins/turtle_blocks_extras/turtle_blocks_extras.py:830 #: plugins/turtle_blocks_extras/turtle_blocks_extras.py:844 -#: TurtleArt/taconstants.py:250 TurtleArt/taconstants.py:272 -#: TurtleArt/taconstants.py:293 TurtleArt/taconstants.py:335 -#: TurtleArt/taconstants.py:377 TurtleArt/taconstants.py:419 +#: TurtleArt/taconstants.py:251 TurtleArt/taconstants.py:273 +#: TurtleArt/taconstants.py:294 TurtleArt/taconstants.py:336 +#: TurtleArt/taconstants.py:378 TurtleArt/taconstants.py:420 msgid "Title" msgstr "" @@ -940,6 +1322,11 @@ msgstr "" msgid "presentation 2x2" msgstr "" +#: plugins/light_sensor/light_sensor.py:57 +#: plugins/light_sensor/light_sensor.py:64 +msgid "light level detected by light sensor" +msgstr "" + #: plugins/audio_sensors/audio_sensors.py:83 #: plugins/audio_sensors/audio_sensors.py:98 msgid "raw microphone input signal" @@ -965,26 +1352,36 @@ msgstr "" msgid "microphone input pitch" msgstr "" -#: plugins/audio_sensors/audio_sensors.py:144 -#: plugins/audio_sensors/audio_sensors.py:158 +#: plugins/audio_sensors/audio_sensors.py:145 +#: plugins/audio_sensors/audio_sensors.py:159 msgid "resistance" msgstr "" -#: plugins/audio_sensors/audio_sensors.py:145 -#: plugins/audio_sensors/audio_sensors.py:159 +#: plugins/audio_sensors/audio_sensors.py:146 +#: plugins/audio_sensors/audio_sensors.py:160 msgid "microphone input resistance" msgstr "" -#: plugins/audio_sensors/audio_sensors.py:150 -#: plugins/audio_sensors/audio_sensors.py:165 +#: plugins/audio_sensors/audio_sensors.py:151 +#: plugins/audio_sensors/audio_sensors.py:166 msgid "voltage" msgstr "" -#: plugins/audio_sensors/audio_sensors.py:151 -#: plugins/audio_sensors/audio_sensors.py:166 +#: plugins/audio_sensors/audio_sensors.py:152 +#: plugins/audio_sensors/audio_sensors.py:167 msgid "microphone input voltage" msgstr "" +#: plugins/accelerometer/accelerometer.py:55 +#: plugins/accelerometer/accelerometer.py:62 +msgid "acceleration" +msgstr "" + +#: plugins/accelerometer/accelerometer.py:57 +#: plugins/accelerometer/accelerometer.py:64 +msgid "push accereration in x, y, z to heap" +msgstr "" + #: TurtleArt/tapalette.py:83 msgid "displays next palette" msgstr "" @@ -993,15 +1390,15 @@ msgstr "" msgid "changes the orientation of the palette of blocks" msgstr "" -#: TurtleArt/tawindow.py:743 TurtleArt/tawindow.py:744 +#: TurtleArt/tawindow.py:748 TurtleArt/tawindow.py:749 msgid "orientation" msgstr "" -#: TurtleArt/tawindow.py:754 TurtleArt/tawindow.py:1016 +#: TurtleArt/tawindow.py:759 TurtleArt/tawindow.py:1022 msgid "next" msgstr "" -#: TurtleArt/tawindow.py:2877 +#: TurtleArt/tawindow.py:2885 msgid "image" msgstr "" @@ -1041,10 +1438,6 @@ msgstr "" msgid "moves turtle forward" msgstr "" -#: TurtleArt/tabasics.py:131 -msgid "back" -msgstr "" - #: TurtleArt/tabasics.py:135 msgid "moves turtle backward" msgstr "" diff --git a/taextras.py b/taextras.py new file mode 100644 index 0000000..5513ae2 --- /dev/null +++ b/taextras.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +#Copyright (c) 2011 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 +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +from gettext import gettext as _ + +''' +Note: this file contains string from plugins and related projects that +are not included in the default packaaging of Turtle Art. The reason +for gathering these strings here is to enable us to use one common POT +file across all of these projects. + +TODO: build some automated way of maintaining this file. +''' + +# ACTIVITIES + +TURTLEARTMINI_STRINGS = [ + _('Turtle Art Mini') + ] + +TURTLECONFUSION_STRINGS = [ + _('Turtle Confusion'), + _('Select a challenge') + ] + +# PLUGINS + +CURRENCY_STRINGS = [ + _('Palette of Mexican pesos'), + _('Palette of Colombian pesos'), + _('Palette of Rwandan francs'), + _('Palette of US currencies'), + _('Palette of Australian currencies'), + _('Palette of Guaranies') + ] + +BUTIA_STRINGS = [ + #TRANS: Butia is the Arduino Robot Project from Uruguay + #(http://www.fing.edu.uy/inco/proyectos/butia/) + _('Turtle Art Butia'), + _('Adjust LED intensity between 0 and 255.'), + _('Returns the object gray level encountered him as a number between \ +0 and 1023.'), + _('Returns 1 when the button is press and 0 otherwise.'), + _('Returns the level of ligth in the ambient as a number between \ +0 and 1023.'), + _('Returns the temperature in the ambient as a number between 0 and 255.'), + _('Returns the distance from the object in front of the sensor as a \ +number between 0 and 255.'), + _('Returns 0 or 1 depending on the sensor inclination.'), + _('Returns 1 when the sensors detects a magnetic field, 0 otherwise.'), + _('Switchs from 0 to 1, the frecuency depends on the vibration.'), + _('LED'), + _('pushbutton'), + _('grayscale'), + _('ambient light'), + _('temperature'), + _('distance'), + _('tilt'), + _('magnetic induction'), + _('vibration'), + _('Butia Robot'), + _('delay Butia'), + _('wait for argument seconds'), + _('Butia battery charge'), + _('Returns the battery charge as a number between 0 and 255.'), + _('Butia speed'), + _('Set the moving speed of the Butia motors as the value between \ +0 and 1023, passed by argument.'), + _('forward Butia'), + _('Move the Butia robot forward.'), + _('forward distance'), + _('Move the Butia robot forward a predefined distance.'), + _('backward Butia'), + _('Move the Butia robot backward.'), + _('backward distance'), + _('Move the Butia robot backward a predefined distance.'), + _('left Butia'), + _('Move the Butia robot backward.'), + _('right Butia'), + _('Move the Butia robot backward.'), + _('Turn x degrees'), + _('Turn the Butia robot x degrees.'), + _('stop Butia'), + _('Move the Butia robot backward.'), + _('print Butia'), + _('Print text in Butia robot 32-character ASCII display.'), + _('Butia') + ] + +FOLLOWME_STRINGS = [ + _('The camera was not found.') + _('Error on the init of the camera.') + _('FollowMe')) + _('follow a RGB color'), + _('follow a turtle color'), + _('calibrate a color to follow'), + _('x position'), + _('return x position'), + _('y position'), + _('return y position') + ] + +SUMO_STRINGS = [ + _('Sumo Butia'), + _('submit speed​​'), + _('Send speeds the robot.'), + _('set speed'), + _('Set the default speed for the movement commands.'), + _('move'), + _('back'), + _('stop'), + _('turn left'), + _('turn right'), + _('angle to center'), + #TRANS: dojo is the playing field + _('Get the angle to the center of the dojo.'), + _('angle to the opponent'), + _('Get the angle to the center of the opponent.'), + _('x coor.'), + _('Get the x coordinate of the robot.'), + _('y coor.'), + _('Get the y coordinate of the robot.'), + _('opponent x coor.'), + _('Get the x coordinate of the opponent.'), + _('opponent y coor.'), + _('Get the y coordinate of the opponent.'), + _('rotation'), + _('Get SumBot rotation.'), + _('opponent rotation'), + _('Get the rotation of the opponent.'), + _('distance to center'), + #TRANS: dojo is the playing field + _('Get the distance to the center of the dojo.'), + _('distance to opponent'), + _('Get the distance to the opponent.'), + _('update information'), + _('Update information from the server.') + ] -- cgit v0.9.1