mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 08:58:38 +00:00
Fix up to __getitem__ in TorrentOptions
This commit is contained in:
parent
489d805cb4
commit
9cd3e7cf56
1 changed files with 4 additions and 5 deletions
|
@ -95,13 +95,12 @@ class TorrentOptions(dict):
|
||||||
super(TorrentOptions, self).__setitem__(key, value)
|
super(TorrentOptions, self).__setitem__(key, value)
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
if super(TorrentOptions, self).has_key(key):
|
if key in super(TorrentOptions, self):
|
||||||
return super(TorrentOptions, self).__getitem__(key)
|
return super(TorrentOptions, self).__getitem__(key)
|
||||||
else:
|
elif key in self.default_keys and self.default_keys[key] in self.config:
|
||||||
if key in self.config:
|
|
||||||
return self.config[self.default_keys[key]]
|
return self.config[self.default_keys[key]]
|
||||||
else:
|
else:
|
||||||
return self.default_keys[key]
|
raise KeyError
|
||||||
|
|
||||||
class Torrent:
|
class Torrent:
|
||||||
"""Torrent holds information about torrents added to the libtorrent session.
|
"""Torrent holds information about torrents added to the libtorrent session.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue