1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-17 15:23:43 +01:00

Removing unneeded from __future__ import statements.

Since we are on Python 3.6 and up, we don't need those anymore.
This commit is contained in:
2020-04-19 17:38:58 +02:00
parent 41b687ee27
commit 48fedea799
331 changed files with 1178 additions and 2067 deletions

View File

@@ -1,18 +1,17 @@
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
"""
This package contains logic to read and write LRF files.
The LRF file format is documented at U{http://www.sven.de/librie/Librie/LrfFormat}.
The LRF file format is documented at
http://www.sven.de/librie/Librie/LrfFormat.
"""
from ebook_converter.ebooks.lrf.pylrs.pylrs import Book as _Book
from ebook_converter.ebooks.lrf.pylrs.pylrs import TextBlock, Header, \
TextStyle, BlockStyle
from ebook_converter.ebooks.lrf.fonts import FONT_FILE_MAP
from ebook_converter.ebooks import ConversionError
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = "epytext"

View File

@@ -1,16 +1,13 @@
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
"""
Default fonts used in the PRS500
"""
from PIL import ImageFont
from ebook_converter.utils.fonts.scanner import font_scanner
'''
Default fonts used in the PRS500
'''
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
LIBERATION_FONT_MAP = {'Swis721 BT Roman': 'Liberation Sans Regular',
'Dutch801 Rm BT Roman': 'Liberation Serif Regular',

View File

@@ -1,10 +1,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import re
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import re
NAME_MAP = {
'aliceblue': '#F0F8FF',
'antiquewhite': '#FAEBD7',

View File

@@ -1,7 +1,11 @@
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2008, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Code to convert HTML ebooks into LRF ebooks.
I am indebted to esperanc for the initial CSS->Xylog Style conversion code
and to Falstaff for pylrs.
License: GPLv3 Copyright: 2008, Kovid Goyal <kovid at kovidgoyal.net>
"""
import copy
import glob
import os
@@ -35,13 +39,6 @@ from ebook_converter.ptempfile import PersistentTemporaryFile
from ebook_converter.polyglot.builtins import getcwd, itervalues, string_or_bytes, unicode_type
from ebook_converter.polyglot.urllib import unquote, urlparse
"""
Code to convert HTML ebooks into LRF ebooks.
I am indebted to esperanc for the initial CSS->Xylog Style conversion code
and to Falstaff for pylrs.
"""
from PIL import Image as PILImage

View File

@@ -1,7 +1,3 @@
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import math, sys, re, numbers
from ebook_converter.ebooks.lrf.fonts import get_font
@@ -11,6 +7,10 @@ from ebook_converter.ebooks.lrf.pylrs.pylrs import TextBlock, Text, CR, Span, \
from ebook_converter.polyglot.builtins import string_or_bytes, range, native_string_type
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
def ceil(num):
return int(math.ceil(num))

View File

@@ -1,7 +0,0 @@
from __future__ import absolute_import, division, print_function, unicode_literals
"""
This package contains code to generate ebooks in the SONY LRS/F format. It was
originally developed by Mike Higgins and has been extended and modified by Kovid
Goyal.
"""

View File

@@ -1,7 +1,6 @@
from __future__ import absolute_import, division, print_function, unicode_literals
""" elements.py -- replacements and helpers for ElementTree """
"""
elements.py -- replacements and helpers for ElementTree
"""
from ebook_converter.polyglot.builtins import unicode_type, string_or_bytes

View File

@@ -1,9 +1,6 @@
#!/usr/bin/env python2
from __future__ import absolute_import, division, print_function, unicode_literals
"""
pylrf.py -- very low level interface to create lrf files. See pylrs for
higher level interface that can use this module to render books to lrf.
pylrf.py -- very low level interface to create lrf files. See pylrs for
higher level interface that can use this module to render books to lrf.
"""
import struct
import zlib

View File

@@ -1,6 +1,3 @@
from __future__ import absolute_import, division, print_function, unicode_literals
def _optimize(tagList, tagName, conversion):
# copy the tag of interest plus any text
newTagList = []

View File

@@ -1,5 +1,3 @@
from __future__ import absolute_import, division, print_function, unicode_literals
# Copyright (c) 2007 Mike Higgins (Falstaff)
# Modifications from the original:
# Copyright (C) 2007 Kovid Goyal <kovid@kovidgoyal.net>
@@ -37,7 +35,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera
# Other unsupported tags: PageDiv, SoundStop, Wait, pos,
# Plot, Image (outside of ImageBlock),
# EmpLine, EmpDots
import os, re, codecs, operator, io
from xml.sax.saxutils import escape
from datetime import date