mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48: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
2 changed files with 5 additions and 1 deletions
|
@ -156,6 +156,9 @@ class Config(object):
|
||||||
|
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
|
def __contains__(self, item):
|
||||||
|
return item in self.__config
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
"""
|
"""
|
||||||
See
|
See
|
||||||
|
|
|
@ -463,7 +463,8 @@ class DelugeWeb(component.Component):
|
||||||
# all the values across to the new config file, and then remove
|
# all the values across to the new config file, and then remove
|
||||||
# it.
|
# it.
|
||||||
for key in OLD_CONFIG_KEYS:
|
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
|
# We need to base64 encode the passwords since json can't handle
|
||||||
# them otherwise.
|
# them otherwise.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue