Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-11 12:55:46 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-11 12:55:46 (GMT)
commitc6e13603f52ad477a0275af1c6a1e5ba50fdc688 (patch)
tree2abea4d3ad29dc5f83a04d70b8dc1eca90c4ac2d
parentdda64adbdaabe5c79425b17b1db65c4ff355339d (diff)
switching back to split
-rw-r--r--TurtleArtActivity.py10
-rw-r--r--taconstants.py10
-rw-r--r--tawindow.py9
3 files changed, 15 insertions, 14 deletions
diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py
index cdc289b..bf0a937 100644
--- a/TurtleArtActivity.py
+++ b/TurtleArtActivity.py
@@ -539,22 +539,22 @@ class TurtleArtActivity(activity.Activity):
# maybe we can use a stack to share events to new-comers?
# self._share += "text + "\n"
if text[0] == 'p': # button press
- e,x,y,mask = text.rsplit(":")
+ e,x,y,mask = text.split(":")
# _logger.debug("receiving button press: "+x+" "+y+" "+mask)
if mask == 'T':
self.tw.button_press(True,int(x),int(y),False)
else:
self.tw.button_press(False,int(x),int(y),False)
elif text[0] == 'r': # block release
- e,x,y = text.rsplit(":")
+ e,x,y = text.split(":")
# _logger.debug("receiving button release: " + x + " " + y)
self.tw.button_release(int(x),int(y),False)
elif text[0] == 'm': # mouse move
- e,x,y = text.rsplit(":")
+ e,x,y = text.split(":")
_logger.debug("receiving move: " + x + " " + y)
self.tw.mouse_move(0,0,False,int(x),int(y))
elif text[0] == 'k': # typing
- e,mask,keyname = text.rsplit(":",3)
+ e,mask,keyname = text.split(":",3)
# _logger.debug("recieving key press: " + mask + " " + keyname)
if mask == 'T':
self.tw.key_press(True,keyname,False)
@@ -570,7 +570,7 @@ class TurtleArtActivity(activity.Activity):
elif text[0] == 'I': # receiving current state
if self.waiting_for_blocks:
_logger.debug("receiving project from sharer")
- e,text = text.rsplit(":",2)
+ e,text = text.split(":",2)
if len(text) > 0:
self.tw.new_project()
self.tw.process_data(data_from_string(text))
diff --git a/taconstants.py b/taconstants.py
index 1ae34df..3c23f89 100644
--- a/taconstants.py
+++ b/taconstants.py
@@ -109,7 +109,7 @@ PALETTE_NAMES = ['turtle', 'pen', 'colors', 'numbers', 'flow', 'blocks',
PALETTES = [['forward', 'back', 'clean', 'left', 'right', 'show',
'seth', 'setxy', 'heading', 'xcor', 'ycor', 'setscale',
- 'arc', 'scale', 'width', 'height', 'leftpos', 'toppos', 'rightpos',
+ 'arc', 'scale', 'leftpos', 'toppos', 'rightpos',
'bottompos'],
['penup','pendown', 'setpensize', 'fillscreen', 'pensize',
'settextsize', 'setcolor', 'setshade', 'textsize', 'color',
@@ -125,10 +125,10 @@ PALETTES = [['forward', 'back', 'clean', 'left', 'right', 'show',
'storein', 'start'],
['kbinput', 'push', 'printheap', 'keyboard', 'pop', 'clearheap',
'myfunc', 'nop', 'sandwichtop', 'sandwichbottom',
- 'addturtle', 'print', 'comment'],
- ['journal', 'audio', 'description', 'picturelist',
- 'hideblocks', 'showblocks', 'fullscreen',
- 'picture1x1', 'picture2x2', 'picture2x1', 'picture1x2', 'savepix'],
+ 'addturtle', 'print', 'comment', 'width', 'height'],
+ ['journal', 'audio', 'description', 'savepix',
+ 'hideblocks', 'showblocks', 'fullscreen', 'picturelist',
+ 'picture1x1', 'picture2x2', 'picture2x1', 'picture1x2'],
['empty', 'restoreall']]
#
diff --git a/tawindow.py b/tawindow.py
index 7b70da3..2a514a3 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -1709,16 +1709,17 @@ class TurtleArtWindow():
"""
def _process_alphanumeric_input(self, keyname, keyunicode):
if len(self.selected_blk.spr.labels[0]) > 0:
- if self.selected_blk.spr.labels[0].count(CURSOR) == 0:
+ c = self.selected_blk.spr.labels[0].count(CURSOR)
+ if c == 0:
oldleft = self.selected_blk.spr.labels[0]
oldright = ''
elif len(self.selected_blk.spr.labels[0]) == 1:
oldleft = ''
oldright = ''
- else: # Why are getting a ValueError on occasion?
- try:
+ else:
+ try: # Why are getting a ValueError on occasion?
oldleft, oldright =\
- self.selected_blk.spr.labels[0].rsplit(CURSOR)
+ self.selected_blk.spr.labels[0].split(CURSOR)
except ValueError:
print "[%s]" % self.selected_blk.spr.labels[0]
oldleft = self.selected_blk.spr.labels[0]