Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ground.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-02-07 11:45:22 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-02-07 11:45:22 (GMT)
commitc1954705fa0123dc91265098b3e375b4919572de (patch)
tree1e7254677f30c8889589bd9a1365588dd831d559 /ground.py
parent7671f904c967dfe561ebb8f3ce08389963784ea9 (diff)
Mix in Documnt with more OOP; add id for all objects
Diffstat (limited to 'ground.py')
-rw-r--r--ground.py12
1 files changed, 7 insertions, 5 deletions
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 = [