Author: damoxc

Revision: 5238

Log:
        change the config class to return true or false on a save to show 
whether or not it was successful

Diff:
Modified: trunk/deluge/config.py
===================================================================
--- trunk/deluge/config.py      2009-05-07 15:09:13 UTC (rev 5237)
+++ trunk/deluge/config.py      2009-05-07 15:32:21 UTC (rev 5238)
@@ -251,6 +251,8 @@
         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 @@
             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 @@
             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):



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to