From 9daaa814379aa3164c4d9d3f3416539d671fa83a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 May 2015 21:34:41 +0530 Subject: [PATCH] Fix detection of plugin class in the KePub metadata plugins --- setup/plugins_mirror.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/plugins_mirror.py b/setup/plugins_mirror.py index f055da7249..08d1c9de37 100644 --- a/setup/plugins_mirror.py +++ b/setup/plugins_mirror.py @@ -131,6 +131,9 @@ def convert_node(fields, x, names={}, import_data=None): return get_import_data(x.id, import_data[0][x.id], *import_data[1:]) raise ValueError('Could not find name %s for fields: %s' % (x.id, fields)) return names[x.id] + elif name == 'BinOp': + if x.right.__class__.__name__ == 'Str': + return x.right.s.decode('utf-8') if isinstance(x.right.s, bytes) else x.right.s raise TypeError('Unknown datatype %s for fields: %s' % (x, fields)) Alias = namedtuple('Alias', 'name asname') @@ -174,7 +177,7 @@ def parse_metadata(raw, namelist, zf): if mod in { 'calibre.customize', 'calibre.customize.conversion', 'calibre.ebooks.metadata.sources.base', 'calibre.ebooks.metadata.covers', - 'calibre.devices.interface', 'calibre.ebooks.metadata.fetch', + 'calibre.devices.interface', 'calibre.ebooks.metadata.fetch', 'calibre.customize.builtins', } or re.match(r'calibre\.devices\.[a-z0-9]+\.driver', mod) is not None: inames = {n.asname or n.name for n in names} inames = {x for x in inames if x.lower() != x}