From 98f76c5aca9745cd83a67e7d1d4c725c4929381b Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Mon, 01 Feb 2010 17:05:47 +0000 Subject: more cleaning up, bug chasing --- diff --git a/constants.py b/constants.py index fee8364..e57968f 100644 --- a/constants.py +++ b/constants.py @@ -78,7 +78,6 @@ STANDARD_STROKE_WIDTH = 1.0 PALETTE_SCALE = {'template2x2':1.0, 'template1x2':1.0} - # # block style definitions # @@ -396,7 +395,19 @@ OLD_NAMES = {'product':'product2', 'storeinbox':'storein', 'descriptionoff':'description','template3':'list', 'template1':'template1x1', 'template2':'template2x1', 'template6':'template1x2', 'template7':'template2x2', - 'template8':'template1x1' } + 'template4':'template1x1', 'hres':'width', 'vres':'height' } + +# +# Define the relative size and postion of media objects +# (w, h, x, y, dx, dy) +# +TEMPLATES = {'t1x1': (0.5, 0.5, 0.0625, 0.125, 1.05, 0), + 't2z1': (0.5, 0.5, 0.0625, 0.125, 1.05, 1.05), + 't1x2': (0.45, 0.45, 0.0625, 0.125, 1.05, 1.05), + 't2x2': (0.45, 0.45, 0.0625, 0.125, 1.05, 1.05), + 't1x1a': (0.9, 0.9, 0.0625, 0.125, 0, 0), + 'bullet': (1, 1, 0.0625, 0.125, 0, 0.1), + 'insertimage': (0.333, 0.333)} # # 'dead key' Unicode dictionaries diff --git a/taexporthtml.py b/taexporthtml.py index e753d24..4c7f5d2 100644 --- a/taexporthtml.py +++ b/taexporthtml.py @@ -19,7 +19,6 @@ #THE SOFTWARE. import tawindow -import talogo from sugar.activity import activity from sugar.datastore import datastore import os.path @@ -297,7 +296,7 @@ def walk_stack(self, tw, spr): top = tawindow.find_top_block(spr) if spr == top: # only walk the stack if the block is the top block - return talogo.run_blocks(tw.lc, top, tw.block_list.list, False) + return tw.lc.run_blocks(top, tw.block_list.list, False) else: # not top of stack, then return empty list return [] diff --git a/taexportlogo.py b/taexportlogo.py index 939486c..94e5016 100644 --- a/taexportlogo.py +++ b/taexportlogo.py @@ -19,7 +19,6 @@ #THE SOFTWARE. import tawindow -import talogo import math try: from sugar.datastore import datastore @@ -322,7 +321,7 @@ def walk_stack(self, tw, spr): top = tawindow.find_top_block(spr) if spr == top: # only walk the stack if the block is the top block - code = talogo.run_blocks(tw.lc, top, tw.block_list.list, False) + code = tw.lc.run_blocks(top, tw.block_list.list, False) return code else: # not top of stack, then return empty list diff --git a/talogo.py b/talogo.py index 64f5736..bee7d9c 100644 --- a/talogo.py +++ b/talogo.py @@ -85,7 +85,7 @@ def careful_divide(x,y): except: return 0 -def taequal(self, x,y): +def taequal(x,y): try: return float(x)==float(y) except: @@ -99,7 +99,7 @@ def taequal(self, x,y): yy = y return xx==yy -def taless(self, x, y): +def taless(x, y): try: return float(x)0: if btype == 'audio' or btype == 'description': + print "restoring %s to %s block" % (blk.values[0],blk.name) blk.spr.set_image(tw.media_shapes[btype+'on'], 1, 37, 6) elif tw.running_sugar(): try: diff --git a/tawindow.py b/tawindow.py index dbe1685..d0c1587 100644 --- a/tawindow.py +++ b/tawindow.py @@ -1062,7 +1062,7 @@ class TurtleArtWindow(): blk.spr.set_image(self.media_shapes['audioon'], 1, 37, 6) else: - blk.spr.set_image(self.media_shapes['decsriptionon'], + blk.spr.set_image(self.media_shapes['descriptionon'], 1, 37, 6) blk.values[0] = dsobject.object_id dsobject.destroy() -- cgit v0.9.1