From 4ca2847b66d06d6ab469b6273e7dc72efa58ca4d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 1 Nov 2020 07:03:03 +0530 Subject: [PATCH] Add a has_key() method to the config classes for third party plugins that have not been ported to python 3 --- src/calibre/utils/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/utils/config.py b/src/calibre/utils/config.py index 924c1db9ac..68294d8733 100644 --- a/src/calibre/utils/config.py +++ b/src/calibre/utils/config.py @@ -362,6 +362,9 @@ class XMLConfig(dict): self.clear() self.update(d) + def has_key(self, key): + return dict.__contains__(self, key) + def __getitem__(self, key): try: return dict.__getitem__(self, key)