Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
authorJRG 2 <jrg2@ubuntu.(none)>2013-12-26 04:37:48 (GMT)
committer JRG 2 <jrg2@ubuntu.(none)>2013-12-26 04:37:48 (GMT)
commitd2d16bd21fbadca3cd7b4b8241082f216e87f178 (patch)
tree7e105c16f41e3a38653b612d68966e8157edcc8a /TurtleArt
parent94558caba48480424a8a8d0f4613a7265e44998d (diff)
Export icon
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/tacanvas.py7
-rw-r--r--TurtleArt/tawindow.py41
2 files changed, 0 insertions, 48 deletions
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py
index 753fd32..f37a3a4 100644
--- a/TurtleArt/tacanvas.py
+++ b/TurtleArt/tacanvas.py
@@ -128,14 +128,9 @@ class TurtleGraphics:
else:
svg_surface = cairo.SVGSurface(
TMP_SVG_PATH, self.width, self.height)
- self.svg_surface = svg_surface
self.cr_svg = cairo.Context(svg_surface)
self.cr_svg.set_line_cap(1) # Set the line cap to be round
- def get_square_svg_path(self):
- return os.path.join(get_path(self.turtle_window.activity, 'instance'),
- 'output.svg')
-
def fill_polygon(self, poly_points):
''' Draw the polygon... '''
def _fill_polygon(cr, poly_points):
@@ -421,8 +416,6 @@ class TurtleGraphics:
def svg_close(self):
''' Close current SVG graphic '''
self.cr_svg.show_page()
- self.svg_surface.flush()
- self.svg_surface.finish()
def svg_reset(self):
''' Reset svg flags '''
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 63b088f..4584726 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -4642,47 +4642,6 @@ before making changes to your program'))
save_picture(self.canvas, image_file)
return ta_file, image_file
- def save_as_icon(self, name=''):
- from sugariconify import SugarIconify
-
- icon = SugarIconify()
- path = self.canvas.get_square_svg_path()
- self.square_svg(path)
-
- lst_path = path.split('/')
- icon.set_use_default_colors(True)
- output_path = '/'.join(lst_path[:-1])
-
- icon.set_output_path(output_path)
- icon.iconify(path)
-
- file_name_lst = lst_path[-1].split('.')
- file_name = '.'.join(file_name_lst[:-1]) + '.sugar.svg'
- lst_path[-1] = file_name
- path = '/'.join(lst_path)
-
- if self.running_sugar:
- from sugar.datastore import datastore
- from sugar import profile
-
- dsobject = datastore.create()
- if len(name) == 0:
- dsobject.metadata['title'] = '%s %s' % \
- (self.activity.metadata['title'], _('icon'))
- else:
- dsobject.metadata['title'] = name
- dsobject.metadata['icon-color'] = profile.get_color().to_string()
- dsobject.metadata['mime_type'] = 'image/svg+xml'
- dsobject.set_file_path(path)
- datastore.write(dsobject)
- dsobject.destroy()
- self.saved_pictures.append((dsobject.object_id, True))
- os.remove(path)
-
- def write_svg_operation(self):
- self.canvas.svg_close()
- self.canvas.svg_reset()
-
def save_as_image(self, name='', svg=False):
''' Grab the current canvas and save it. '''
if svg: