1.1 --- a/imiptools/stores/file.py Sun Mar 06 00:46:26 2016 +0100
1.2 +++ b/imiptools/stores/file.py Sun Mar 06 19:19:23 2016 +0100
1.3 @@ -525,7 +525,7 @@
1.4
1.5 # Free/busy period access.
1.6
1.7 - def get_freebusy(self, user, name=None):
1.8 + def get_freebusy(self, user, name=None, mutable=False):
1.9
1.10 "Get free/busy details for the given 'user'."
1.11
1.12 @@ -537,9 +537,15 @@
1.13 periods = map(lambda t: FreeBusyPeriod(*t),
1.14 self._get_table_atomic(user, filename))
1.15
1.16 - return FreeBusyCollection(periods)
1.17 + return FreeBusyCollection(periods, mutable)
1.18 +
1.19 + def get_freebusy_for_update(self, user, name=None):
1.20
1.21 - def get_freebusy_for_other(self, user, other):
1.22 + "Get free/busy details for the given 'user'."
1.23 +
1.24 + return self.get_freebusy(user, name, True)
1.25 +
1.26 + def get_freebusy_for_other(self, user, other, mutable=False):
1.27
1.28 "For the given 'user', get free/busy details for the 'other' user."
1.29
1.30 @@ -551,7 +557,13 @@
1.31 periods = map(lambda t: FreeBusyPeriod(*t),
1.32 self._get_table_atomic(user, filename))
1.33
1.34 - return FreeBusyCollection(periods)
1.35 + return FreeBusyCollection(periods, mutable)
1.36 +
1.37 + def get_freebusy_for_other_for_update(self, user, other):
1.38 +
1.39 + "For the given 'user', get free/busy details for the 'other' user."
1.40 +
1.41 + return self.get_freebusy_for_other(user, other, True)
1.42
1.43 def set_freebusy(self, user, freebusy, name=None):
1.44
1.45 @@ -579,7 +591,7 @@
1.46
1.47 # Tentative free/busy periods related to countering.
1.48
1.49 - def get_freebusy_offers(self, user):
1.50 + def get_freebusy_offers(self, user, mutable=False):
1.51
1.52 "Get free/busy offers for the given 'user'."
1.53
1.54 @@ -603,7 +615,13 @@
1.55 finally:
1.56 self.release_lock(user)
1.57
1.58 - return FreeBusyCollection(offers)
1.59 + return FreeBusyCollection(offers, mutable)
1.60 +
1.61 + def get_freebusy_offers_for_update(self, user):
1.62 +
1.63 + "Get free/busy offers for the given 'user'."
1.64 +
1.65 + return self.get_freebusy_offers(user, True)
1.66
1.67 def set_freebusy_offers(self, user, freebusy):
1.68
1.69 @@ -893,7 +911,7 @@
1.70
1.71 # Free/busy period access for users within quota groups.
1.72
1.73 - def get_freebusy(self, quota, user):
1.74 + def get_freebusy(self, quota, user, mutable=False):
1.75
1.76 "Get free/busy details for the given 'quota' and 'user'."
1.77
1.78 @@ -905,7 +923,13 @@
1.79 periods = map(lambda t: FreeBusyPeriod(*t),
1.80 self._get_table_atomic(quota, filename))
1.81
1.82 - return FreeBusyCollection(periods)
1.83 + return FreeBusyCollection(periods, mutable)
1.84 +
1.85 + def get_freebusy_for_update(self, quota, user):
1.86 +
1.87 + "Get free/busy details for the given 'quota' and 'user'."
1.88 +
1.89 + return self.get_freebusy(quota, user, True)
1.90
1.91 def set_freebusy(self, quota, user, freebusy):
1.92
1.93 @@ -921,7 +945,7 @@
1.94
1.95 # Journal entry methods.
1.96
1.97 - def get_entries(self, quota, group):
1.98 + def get_entries(self, quota, group, mutable=False):
1.99
1.100 """
1.101 Return a list of journal entries for the given 'quota' for the indicated
1.102 @@ -936,7 +960,16 @@
1.103 periods = map(lambda t: FreeBusyPeriod(*t),
1.104 self._get_table_atomic(quota, filename))
1.105
1.106 - return FreeBusyCollection(periods)
1.107 + return FreeBusyCollection(periods, mutable)
1.108 +
1.109 + def get_entries_for_update(self, quota, group):
1.110 +
1.111 + """
1.112 + Return a list of journal entries for the given 'quota' for the indicated
1.113 + 'group'.
1.114 + """
1.115 +
1.116 + return self.get_entries(quota, group, True)
1.117
1.118 def set_entries(self, quota, group, entries):
1.119