mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-16 21:36:40 +00:00
add a __contains__ method to the config class
fix upgrading old configs when the key doesn't exist in the old config
This commit is contained in:
parent
0819697c5b
commit
708ad2e665
@ -156,6 +156,9 @@ class Config(object):
|
||||
|
||||
self.load()
|
||||
|
||||
def __contains__(self, item):
|
||||
return item in self.__config
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
"""
|
||||
See
|
||||
|
@ -463,7 +463,8 @@ class DelugeWeb(component.Component):
|
||||
# all the values across to the new config file, and then remove
|
||||
# it.
|
||||
for key in OLD_CONFIG_KEYS:
|
||||
self.config[key] = old_config[key]
|
||||
if key in old_config:
|
||||
self.config[key] = old_config[key]
|
||||
|
||||
# We need to base64 encode the passwords since json can't handle
|
||||
# them otherwise.
|
||||
|
Loading…
x
Reference in New Issue
Block a user