Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index b382490..9e4ebcd 100644
--- a/utils.py
+++ b/utils.py
@@ -10,6 +10,7 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+import gtk
from StringIO import StringIO
try:
OLD_SUGAR_SYSTEM = False
@@ -51,3 +52,12 @@ def json_dump(data):
_io = StringIO()
jdump(data, _io)
return _io.getvalue()
+
+
+def svg_str_to_pixbuf(svg_string):
+ ''' Load pixbuf from SVG string '''
+ pl = gtk.gdk.PixbufLoader('svg')
+ pl.write(svg_string)
+ pl.close()
+ pixbuf = pl.get_pixbuf()
+ return pixbuf