Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPootle daemon <pootle@pootle.sugarlabs.org>2013-09-24 04:31:26 (GMT)
committer Pootle daemon <pootle@pootle.sugarlabs.org>2013-09-24 04:31:26 (GMT)
commite1c958e95b8354c870d51bc3d934bbd622214ea7 (patch)
tree1f6cd0f89a0689279bdcc6ed4df6a10e80c2c53e
parent0323db1f74170571f4a418453d032f211c2e5dd3 (diff)
parent2700fc55e3848afb33bd919f684b9a65de784038 (diff)
Merge branch 'master' of git.sugarlabs.org:turtleart/mainline
-rw-r--r--TurtleArt/tablock.py4
-rw-r--r--TurtleArt/tautils.py6
-rw-r--r--TurtleArt/tawindow.py32
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py2
-rwxr-xr-xturtleblocks.py2
5 files changed, 23 insertions, 23 deletions
diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py
index 8d8ed4a..ff392e0 100644
--- a/TurtleArt/tablock.py
+++ b/TurtleArt/tablock.py
@@ -555,7 +555,7 @@ class Block:
if self.spr is None:
return
if isinstance(self.name, unicode):
- self.name = self.name.encode('ascii', 'replace')
+ self.name = self.name.encode('utf-8')
if self.name in content_blocks:
n = len(self.values)
if n == 0:
@@ -636,7 +636,7 @@ class Block:
self.svg.set_stroke_width(STANDARD_STROKE_WIDTH)
self.svg.clear_docks()
if isinstance(self.name, unicode):
- self.name = self.name.encode('ascii', 'replace')
+ self.name = self.name.encode('utf-8')
for k in block_styles.keys():
if self.name in block_styles[k]:
if isinstance(self.block_methods[k], list):
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index 07b72d9..b0aa368 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -186,7 +186,7 @@ def find_hat(data):
def _to_str(text):
''' Convert whatever to a str type '''
if isinstance(text, unicode):
- return text.encode('ascii', 'replace')
+ return text.encode('utf-8')
elif isinstance(text, str):
return text
else:
@@ -371,7 +371,7 @@ def data_from_string(text):
if isinstance(text, str):
return json_load(text.replace(']],\n', ']], '))
elif isinstance(text, unicode):
- text = text.encode('ascii', 'replace')
+ text = text.encode('utf-8')
return json_load(text.replace(']],\n', ']], '))
else:
print 'type error (%s) in data_from_string' % (type(text))
@@ -415,7 +415,7 @@ def save_picture(canvas, file_name):
cr.set_source_surface(x_surface)
cr.paint()
if isinstance(file_name, unicode):
- img_surface.write_to_png(str(file_name.encode('ascii', 'replace')))
+ img_surface.write_to_png(str(file_name.encode('utf-8')))
else:
img_surface.write_to_png(str(file_name))
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 4e55d5b..7209dd3 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -1591,13 +1591,13 @@ before making changes to your Turtle Blocks program'))
found_the_action_block = False
bname = _('action')
if isinstance(bname, unicode):
- bname = bname.encode('ascii', 'replace')
+ bname = bname.encode('utf-8')
for sblk in similars:
cblk = sblk.connections[1]
if cblk is not None:
blabel = cblk.spr.labels[0]
if isinstance(blabel, unicode):
- blabel = blabel.encode('ascii', 'replace')
+ blabel = blabel.encode('utf-8')
if bname == blabel:
found_the_action_block = True
# If there is an action block in use, change the name
@@ -1825,7 +1825,7 @@ before making changes to your Turtle Blocks program'))
if isinstance(name, (float, int)):
return
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
for blk in self.just_blocks():
if self._action_name(blk, hat=False):
if blk.spr.labels[0] == self._saved_action_name:
@@ -1843,7 +1843,7 @@ before making changes to your Turtle Blocks program'))
if isinstance(name, (float, int)):
return
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
for blk in self.just_blocks():
if self._box_name(blk, storein=False):
if blk.spr.labels[0] == self._saved_box_name:
@@ -1861,7 +1861,7 @@ before making changes to your Turtle Blocks program'))
if isinstance(name, (float, int)):
return
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
for blk in self.just_blocks():
if self._box_name(blk, storein=True):
if blk.spr.labels[0] == self._saved_box_name:
@@ -1884,11 +1884,11 @@ before making changes to your Turtle Blocks program'))
# (3) The list of proto blocks on the palette
# (4) The list of block names
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
if isinstance(old, unicode):
- old = old.encode('ascii', 'replace')
+ old = old.encode('utf-8')
if isinstance(new, unicode):
- new = new.encode('ascii', 'replace')
+ new = new.encode('utf-8')
if old == new:
'''
@@ -4066,7 +4066,7 @@ before making changes to your Turtle Blocks program'))
if btype == 'string' and blk.spr is not None:
value = blk.values[0]
if isinstance(value, unicode):
- value = value.encode('ascii', 'replace')
+ value = value.encode('utf-8')
blk.spr.set_label(value.replace('\n', RETURN))
elif btype == 'start': # block size is saved in start block
if value is not None:
@@ -4541,16 +4541,16 @@ before making changes to your Turtle Blocks program'))
if not self.interactive_mode:
return False
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
if isinstance(label, unicode):
- label = label.encode('ascii', 'replace')
+ label = label.encode('utf-8')
i = palette_name_to_index(palette)
for blk in self.palettes[i]:
blk_label = blk.spr.labels[0]
if isinstance(blk.name, unicode):
- blk.name = blk.name.encode('ascii', 'replace')
+ blk.name = blk.name.encode('utf-8')
if isinstance(blk_label, unicode):
- blk_label = blk_label.encode('ascii', 'replace')
+ blk_label = blk_label.encode('utf-8')
if blk.name == name and blk_label == label:
return True
# Check labels[1] too (e.g., store in block)
@@ -4567,7 +4567,7 @@ before making changes to your Turtle Blocks program'))
if isinstance(name, (float, int)):
return
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
if name == _('action'):
return
# Choose a palette for the new block.
@@ -4596,7 +4596,7 @@ before making changes to your Turtle Blocks program'))
if isinstance(name, (float, int)):
return
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
if name == _('my box'):
return
# Choose a palette for the new block.
@@ -4626,7 +4626,7 @@ before making changes to your Turtle Blocks program'))
if isinstance(name, (float, int)):
return
if isinstance(name, unicode):
- name = name.encode('ascii', 'replace')
+ name = name.encode('utf-8')
if name == _('my box'):
return
# Choose a palette for the new block.
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 2ae320a..b1b003f 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -1552,7 +1552,7 @@ Journal objects'))
self.tw.show_toolbar_palette(int(arg))
else:
if type(arg) == unicode:
- arg = arg.encode('ascii', 'replace')
+ arg = arg.encode('utf-8')
if arg in palette_names:
self.tw.show_toolbar_palette(palette_name_to_index(arg))
else:
diff --git a/turtleblocks.py b/turtleblocks.py
index b6e9fd6..24b6343 100755
--- a/turtleblocks.py
+++ b/turtleblocks.py
@@ -552,7 +552,7 @@ Would you like to save before quitting?'))
filename, self.tw.load_save_folder = get_save_name(
save_type, self.tw.load_save_folder, 'logosession')
if isinstance(filename, unicode):
- filename = filename.encode('ascii', 'replace')
+ filename = filename.encode('utf-8')
if filename is not None:
f = file(filename, 'w')
f.write(logocode)