Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/theme.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-02-07 09:05:07 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-02-07 09:05:07 (GMT)
commit7671f904c967dfe561ebb8f3ce08389963784ea9 (patch)
tree247bba7834a17fccf00450fa1ee32634652f1d9a /theme.py
parent4b06f75c99d96fdc84706e798f54001bb1cd99a9 (diff)
Mix in Char/Ground with more OOP
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)