diff --git a/fanficfare/story.py b/fanficfare/story.py index 6de6d699..6fa49fb9 100644 --- a/fanficfare/story.py +++ b/fanficfare/story.py @@ -148,7 +148,6 @@ except: return (data,imgtype,imagetypes[imgtype]) except: - raise # No calibre or PIL, simple pass through with mimetype. def convert_image(url,data,sizes,grayscale, removetrans,imgtype="jpg",background='#ffffff'): diff --git a/fanficfare/writers/writer_html.py b/fanficfare/writers/writer_html.py index 09664b82..39c2d78d 100644 --- a/fanficfare/writers/writer_html.py +++ b/fanficfare/writers/writer_html.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2011 Fanficdownloader team, 2016 FanFicFare team +# Copyright 2011 Fanficdownloader team, 2018 FanFicFare team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,13 +15,16 @@ # limitations under the License. # +from __future__ import absolute_import import logging import string +# py2 vs py3 transition +from six import text_type as unicode + import bs4 from .base_writer import * - class HTMLWriter(BaseStoryWriter): @staticmethod @@ -107,7 +110,7 @@ ${output_css} self._write(out,FILE_START.substitute(self.story.getAllMetadata())) if self.getConfig('include_images') and self.story.cover: - self._write(out,COVER.substitute(dict(self.story.getAllMetadata().items()+{'coverimg':self.story.cover}.items()))) + self._write(out,COVER.substitute(dict(list(self.story.getAllMetadata().items())+list({'coverimg':self.story.cover}.items())))) self.writeTitlePage(out, self.HTML_TITLE_PAGE_START, diff --git a/fanficfare/writers/writer_mobi.py b/fanficfare/writers/writer_mobi.py index ec7a2599..3806f077 100644 --- a/fanficfare/writers/writer_mobi.py +++ b/fanficfare/writers/writer_mobi.py @@ -25,9 +25,6 @@ from ..mobi import Converter from ..exceptions import FailedToWriteOutput # py2 vs py3 transition -from six import text_type as unicode -from six import string_types as basestring -from six import binary_type as bytes from six import BytesIO # StringIO under py2 logger = logging.getLogger(__name__) diff --git a/fanficfare/writers/writer_txt.py b/fanficfare/writers/writer_txt.py index 7199311e..9f3c9980 100644 --- a/fanficfare/writers/writer_txt.py +++ b/fanficfare/writers/writer_txt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2011 Fanficdownloader team, 2015 FanFicFare team +# Copyright 2011 Fanficdownloader team, 2018 FanFicFare team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ # limitations under the License. # +from __future__ import absolute_import import logging import string from textwrap import wrap