Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/theme.py
diff options
context:
space:
mode:
Diffstat (limited to 'theme.py')
-rw-r--r--theme.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/theme.py b/theme.py
index fe440ff..a43e58b 100644
--- a/theme.py
+++ b/theme.py
@@ -132,6 +132,22 @@ def choose(out_fun):
return None
+def pixbuf2str(pixbuf):
+ def push(data, buffer):
+ buffer.write(data)
+
+ import cStringIO
+ buffer = cStringIO.StringIO()
+ pixbuf.save_to_callback(push, 'png', user_data=buffer)
+ return buffer.getvalue()
+
+def str2pixbuf(data):
+ tmpfile = os.path.join(SESSION_PATH, '.tmp.png')
+ file(tmpfile, 'w').write(data)
+ out = theme.pixbuf(tmpfile)
+ os.unlink(tmpfile)
+ return out
+
# customize theme
gtkrc = os.path.join(get_bundle_path(), 'gtkrc')
gtk.rc_add_default_file(gtkrc)