1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-13 00:43:34 +02: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,16 +1,9 @@
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
'''
All fields must have a NULL value represented as None for simple types,
an empty list/dictionary for complex types and (None, None) for cover_data
'''
# All fields must have a NULL value represented as None for simple types,
# an empty list/dictionary for complex types and (None, None) for cover_data
SOCIAL_METADATA_FIELDS = frozenset((
'tags', # Ordered list
'rating', # A floating point number between 0 and 10
@@ -22,10 +15,7 @@ SOCIAL_METADATA_FIELDS = frozenset((
'identifiers',
))
'''
The list of names that convert to identifiers when in get and set.
'''
# The list of names that convert to identifiers when in get and set.
TOP_LEVEL_IDENTIFIERS = frozenset((
'isbn',
))
@@ -128,5 +118,5 @@ SERIALIZABLE_FIELDS = SOCIAL_METADATA_FIELDS.union(
CALIBRE_METADATA_FIELDS).union(
DEVICE_METADATA_FIELDS) - \
frozenset(('device_collections', 'formats',
'cover_data'))
'cover_data'))
# these are rebuilt when needed

View File

@@ -1,11 +1,3 @@
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import copy, traceback
from ebook_converter import prints
@@ -17,6 +9,11 @@ from ebook_converter.library.field_metadata import FieldMetadata
from ebook_converter.utils.icu import sort_key
from ebook_converter.polyglot.builtins import iteritems, unicode_type, filter, map
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
# Special sets used to optimize the performance of getting and setting
# attributes on Metadata objects
SIMPLE_GET = frozenset(STANDARD_METADATA_FIELDS - TOP_LEVEL_IDENTIFIERS)

View File

@@ -1,15 +1,12 @@
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from ebook_converter.ebooks.metadata.book import TOP_LEVEL_IDENTIFIERS, ALL_METADATA_FIELDS
from ebook_converter.utils.formatter import TemplateFormatter
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
class SafeFormat(TemplateFormatter):
def __init__(self):

View File

@@ -1,11 +1,8 @@
from __future__ import absolute_import, division, print_function, unicode_literals
'''
"""
Created on 4 Jun 2010
@author: charles
'''
"""
import json, traceback
from datetime import datetime, time
@@ -16,6 +13,7 @@ from ebook_converter import isbytestring
from ebook_converter.polyglot.builtins import iteritems, itervalues, as_bytes
from ebook_converter.polyglot.binary import as_base64_unicode, from_base64_bytes
# Translate datetimes to and from strings. The string form is the datetime in
# UTC. The returned date is also UTC