diff options
-rw-r--r-- | block.py | 24 | ||||
-rw-r--r-- | constants.py | 275 | ||||
-rw-r--r-- | images/turtleoff.svg | 84 | ||||
-rw-r--r-- | images/turtleon.svg | 84 | ||||
-rw-r--r-- | tawindow.py | 5 |
5 files changed, 359 insertions, 113 deletions
@@ -221,14 +221,14 @@ class Block: self.svg.set_colors(self.colors) def _make_basic_style(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(e, 0) self._make_basic_block(svg) self.docks = (('flow',True,self.svg.docks[0][0],self.svg.docks[0][1]), ('flow',False,self.svg.docks[1][0],self.svg.docks[1][1])) self._left, self._right = 2, 2 def _make_basic_style_head(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(10+e, 0) self.svg.set_slot(False) self.svg.set_cap(True) self._make_basic_block(svg) @@ -238,7 +238,7 @@ class Block: self._left, self._right = 2, 2 def _make_basic_style_head_1arg(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(10+e, 0) self.svg.set_innie([True]) self.svg.set_slot(False) self.svg.set_cap(True) @@ -248,10 +248,10 @@ class Block: self.svg.docks[0][1]), ('flow', False, self.svg.docks[1][0], self.svg.docks[1][1])) - self._left, self._right = 2, self.svg.get_innie_width() + self._left, self._right = 2, self.svg.get_innie_width()*1.5 def _make_basic_style_tail(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(10+e, 0) self.svg.set_tab(False) self._make_basic_block(svg) self.docks = (('flow', True, self.svg.docks[0][0], @@ -259,7 +259,7 @@ class Block: ('unavailable', False, 0, 0)) def _make_basic_style_1arg(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(10+e, 0) self.svg.set_innie([True]) self._make_basic_block(svg) self.docks = (('flow', True, self.svg.docks[0][0], @@ -268,10 +268,10 @@ class Block: self.svg.docks[1][1]), ('flow', False, self.svg.docks[2][0], self.svg.docks[2][1])) - self._left, self._right = 2, self.svg.get_innie_width() + self._left, self._right = 2, self.svg.get_innie_width()*1.5 def _make_basic_style_2arg(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(10+e, 0) self.svg.set_innie([True,True]) self._make_basic_block(svg) self.docks = (('flow', True, self.svg.docks[0][0], @@ -393,7 +393,7 @@ class Block: self._left = self._right def _make_flow_style(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(e, 0) self.svg.set_slot(True) self._make_basic_flow(svg) self.docks = (('flow', True, self.svg.docks[0][0], @@ -404,7 +404,7 @@ class Block: self._left, self._right = 0, self.svg.get_width()-self.svg.docks[1][0] def _make_flow_style_1arg(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(e, 0) self.svg.set_slot(True) self.svg.set_tab(True) self.svg.set_innie([True]) @@ -422,7 +422,7 @@ class Block: self.svg.get_innie_width()*1.5 def _make_flow_style_boolean(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(e, 0) self.svg.set_slot(True) self.svg.set_tab(True) self.svg.set_boolean(True) @@ -438,7 +438,7 @@ class Block: self._left, self._right = 2, self.svg.get_width()-self.svg.docks[1][0] def _make_flow_style_else(self, e, svg): - self.svg.expand(25+e, 0) + self.svg.expand(e, 0) self.svg.set_slot(True) self.svg.set_tab(True) self.svg.set_else(True) diff --git a/constants.py b/constants.py index 4ce1b14..2f47399 100644 --- a/constants.py +++ b/constants.py @@ -113,46 +113,93 @@ CONTENT_BLOCKS = ['number', 'string', 'media', 'audio', 'journal'] # block name dictionary # -BLOCK_NAMES = {'clean':[_('clean')], 'forward':[_('forward')], - 'back':[_('back')], - 'left':[_('left')], 'right':[_('right')], 'seth':[_('set heading')], - 'show':[_('show')], 'setscale':[_('set scale')], 'xcor':[_('xcor')], - 'ycor':[_('ycor')], 'heading':[_('heading')], 'penup':[_('pen up')], - 'pendown':[_('pen down')], 'setpensize':[_('set pen size')], +BLOCK_NAMES = { + 'and':[_('and')], 'arc':[_('arc'),_('angle'),_('radius')], - 'settextsize':[_('set text size')], 'setcolor':[_('set color')], - 'setshade':[_('set shade')], + 'back':[_('back')], + 'blue':[_('blue')], + 'bottompos':[_('bottom')], + 'box':[_('box')], + 'box1':[_('box 1')], + 'box2':[_('box 2')], + 'clean':[_('clean')], + 'clearheap':[_('empty heap')], + 'color':[_('color')], + 'cyan':[_('cyan')], + 'division2':['/'], + 'equal':['='], 'fillscreen':[_('fill screen'),_('color'),_('shade')], - 'shade':[_('shade')], 'nop':[_('load Python code')], - 'pensize':[_('pen size')], 'textsize':[_('text size')], - 'color':[_('color')], 'ifelse':['', _('if'), _('then else')], - 'plus2':['+'], 'minus2':['–'], 'product2':['×'], 'division2':['/'], - 'remainder2':[_('mod')], 'identity2':['←'], - 'random':[_('random'),_('min'),_('max')], 'sqrt':['√'], - 'less':['<'],'greater':[">"], 'equal':['='], 'and':[_('and')], - 'not':[_('not')], 'print':[_('print')], 'wait':[_('wait')], 'or':[_('or')], - 'forever':[_('forever')], 'repeat':['', _('repeat')], - 'if':['', _('if'), _('then')], - 'stopstack':[_('stop action')], 'hspace':[' '], 'vspace':[' '], - 'start':[_('start')], 'hat1':[_('action 1')], - 'stack1':[_('action 1')], - 'hat2':[_('action 2')], 'stack2':[_('action 2')], - 'hat':[_('action')], 'stack':[_('action')], 'number':['100'], - 'storeinbox1':[_('store in box 1')], 'box1':[_('box 1')], - 'storeinbox2':[_('store in box 2')], 'box2':[_('box 2')], - 'storein':[_('store in')], 'box':[_('box')], 'string':[_('string')], - 'leftpos':[_('left')], 'toppos':[_('top')], 'rightpos':[_('right')], - 'bottompos':[_('bottom')], 'width':[_('width')], 'height':[_('height')], + 'forever':[_('forever')], + 'forward':[_('forward')], + 'green':[_('green')], + 'hat':[_('action')], + 'hat1':[_('action 1')], + 'hat2':[_('action 2')], + 'heading':[_('heading')], + 'height':[_('height')], 'hideblocks':[_('hide blocks')], - 'setxy':[_('set xy'), _('x'), _('y')], - 'scale':[_('scale')], 'keyboard':[_('keyboard')], - 'push':[_('push')], 'pop':[_('pop')], 'kbinput':[_('query keyboard')], - 'myfunc':[_('python'), _('code'), _('value')], - 'printheap':[_('show heap')], 'turtle':[_('turtle')], - 'clearheap':[_('empty heap')], 'restore':[_('restore')], - 'red':[_('red')], 'orange':[_('orange')], 'yellow':[_('yellow')], - 'green':[_('green')], 'cyan':[_('cyan')], 'blue':[_('blue')], - 'purple':[_('purple')]} + 'hspace':[' '], + 'identity2':['←'], + 'if':['',_('if'),_('then')], + 'ifelse':['',_('if'),_('then else')], + 'kbinput':[_('query keyboard')], + 'keyboard':[_('keyboard')], + 'left':[_('left')], + 'leftpos':[_('left')], + 'less':['<'],'greater':[">"], + 'minus2':['–'], + 'myfunc':[_('python'),_('code'),_('value')], + 'nop':[_('load Python code')], + 'not':[_('not')], + 'number':['100'], + 'orange':[_('orange')], + 'or':[_('or')], + 'pendown':[_('pen down')], + 'pensize':[_('pen size')], + 'penup':[_('pen up')], + 'plus2':['+'], + 'pop':[_('pop')], + 'printheap':[_('show heap')], + 'print':[_('print')], + 'product2':['×'], + 'purple':[_('purple')], + 'push':[_('push')], + 'random':[_('random'),_('min'),_('max')], + 'red':[_('red')], + 'remainder2':[_('mod')], + 'repeat':['',_('repeat')], + 'restore':[_('restore')], + 'rightpos':[_('right')], + 'right':[_('right')], + 'scale':[_('scale')], + 'setcolor':[_('set color')], + 'seth':[_('set heading')], + 'setpensize':[_('set pen size')], + 'setscale':[_('set scale')], + 'setshade':[_('set shade')], + 'settextsize':[_('set text size')], + 'setxy':[_('set xy'),_('x'),_('y')], + 'shade':[_('shade')], + 'show':[_('show')], + 'sqrt':['√'], + 'stack':[_('action')], + 'stack1':[_('action 1')], + 'stack2':[_('action 2')], + 'start':[_('start')], + 'stopstack':[_('stop action')], + 'storein':[_('store in')], + 'storeinbox1':[_('store in box 1')], + 'storeinbox2':[_('store in box 2')], + 'string':[_('text')], + 'textsize':[_('text size')], + 'toppos':[_('top')], + 'turtle':[_('turtle')], + 'vspace':[' '], + 'wait':[_('wait')], + 'width':[_('width')], + 'xcor':[_('xcor')], + 'ycor':[_('ycor')], + 'yellow':[_('yellow')]} # # Legacy names @@ -166,48 +213,128 @@ OLD_NAMES = {'product':'product2', 'storeinbox':'storein', # Logo primitives # -PRIMITIVES = {'clean':'clean', 'forward':'forward', 'back':'back', 'arc':'arc', - 'left':'left', 'right':'right', 'seth':'seth', 'scale':'scale', - 'show':'show', 'set scale':'setscale', 'xcor':'xcor', 'setxy':'setxy', - 'ycor':'ycor', 'heading':'heading', 'penup':'penup', - 'pendown':'pendown', 'setpensize':'setpensize', - 'settextsize':'settextsize', 'setcolor':'setcolor', - 'setshade':'setshade', 'fillscreen':'fillscreen', 'shade':'shade', - 'pensize':'pensize', 'textsize':'textsize', 'color':'color', - 'plus2':'plus', 'minus2':'minus', 'product2':'product', - 'division2':'division', 'remainder2':'mod', 'identity2':'id', - 'random':'random', 'sqrt':'sqrt', 'less':'less?', - 'greater':'greater?', 'equal':'equal?', 'and':'and', 'or':'or', - 'not':'not', 'print':'print', 'wait':'wait', - 'forever':'forever', 'repeat':'repeat', 'if':'if', 'ifelse':'ifelse', - 'stopstack':'stopstack', 'hspace':'nop', 'vspace':'nop', - 'start':'start', 'hat1':'nop1', 'stack1':'stack1', - 'hat2':'nop2', 'stack2':'stack2', - 'hat':'nop3', 'stack':'stack', 'turtle':'turtle', - 'storeinbox1':'storeinbox1', 'box1':'box1', - 'storeinbox2':'storeinbox2', 'box2':'box2', - 'storein':'storeinbox', 'box':'box', - 'leftpos':'leftpos', 'toppos':'toppos', 'rightpos':'rightpos', - 'bottompos':'bottompos', 'width':'hres', 'height':'vres', - 'hideblocks':'hideblocks', 'push':'push', 'pop':'pop', - 'keyboard':'keyboard', 'kbinput':'kbinput', 'myfunc':'myfunc', - 'nop':'userdefined', 'printheap':'printheap', 'clearheap':'clearheap', - 'red':'red', 'orange':'orange', 'yellow':'yellow', - 'green':'green', 'cyan':'cyan', 'blue':'blue', - 'purple':'purple'} +PRIMITIVES = { + 'and':'and', + 'arc':'arc', + 'back':'back', + 'blue':'blue', + 'bottompos':'bottompos', + 'box1':'box1', + 'box2':'box2', + 'box':'box', + 'clean':'clean', + 'clearheap':'clearheap', + 'color':'color', + 'cyan':'cyan', + 'division2':'division', + 'equal':'equal?', + 'fillscreen':'fillscreen', + 'forever':'forever', + 'forward':'forward', + 'greater':'greater?', + 'green':'green', + 'hat':'nop3', + 'hat1':'nop1', + 'hat2':'nop2', + 'heading':'heading', + 'height':'vres', + 'hideblocks':'hideblocks', + 'hspace':'nop', + 'identity2':'id', + 'if':'if', + 'ifelse':'ifelse', + 'kbinput':'kbinput', + 'keyboard':'keyboard', + 'left':'left', + 'leftpos':'leftpos', + 'less':'less?', + 'minus2':'minus', + 'myfunc':'myfunc', + 'nop':'userdefined', + 'not':'not', + 'orange':'orange', + 'or':'or', + 'pendown':'pendown', + 'pensize':'pensize', + 'penup':'penup', + 'plus2':'plus', + 'pop':'pop', + 'printheap':'printheap', + 'print':'print', + 'product2':'product', + 'purple':'purple', + 'push':'push', + 'random':'random', + 'red':'red', + 'remainder2':'mod', + 'repeat':'repeat', + 'rightpos':'rightpos', + 'right':'right', + 'scale':'scale', + 'setcolor':'setcolor', + 'seth':'seth', + 'setpensize':'setpensize', + 'set scale':'setscale', + 'setshade':'setshade', + 'settextsize':'settextsize', + 'setxy':'setxy', + 'shade':'shade', + 'show':'show', + 'sqrt':'sqrt', + 'stack':'stack', + 'stack1':'stack1', + 'stack2':'stack2', + 'start':'start', + 'stopstack':'stopstack', + 'storein':'storeinbox', + 'storeinbox1':'storeinbox1', + 'storeinbox2':'storeinbox2', + 'textsize':'textsize', + 'toppos':'toppos', + 'turtle':'turtle', + 'vspace':'nop', + 'wait':'wait', + 'width':'hres', + 'xcor':'xcor', + 'ycor':'ycor', + 'yellow':'yellow'} # # block default values # -DEFAULTS = {'forward':[100], 'back':[100], 'left':[90], 'right':[90], - 'arc':[90,100], 'setheading':[0], 'setscale':[33], 'show':[_('text')], - 'setpensize':[5], 'settextsize':[32], 'setcolor':[0], 'turtle':[1], - 'setshade':[50], 'fillscreen':[60,80], 'number':[100], - 'random':[0,100], 'wait':[1], 'repeat':[4], 'setxy':[0,0], - 'storein':[_('my box'),100], 'box':[_('my box')], - 'hat':[_('action')], 'stack':[_('action')], 'nop':[100], - 'storeinbox1':[100], 'storeinbox2':[100], 'myfunc':[_('x'),100]} +DEFAULTS = { + 'arc':[90,100], + 'audio':[None], + 'back':[100], + 'box':[_('my box')], + 'fillscreen':[60,80], + 'forward':[100], + 'hat':[_('action')], + 'journal':[None], + 'left':[90], + 'media':[None], + 'myfunc':[_('x'),100], + 'nop':[100], + 'number':[100], + 'random':[0,100], + 'repeat':[4], + 'right':[90], + 'setcolor':[0], + 'setheading':[0], + 'setpensize':[5], + 'setscale':[33], + 'setshade':[50], + 'settextsize':[32], + 'setxy':[0,0], + 'show':[_('text')], + 'stack':[_('action')], + 'storeinbox1':[100], + 'storeinbox2':[100], + 'storein':[_('my box'),100], + 'string':[_('text')], + 'turtle':[1], + 'wait':[1]} # # Status blocks diff --git a/images/turtleoff.svg b/images/turtleoff.svg index 4fc17f6..495597d 100644 --- a/images/turtleoff.svg +++ b/images/turtleoff.svg @@ -10,16 +10,76 @@ id="svg2"> <defs id="defs5" /> - <path - d="m 18.017646,45.454031 c 1.375591,-0.812581 2.824128,-1.868306 3.5,-2 0.675872,-0.131694 0.579078,0.660641 2,1.5 2.871423,1.696191 5.128577,1.696191 8,0 1.420922,-0.839359 1.324128,-1.631694 2,-1.5 0.675872,0.131695 2.12441,1.187419 3.5,2 1.597361,0.943585 6.005636,1 7,1 1.362975,0 -0.389877,-1.817398 -3,-4 l -4,-3 2,-2 c 2.052001,-3.601395 2.559678,-5.729323 1,-9 l -2,-2.5 5.5,-4 c 2.053201,-1.647134 1.33499,-4.457974 1,-5 -0.169672,-0.274536 -1.573358,-0.314812 -2.5,0 -0.926642,0.314813 -1.37624,0.984714 -2.175027,1.75 -2.712133,2.598388 -1.438186,3.390024 -5.243247,2.25 -4.395178,-1.316827 -5.122955,-2.39168 -2.367914,-5.435965 1.542695,-1.70466 1.296884,-3.140913 -0.390283,-5.005211 -2.301133,-2.5427232 -5.992984,-2.6603702 -8.294117,-0.117647 -1.687167,1.864298 -2.285919,3.535845 -0.743224,5.240505 2.755041,3.044285 1.79197,4.001491 -2.603208,5.318318 -3.791842,1.136063 -2.771755,0.275269 -5.407568,-2.25 -0.769019,-0.736766 -0.948729,-1.446777 -1.775412,-1.75 -0.826683,-0.303224 -2.300339,-0.199661 -2.5,0 -0.39932,0.39932 -1.0810289,3.252871 1,5 l 5.5,4 -2,2.5 c -1.565412,3.282703 -1.053762,5.395513 1,9 l 2,2 -4,3 c -2.610123,2.182602 -4.3629749,4 -3,4 0.994364,0 5.402639,-0.05641 7,-1 z" - id="path2582" - style="fill:#00D000;fill-opacity:1;stroke:#00D000;stroke-opacity:1" /> - <path - d="m 31.283993,14 c 0,0.709129 -0.574863,1.283992 -1.283992,1.283992 -0.70913,0 -1.283993,-0.574863 -1.283993,-1.283992 0,-0.709129 0.574863,-1.283992 1.283993,-1.283992 0.709129,0 1.283992,0.574863 1.283992,1.283992 z" - id="path3269" - style="fill:#00FF00;fill-opacity:1;stroke:#000000;stroke-width:1.43201554;stroke-opacity:1" /> - <path - d="m 26.283993,14 c 0,0.709129 -0.574863,1.283992 -1.283992,1.283992 -0.70913,0 -1.283993,-0.574863 -1.283993,-1.283992 0,-0.709129 0.574863,-1.283992 1.283993,-1.283992 0.709129,0 1.283992,0.574863 1.283992,1.283992 z" - id="path3265" - style="fill:#00FF00;fill-opacity:1;stroke:#000000;stroke-width:1.43201554;stroke-opacity:1" /> + <g + transform="matrix(0.8489685,0,0,0.82955893,4.1533662,4.6871294)" + id="g2830" + style="stroke-width:1.42992032;stroke-miterlimit:4;stroke-dasharray:none"> + <path + d="m 27.5795,48.8995 c -0.553,0 -1.099,-0.035 -1.637,-0.1 l 1.388,2.349 1.368,-2.313 c -0.371,0.03 -0.741,0.064 -1.119,0.064 z" + id="path3003" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <g + transform="translate(0.0825,0.6205)" + id="g3005" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + <path + d="m 40.16,11.726 c -2.164,0 -3.958,1.555 -4.343,3.607 1.859,1.345 3.457,3.115 4.675,5.208 2.285,-0.172 4.094,-2.061 4.094,-4.39 0,-2.444 -1.982,-4.425 -4.426,-4.425 z" + id="path3007" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 40.713,39.887 c -1.224,2.232 -2.86,4.131 -4.797,5.556 0.521,1.864 2.213,3.239 4.244,3.239 2.443,0 4.426,-1.98 4.426,-4.424 0,-2.255 -1.693,-4.096 -3.873,-4.371 z" + id="path3009" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 14.273,39.871 c -2.253,0.206 -4.024,2.079 -4.024,4.387 0,2.443 1.98,4.424 4.424,4.424 2.064,0 3.784,-1.42 4.272,-3.332 -1.883,-1.416 -3.475,-3.289 -4.672,-5.479 z" + id="path3011" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 19.026,15.437 c -0.343,-2.103 -2.154,-3.711 -4.353,-3.711 -2.444,0 -4.424,1.981 -4.424,4.424 0,2.382 1.886,4.31 4.245,4.406 1.186,-2.043 2.732,-3.784 4.532,-5.119 z" + id="path3013" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + </g> + <path + d="m 27.5795,13.1835 c 1.908,0 3.728,0.411 5.418,1.128 0.741,-1.076 1.178,-2.377 1.178,-3.783 0,-3.687 -2.989,-6.677 -6.677,-6.677 -3.687,0 -6.676,2.99 -6.676,6.677 0,1.428 0.452,2.749 1.216,3.834 1.724,-0.749 3.587,-1.179 5.541,-1.179 z" + id="path3015" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <g + transform="translate(0.0825,0.6205)" + id="g3017" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + <path + d="m 43.102,30.421 c 0,4.7344 -1.6452,9.2798 -4.5706,12.6275 -2.9254,3.3478 -6.8973,5.2305 -11.0344,5.2305 -4.1371,0 -8.109,-1.8827 -11.0344,-5.2305 -2.9254,-3.3477 -4.5706,-7.8931 -4.5706,-12.6275 0,-9.7966 7.0444,-17.858 15.605,-17.858 8.5606,0 15.605,8.0614 15.605,17.858 z" + id="path3019" + style="fill:#686868;fill-opacity:1;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + </g> + <g + transform="translate(0.0825,0.6205)" + id="g3021" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + <path + d="m 25.875,33.75 -1.542,-4.625 3.164,-2.587 3.615,2.626 -1.487,4.669 z" + id="path3023" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 27.501,41.551 c -3.968,-0.16 -5.543,-2.009 -5.543,-2.009 l 3.57,-4.163 4.465,0.168 3.132,4.12 c 0,0 -2.89,1.994 -5.624,1.884 z" + id="path3025" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 18.453,33.843 c -0.849,-2.968 0.172,-6.884 0.172,-6.884 l 4,2.167 1.493,4.629 -3.582,4.233 c 0,-10e-4 -1.465,-1.99 -2.083,-4.145 z" + id="path3027" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 19.458,25.125 c 0,0 0.5,-1.958 3.039,-3.822 2.237,-1.643 4.465,-1.72 4.465,-1.72 l -0.037,4.981 -3.521,2.75 -3.946,-2.189 z" + id="path3029" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="M 32.084,27.834 28.625,24.959 29,19.75 c 0,0 1.834,-0.042 3.959,1.667 2.228,1.791 3.362,4.983 3.362,4.983 l -4.237,1.434 z" + id="path3031" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 31.292,34.042 1.313,-4.464 4.187,-1.536 c 0,0 0.677,2.663 -0.042,5.667 -0.54,2.256 -2.084,4.361 -2.084,4.361 l -3.374,-4.028 z" + id="path3033" + style="fill:none;stroke:#ffffff;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + </g> + </g> </svg> diff --git a/images/turtleon.svg b/images/turtleon.svg index 94747ea..bd19cff 100644 --- a/images/turtleon.svg +++ b/images/turtleon.svg @@ -18,16 +18,76 @@ y="0" id="rect2839" style="fill:#ffd200;fill-opacity:1;fill-rule:evenodd;stroke:none" /> - <path - d="m 18.017646,45.454031 c 1.375591,-0.812581 2.824128,-1.868306 3.5,-2 0.675872,-0.131694 0.579078,0.660641 2,1.5 2.871423,1.696191 5.128577,1.696191 8,0 1.420922,-0.839359 1.324128,-1.631694 2,-1.5 0.675872,0.131695 2.12441,1.187419 3.5,2 1.597361,0.943585 6.005636,1 7,1 1.362975,0 -0.389877,-1.817398 -3,-4 l -4,-3 2,-2 c 2.052001,-3.601395 2.559678,-5.729323 1,-9 l -2,-2.5 5.5,-4 c 2.053201,-1.647134 1.33499,-4.457974 1,-5 -0.169672,-0.274536 -1.573358,-0.314812 -2.5,0 -0.926642,0.314813 -1.37624,0.984714 -2.175027,1.75 -2.712133,2.598388 -1.438186,3.390024 -5.243247,2.25 -4.395178,-1.316827 -5.122955,-2.39168 -2.367914,-5.435965 1.542695,-1.70466 1.296884,-3.140913 -0.390283,-5.005211 -2.301133,-2.5427232 -5.992984,-2.6603702 -8.294117,-0.117647 -1.687167,1.864298 -2.285919,3.535845 -0.743224,5.240505 2.755041,3.044285 1.79197,4.001491 -2.603208,5.318318 -3.791842,1.136063 -2.771755,0.275269 -5.407568,-2.25 -0.769019,-0.736766 -0.948729,-1.446777 -1.775412,-1.75 -0.826683,-0.303224 -2.300339,-0.199661 -2.5,0 -0.39932,0.39932 -1.0810289,3.252871 1,5 l 5.5,4 -2,2.5 c -1.565412,3.282703 -1.053762,5.395513 1,9 l 2,2 -4,3 c -2.610123,2.182602 -4.3629749,4 -3,4 0.994364,0 5.402639,-0.05641 7,-1 z" - id="path2582" - style="fill:#00D000;fill-opacity:1;stroke:#00D000;stroke-opacity:1" /> - <path - d="m 31.283993,14 c 0,0.709129 -0.574863,1.283992 -1.283992,1.283992 -0.70913,0 -1.283993,-0.574863 -1.283993,-1.283992 0,-0.709129 0.574863,-1.283992 1.283993,-1.283992 0.709129,0 1.283992,0.574863 1.283992,1.283992 z" - id="path3269" - style="fill:#00FF00;fill-opacity:1;stroke:#000000;stroke-width:1.43201554;stroke-opacity:1" /> - <path - d="m 26.283993,14 c 0,0.709129 -0.574863,1.283992 -1.283992,1.283992 -0.70913,0 -1.283993,-0.574863 -1.283993,-1.283992 0,-0.709129 0.574863,-1.283992 1.283993,-1.283992 0.709129,0 1.283992,0.574863 1.283992,1.283992 z" - id="path3265" - style="fill:#00FF00;fill-opacity:1;stroke:#000000;stroke-width:1.43201554;stroke-opacity:1" /> + <g + transform="matrix(0.8489685,0,0,0.82955893,4.1533662,4.6871294)" + id="g2831" + style="stroke-width:1.42992032;stroke-miterlimit:4;stroke-dasharray:none"> + <path + d="m 27.5795,48.8995 c -0.553,0 -1.099,-0.035 -1.637,-0.1 l 1.388,2.349 1.368,-2.313 c -0.371,0.03 -0.741,0.064 -1.119,0.064 z" + id="path3003" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <g + transform="translate(0.0825,0.6205)" + id="g3005" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + <path + d="m 40.16,11.726 c -2.164,0 -3.958,1.555 -4.343,3.607 1.859,1.345 3.457,3.115 4.675,5.208 2.285,-0.172 4.094,-2.061 4.094,-4.39 0,-2.444 -1.982,-4.425 -4.426,-4.425 z" + id="path3007" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 40.713,39.887 c -1.224,2.232 -2.86,4.131 -4.797,5.556 0.521,1.864 2.213,3.239 4.244,3.239 2.443,0 4.426,-1.98 4.426,-4.424 0,-2.255 -1.693,-4.096 -3.873,-4.371 z" + id="path3009" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 14.273,39.871 c -2.253,0.206 -4.024,2.079 -4.024,4.387 0,2.443 1.98,4.424 4.424,4.424 2.064,0 3.784,-1.42 4.272,-3.332 -1.883,-1.416 -3.475,-3.289 -4.672,-5.479 z" + id="path3011" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 19.026,15.437 c -0.343,-2.103 -2.154,-3.711 -4.353,-3.711 -2.444,0 -4.424,1.981 -4.424,4.424 0,2.382 1.886,4.31 4.245,4.406 1.186,-2.043 2.732,-3.784 4.532,-5.119 z" + id="path3013" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + </g> + <path + d="m 27.5795,13.1835 c 1.908,0 3.728,0.411 5.418,1.128 0.741,-1.076 1.178,-2.377 1.178,-3.783 0,-3.687 -2.989,-6.677 -6.677,-6.677 -3.687,0 -6.676,2.99 -6.676,6.677 0,1.428 0.452,2.749 1.216,3.834 1.724,-0.749 3.587,-1.179 5.541,-1.179 z" + id="path3015" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <g + transform="translate(0.0825,0.6205)" + id="g3017" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + <path + d="m 43.102,30.421 c 0,4.7344 -1.6452,9.2798 -4.5706,12.6275 -2.9254,3.3478 -6.8973,5.2305 -11.0344,5.2305 -4.1371,0 -8.109,-1.8827 -11.0344,-5.2305 -2.9254,-3.3477 -4.5706,-7.8931 -4.5706,-12.6275 0,-9.7966 7.0444,-17.858 15.605,-17.858 8.5606,0 15.605,8.0614 15.605,17.858 z" + id="path3019" + style="fill:#00d000;fill-opacity:1;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + </g> + <g + transform="translate(0.0825,0.6205)" + id="g3021" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + <path + d="m 25.875,33.75 -1.542,-4.625 3.164,-2.587 3.615,2.626 -1.487,4.669 z" + id="path3023" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 27.501,41.551 c -3.968,-0.16 -5.543,-2.009 -5.543,-2.009 l 3.57,-4.163 4.465,0.168 3.132,4.12 c 0,0 -2.89,1.994 -5.624,1.884 z" + id="path3025" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 18.453,33.843 c -0.849,-2.968 0.172,-6.884 0.172,-6.884 l 4,2.167 1.493,4.629 -3.582,4.233 c 0,-10e-4 -1.465,-1.99 -2.083,-4.145 z" + id="path3027" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 19.458,25.125 c 0,0 0.5,-1.958 3.039,-3.822 2.237,-1.643 4.465,-1.72 4.465,-1.72 l -0.037,4.981 -3.521,2.75 -3.946,-2.189 z" + id="path3029" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="M 32.084,27.834 28.625,24.959 29,19.75 c 0,0 1.834,-0.042 3.959,1.667 2.228,1.791 3.362,4.983 3.362,4.983 l -4.237,1.434 z" + id="path3031" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + d="m 31.292,34.042 1.313,-4.464 4.187,-1.536 c 0,0 0.677,2.663 -0.042,5.667 -0.54,2.256 -2.084,4.361 -2.084,4.361 l -3.374,-4.028 z" + id="path3033" + style="fill:none;stroke:#00ff00;stroke-width:1.42992032;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + </g> + </g> </svg> diff --git a/tawindow.py b/tawindow.py index b5b7a3c..ef2e074 100644 --- a/tawindow.py +++ b/tawindow.py @@ -263,7 +263,7 @@ class TurtleArtWindow(): return map(int, event.get_coords()) """ - run turtle! + Run turtle! """ def run_button(self, time): if self.running_sugar(): @@ -654,7 +654,6 @@ class TurtleArtWindow(): elif keyname == 'period' and '.' not in oldnum: newnum = oldnum + '.' elif keyname == 'BackSpace': - print "backspace: %s -> %s" % (oldnum, oldnum[:len(oldnum)-1]) if len(oldnum) > 1: newnum = oldnum[:len(oldnum)-1] else: @@ -666,7 +665,6 @@ class TurtleArtWindow(): newnum = oldnum + keyname else: newnum = oldnum - # Add a cursor self.selected_blk.spr.set_label("%s%s" % \ (str(numcheck(newnum,oldnum)), CURSOR)) @@ -986,6 +984,7 @@ class TurtleArtWindow(): Run stack """ def _run_stack(self, blk): + # self.block_list.print_list('block') if blk is None: return self.lc.ag = None |