diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-02-03 00:01:01 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-02-03 00:01:01 (GMT) |
commit | a7dbc53a6657ad1e115f096e3072dc927847d853 (patch) | |
tree | 1ceea572568d9bd116f7ff4e142b9960861038d3 /ground.py | |
parent | 6bf19eae5239760be2c11fc39b56e11cd40c3efc (diff) |
Mix in Char with OOP
Diffstat (limited to 'ground.py')
-rw-r--r-- | ground.py | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -14,12 +14,12 @@ import os import gtk -import cStringIO from gettext import gettext as _ from sugar.graphics.objectchooser import ObjectChooser import theme +from utils import pixbuf, pixbuf2str def load(): from document import Document @@ -36,7 +36,7 @@ class Ground: if type == theme.RESTORED: tmpfile = os.path.join(theme.SESSION_PATH, '.tmp.png') file(tmpfile, 'w').write(image) - self._orig = gtk.gdk.pixbuf_new_from_file(tmpfile) + self._orig = theme.pixbuf(tmpfile) os.unlink(tmpfile) self._filename = 'ground.png' else: @@ -47,12 +47,7 @@ class Ground: return self._type != theme.PREINSTALLED def read(self): - def push(data, buffer): - buffer.write(data) - - buffer = cStringIO.StringIO() - self._orig.save_to_callback(push, 'png', user_data=buffer) - return buffer.getvalue() + pixbuf2str(self._orig) def filename(self): return self._filename @@ -65,7 +60,7 @@ class Ground: def orig(self): return self._orig - def change(self): + def select(self): if self._type != theme.CUSTOM: return self return theme.choose( |