From 2766c103e2ba123575097d8b3e16584496e5da6c Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 7 May 2009 15:32:21 +0000 Subject: [PATCH] change the config class to return true or false on a save to show whether or not it was successful --- deluge/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deluge/config.py b/deluge/config.py index 27b09ee93..497a9f944 100644 --- a/deluge/config.py +++ b/deluge/config.py @@ -251,6 +251,8 @@ class Config(object): Save configuration to disk :param filename: if None, uses filename set in object initiliazation + :rtype bool: + :return: whether or not the save succeeded. """ if not filename: @@ -277,7 +279,7 @@ class Config(object): f.close() except Exception, e: log.error("Error writing new config file: %s", e) - return + return False # Make a backup of the old config try: @@ -293,7 +295,9 @@ class Config(object): shutil.move(filename + ".new", filename) except Exception, e: log.error("Error moving new config file: %s", e) - return + return False + else: + return True @property def config_file(self):