Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-03-25 00:22:09 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-03-25 00:22:09 (GMT)
commit751eef0bb55aa840ba4077cd9115390cf7cc12c9 (patch)
tree597d3aa2f0f117d15fbd43a83fdc4734b6fe9e1b /utils.py
parenta6a6d15fcfa73acbf7a1ea9027898c713184aa73 (diff)
more sharing code
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