From c1954705fa0123dc91265098b3e375b4919572de Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Sat, 07 Feb 2009 11:45:22 +0000 Subject: Mix in Documnt with more OOP; add id for all objects --- (limited to 'ground.py') diff --git a/ground.py b/ground.py index fdf3bf8..4aef242 100644 --- a/ground.py +++ b/ground.py @@ -34,7 +34,7 @@ class Ground: return True def read(self): - pixbuf2str(self._orig) + return theme.pixbuf2str(self._orig) def thumb(self): if not self._thumb: @@ -61,17 +61,19 @@ class CustomGround(Ground): self._orig = theme.pixbuf(filename) def select(self): - return theme.choose(lambda jobject: JournalGround(jobject)) + try: + return theme.choose(lambda jobject: JournalGround(jobject)) + except: + return None class RestoredGround(Ground): def __init__(self, name, id, data): Ground.__init__(self, name, id) - self._orig = str2pixbuf(data) + self._orig = theme.str2pixbuf(data) class JournalGround(Ground): def __init__(self, jobject): - Ground.__init__(self, jobject.props.metadata['title'], - jobject.object_id) + Ground.__init__(self, jobject.metadata['title'], jobject.object_id) self._orig = theme.pixbuf(jobject.file_path) THEMES = [ -- cgit v0.9.1