Imports rearrangements, readme reformat, basic stuff.
Smoke tests are 100/100.
This commit is contained in:
@@ -3,6 +3,7 @@ import collections
|
||||
import copy
|
||||
import datetime
|
||||
import functools
|
||||
import importlib.resources
|
||||
import json
|
||||
import numbers
|
||||
import os
|
||||
@@ -10,8 +11,6 @@ import pickle
|
||||
import re
|
||||
import traceback
|
||||
|
||||
from importlib.resources import files as _resource_files
|
||||
|
||||
from ebook_converter.constants_old import config_dir
|
||||
from ebook_converter.constants_old import filesystem_encoding
|
||||
from ebook_converter.constants_old import preferred_encoding
|
||||
@@ -591,7 +590,8 @@ def exec_tweaks(path):
|
||||
|
||||
|
||||
def default_tweaks_raw():
|
||||
return str(_resource_files('ebook_converter').joinpath('data/default_tweaks.py'))
|
||||
return str(importlib.resources.files('ebook_converter') /
|
||||
'data/default_tweaks.py')
|
||||
|
||||
|
||||
def read_tweaks():
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import importlib.resources
|
||||
import json
|
||||
from importlib.resources import files
|
||||
|
||||
|
||||
def get_lang():
|
||||
@@ -39,9 +39,8 @@ def _load_iso639():
|
||||
# excerpt form Calibre transform code which is executed during Calibre
|
||||
# build).
|
||||
if _iso639 is None:
|
||||
src = str(files('ebook_converter').joinpath('data/iso_639-3.json'))
|
||||
|
||||
with open(src, 'rb') as f:
|
||||
with open(importlib.resources.files('ebook_converter') /
|
||||
'data/iso_639-3.json', 'rb') as f:
|
||||
root = json.load(f)
|
||||
|
||||
entries = root['639-3']
|
||||
|
||||
Reference in New Issue
Block a user