From 5048ecbf84f19c287891bfad5d33aad558879462 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 May 2018 11:48:40 +0530 Subject: [PATCH] pep8 --- src/calibre/ebooks/oeb/stylizer.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index bead48ba01..dba9a388d6 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -133,8 +133,7 @@ class Stylizer(object): log=logging.getLogger('calibre.css')) self.font_face_rules = [] for elem in style_tags: - if (elem.tag == XHTML('style') and - elem.get('type', CSS_MIME) in OEB_STYLES and media_ok(elem.get('media'))): + if (elem.tag == XHTML('style') and elem.get('type', CSS_MIME) in OEB_STYLES and media_ok(elem.get('media'))): text = elem.text if elem.text else u'' for x in elem: t = getattr(x, 'text', None) @@ -171,11 +170,10 @@ class Stylizer(object): replaceUrls(stylesheet, item.abshref, ignoreImportRules=True) stylesheets.append(stylesheet) - elif (elem.tag == XHTML('link') and elem.get('href') and - elem.get('rel', 'stylesheet').lower() == 'stylesheet' and - elem.get('type', CSS_MIME).lower() in OEB_STYLES and - media_ok(elem.get('media')) - ): + elif (elem.tag == XHTML('link') and elem.get('href') and elem.get( + 'rel', 'stylesheet').lower() == 'stylesheet' and elem.get( + 'type', CSS_MIME).lower() in OEB_STYLES and media_ok(elem.get('media')) + ): href = urlnormalize(elem.attrib['href']) path = item.abshref(href) sitem = oeb.manifest.hrefs.get(path, None)