Author: andar
Revision: 5455
Log:
The default format version and file version should be 1
Diff:
Modified: trunk/deluge/config.py
===================================================================
--- trunk/deluge/config.py 2009-07-05 16:27:22 UTC (rev 5454)
+++ trunk/deluge/config.py 2009-07-05 17:42:36 UTC (rev 5455)
@@ -105,8 +105,8 @@
self.__change_callbacks = []
# These hold the version numbers and they will be set when loaded
- self.__format_version = None
- self.__file_version = None
+ self.__format_version = 1
+ self.__file_version = 1
# This will get set with a reactor.callLater whenever a config option
# is set.
@@ -331,6 +331,7 @@
try:
self.__config.update(json.loads(fdata))
except Exception, e:
+ log.exception(e)
try:
self.__config.update(pickle.loads(fdata))
except Exception, e:
@@ -357,8 +358,9 @@
# We will only write a new config file if there is a difference
try:
data = open(filename, "rb")
- data.seek(4)
- loaded_data = json.load(data)
+ data.readline()
+ data.readline()
+ loaded_data = json.loads(data.read())
data.close()
if self.__config == loaded_data:
# The config has not changed so lets just return
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---