From e29368e0ed0fa02ec4de3f368252f0d653257176 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 29 Jan 2010 19:32:34 +0000 Subject: fixed boolean problem --- (limited to 'constants.py') 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 -- cgit v0.9.1