# HG changeset patch # User Paul Boddie # Date 1457368501 -3600 # Node ID dd4f59a7fea50d7423f0f40d77b3a46e6eab4019 # Parent b3f67160581053365ba20cad1f5104ac0692cce1 Moved various operations into the store base class. diff -r b3f671605810 -r dd4f59a7fea5 imiptools/stores/__init__.py --- a/imiptools/stores/__init__.py Mon Mar 07 17:34:01 2016 +0100 +++ b/imiptools/stores/__init__.py Mon Mar 07 17:35:01 2016 +0100 @@ -293,13 +293,13 @@ # Free/busy period access. - def get_freebusy(self, user, name=None): + def get_freebusy(self, user, name=None, mutable=False): "Get free/busy details for the given 'user'." pass - def get_freebusy_for_other(self, user, other): + def get_freebusy_for_other(self, user, other, mutable=False): "For the given 'user', get free/busy details for the 'other' user." @@ -309,13 +309,13 @@ "Get free/busy details for the given 'user'." - pass + return self.get_freebusy(user, name, True) def get_freebusy_for_other_for_update(self, user, other): "For the given 'user', get free/busy details for the 'other' user." - pass + return self.get_freebusy_for_other(user, other, True) def set_freebusy(self, user, freebusy, name=None): @@ -331,7 +331,7 @@ # Tentative free/busy periods related to countering. - def get_freebusy_offers(self, user): + def get_freebusy_offers(self, user, mutable=False): "Get free/busy offers for the given 'user'." @@ -341,7 +341,7 @@ "Get free/busy offers for the given 'user'." - pass + return self.get_freebusy_offers(user, True) def set_freebusy_offers(self, user, freebusy): @@ -569,7 +569,7 @@ # Free/busy period access for users within quota groups. - def get_freebusy(self, quota, user): + def get_freebusy(self, quota, user, mutable=False): "Get free/busy details for the given 'quota' and 'user'." @@ -579,7 +579,7 @@ "Get free/busy details for the given 'quota' and 'user'." - pass + return self.get_freebusy(quota, user, True) def set_freebusy(self, quota, user, freebusy): @@ -589,7 +589,7 @@ # Journal entry methods. - def get_entries(self, quota, group): + def get_entries(self, quota, group, mutable=False): """ Return a list of journal entries for the given 'quota' for the indicated @@ -605,7 +605,7 @@ 'group'. """ - pass + return self.get_entries(quota, group, True) def set_entries(self, quota, group, entries): diff -r b3f671605810 -r dd4f59a7fea5 imiptools/stores/file.py --- a/imiptools/stores/file.py Mon Mar 07 17:34:01 2016 +0100 +++ b/imiptools/stores/file.py Mon Mar 07 17:35:01 2016 +0100 @@ -464,12 +464,6 @@ return FreeBusyCollection(periods, mutable) - def get_freebusy_for_update(self, user, name=None): - - "Get free/busy details for the given 'user'." - - return self.get_freebusy(user, name, True) - def get_freebusy_for_other(self, user, other, mutable=False): "For the given 'user', get free/busy details for the 'other' user." @@ -484,12 +478,6 @@ return FreeBusyCollection(periods, mutable) - def get_freebusy_for_other_for_update(self, user, other): - - "For the given 'user', get free/busy details for the 'other' user." - - return self.get_freebusy_for_other(user, other, True) - def set_freebusy(self, user, freebusy, name=None): "For the given 'user', set 'freebusy' details." @@ -542,12 +530,6 @@ return FreeBusyCollection(offers, mutable) - def get_freebusy_offers_for_update(self, user): - - "Get free/busy offers for the given 'user'." - - return self.get_freebusy_offers(user, True) - def set_freebusy_offers(self, user, freebusy): "For the given 'user', set 'freebusy' offers." @@ -850,12 +832,6 @@ return FreeBusyCollection(periods, mutable) - def get_freebusy_for_update(self, quota, user): - - "Get free/busy details for the given 'quota' and 'user'." - - return self.get_freebusy(quota, user, True) - def set_freebusy(self, quota, user, freebusy): "For the given 'quota' and 'user', set 'freebusy' details." @@ -887,15 +863,6 @@ return FreeBusyCollection(periods, mutable) - def get_entries_for_update(self, quota, group): - - """ - Return a list of journal entries for the given 'quota' for the indicated - 'group'. - """ - - return self.get_entries(quota, group, True) - def set_entries(self, quota, group, entries): """