From 2eeacf4030fce3f4bf6371a610c609784cb75cef Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Wed, 20 Jan 2010 21:41:43 -0200 Subject: [PATCH] forgot to save --- mitterlib/network/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mitterlib/network/__init__.py b/mitterlib/network/__init__.py index 817c696..2aac990 100644 --- a/mitterlib/network/__init__.py +++ b/mitterlib/network/__init__.py @@ -180,6 +180,10 @@ class Networks(object): message.network = shortcut result.append(message) self._operations += 1 + # don't check the operations count inside the loop; if Mitter + # fails, all the last messages can still be retrieved ('cause the + # config file wasn't saved yet.) + self._save() return result def update(self, status, reply_to=None, network=None): @@ -192,6 +196,7 @@ class Networks(object): for shortcut in self._targets(network): results.append(self.networks[shortcut].update(status, reply_to)) self._operations += 1 + self._save() return results def reply_prefix(self, message): @@ -205,6 +210,7 @@ class Networks(object): assert(isinstance(message, NetworkData)) self.networks[message.network].repost(message) self._operations += 1 + self._save() return def favourite(self, message): @@ -212,6 +218,7 @@ class Networks(object): assert(isinstance(message, NetworkData)) self.networks[message.network].favourite(message) self._operations += 1 + self._save() return def delete_message(self, message, network=None): @@ -223,6 +230,7 @@ class Networks(object): self.networks[network].delete_message(message) self._operations += 1 + self._save() return def message(self, message_id, network): @@ -235,6 +243,7 @@ class Networks(object): data = self.networks[network].message(message_id) data.network = network self._operations += 1 + self._save() return data def link(self, message): @@ -251,6 +260,7 @@ class Networks(object): message.network = shortcut result.append(message) self._operations += 1 + self._save() return result def available_requests(self, network=None):