From 420f73b64979f4a695c780f080c8873229260f27 Mon Sep 17 00:00:00 2001 From: Antoine van Gelder Date: Mon, 29 Oct 2007 09:21:06 +0000 Subject: JokeMachine-3.xo * Feature: Put alerts up when joke submitted and approved over mesh * Feature: Put alert up advising patience when joining a shared jokebook * Feature: Made Lesson Plans button work * Feature: Safe fallback for builds without sugar.alert * Feature: Hooked LanguageCombo up * i18n: Created (a rough!) Afrikaans translation * Fixed: Prepended Cover on preview * Fixed: Don't hardcode JokeEditor delete button position * Fixed: On read jokebook & empty -> "Edit My Jokes" -> Go to edit my jokes tab * Updated :Mesh code for dbus tubes changes --- (limited to 'persistence/jokemachinestate.py') diff --git a/persistence/jokemachinestate.py b/persistence/jokemachinestate.py index 3d591cf..ae5d303 100644 --- a/persistence/jokemachinestate.py +++ b/persistence/jokemachinestate.py @@ -40,24 +40,23 @@ class JokeMachineState(object): def default(self): return 1 # TODO - pull from activity/activity.info def get(self): return self.__version - @property def next_jokebook_id(self): if len(self.jokebooks) == 0: return 1 return max([jokebook.id for jokebook in self.jokebooks]) + 1 - def jokebook(self, id): + '''returns the jokebook specified by id''' for jokebook in self.jokebooks: if jokebook.id == id: return jokebook logging.error('Could not find jokebook with id %d' % d) return None + def test_data(self): self.id = 1 - # add some jokebooks with jokes num_jokebooks = 0 num_jokes = 2 @@ -77,6 +76,5 @@ class JokeMachineState(object): joke.id = joke_id jokebook.submissions.append(joke) self.jokebooks.append(jokebook) - return self \ No newline at end of file -- cgit v0.9.1