# HG changeset patch # User Paul Boddie # Date 1457219489 -3600 # Node ID f4bf00639b35eb7ffd9c4f7ba30b40d1bdce4dc9 # Parent b0c1acfc40c776562b4a5a1285d94435797f3f90 Introduced useful conceptual methods. Removed superfluous import. diff -r b0c1acfc40c7 -r f4bf00639b35 imip_store.py --- a/imip_store.py Sat Mar 05 01:04:19 2016 +0100 +++ b/imip_store.py Sun Mar 06 00:11:29 2016 +0100 @@ -28,7 +28,6 @@ from imiptools.text import parse_line from os.path import isdir, isfile, join from os import listdir, remove, rmdir -from time import sleep import codecs class FileStoreBase(FileBase): @@ -348,6 +347,11 @@ "Remove an event for 'user' having the given 'uid'." self.remove_recurrences(user, uid) + return self.remove_parent_event(user, uid) + + def remove_parent_event(self, user, uid): + + "Remove the parent event for 'user' having the given 'uid'." filename = self.get_object_in_store(user, "objects", uid) if not filename: @@ -451,6 +455,15 @@ for recurrenceid in self.get_recurrences(user, uid): self.remove_recurrence(user, uid, recurrenceid) + return self.remove_recurrence_collection(user, uid) + + def remove_recurrence_collection(self, user, uid): + + """ + Remove the collection of recurrences stored by 'user' having the given + 'uid'. + """ + recurrences = self.get_object_in_store(user, "recurrences", uid) if recurrences: return self._remove_collection(recurrences)