diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Server/Plugin.py | 3 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Pkgmgr.py | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index fa5e3ca9d..3e3616f46 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -881,6 +881,9 @@ class PrioDir(Plugin, Generator, XMLDirectoryBacked): if self._matches(entry, metadata, [rname]): data = matching[index].cache[1][entry.tag][rname] break + else: + # Fall back on __getitem__. Required if override used + data = matching[index].cache[1][entry.tag][entry.get('name')] if '__text__' in data: entry.text = data['__text__'] if '__children__' in data: diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py index bc11bfdcf..2a8623379 100644 --- a/src/lib/Server/Plugins/Pkgmgr.py +++ b/src/lib/Server/Plugins/Pkgmgr.py @@ -25,12 +25,14 @@ class FuzzyDict(dict): print("got non-string key %s" % str(key)) return dict.__getitem__(self, key) - def has_key(self, key): + def __contains__(self, key): if isinstance(key, str): mdata = self.fuzzy.match(key) - if self.fuzzy.match(key): - return dict.has_key(self, mdata.groupdict()['name']) - return dict.has_key(self, key) + if mdata: + return dict.__contains__(self, mdata.groupdict()['name']) + else: + print("got non-string key %s" % str(key)) + return dict.__contains__(self, key) def get(self, key, default=None): try: |