From 91b960b797bbf17f6c4b33279f2d406c5a2c93b2 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 5 Apr 2013 23:57:53 +0200 Subject: Handle I/O errors better MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Do not crash because of low disk space - Notify the user whenever it happens - A few functions now return a boolean instead of nothing - Config.silent_set is Config.set_and_save without toggle and returning strings. It is used whenever we don’t need set_and_save - Config.set_and_save now returns a tuple (that can be passed directly to core.information()) TODO: display the precise error to the user (instead of “unable to…”) --- src/roster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/roster.py') diff --git a/src/roster.py b/src/roster.py index 67e81da9..b0f3cf65 100644 --- a/src/roster.py +++ b/src/roster.py @@ -141,7 +141,7 @@ class Roster(object): folded_groups = ':'.join([group.name for group in self.groups.values()\ if group.folded]) log.debug('folded:%s\n' %folded_groups) - config.set_and_save('folded_roster_groups', folded_groups, 'var') + return config.silent_set('folded_roster_groups', folded_groups, 'var') def get_nb_connected_contacts(self): """ -- cgit v1.2.3