txt2ebook 0.1.143__tar.gz → 0.1.145__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- txt2ebook-0.1.145/.pre-commit-config.yaml +49 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/CHANGELOG.md +16 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/PKG-INFO +1 -1
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/noxfile.py +24 -6
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/pyproject.toml +20 -21
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po +6 -6
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/txt2ebook.pot +6 -6
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po +6 -6
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po +6 -6
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/models/book.py +1 -3
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/massage.py +3 -1
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/uv.lock +411 -274
- txt2ebook-0.1.143/.pre-commit-config.yaml +0 -117
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/.coveragerc +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/.gitignore +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/.python-version +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/CONTRIBUTING.md +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/LICENSE.md +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/README.md +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/Makefile +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/make.bat +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/CHANGELOG.md +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/CONTRIBUTING.md +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/LICENSE.md +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/README.md +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/_static/logo.png +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/conf.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/index.rst +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/txt2ebook.formats.rst +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/txt2ebook.helpers.rst +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/txt2ebook.models.rst +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/txt2ebook.parsers.rst +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/docs/source/txt2ebook.rst +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/__main__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/cli.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/exceptions.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/base.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/epub.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/gmi.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/md.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/pdf.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/templates/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/templates/epub/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/templates/epub/clean.css +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/templates/epub/condense.css +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/templates/epub/noindent.css +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/tex.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/txt.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/formats/typ.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/helpers/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/languages/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/languages/en.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/languages/zh_cn.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/languages/zh_tw.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/models/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/models/chapter.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/models/volume.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/parser.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/env.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/epub.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/gmi.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/md.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/parse.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/pdf.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/tex.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/subcommands/typ.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/tokenizer.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/zh_utils.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/__init__.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/conftest.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/empty_file.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/missing_chapters.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/sample.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/sample_all_headers.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/sample_long_headers.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/sample_remove_wrapping.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/sample_unsorted_headers.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/sample_with_issues.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/fixtures/sample_with_metadata.txt +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_epub_writer.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_filename_format_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_format_option.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_header_number_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_input_file_arg.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_language_option.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_output_file_arg.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_overwrite_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_parser.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_purge_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_quiet_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_raise_warnings.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_sort_volume_and_chapter_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_split_volume_and_chapter_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_subcommand_env.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_subcommand_epub.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_subcommand_massage.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_test_parsing_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_tokenizer.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_translator_option.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_txt2ebook.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_verbose_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_volume_page_flag.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_zh_utils_zh_halfwidth_to_fullwidth.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_zh_utils_zh_numeric.py +0 -0
- {txt2ebook-0.1.143 → txt2ebook-0.1.145}/tests/test_zh_utils_zh_words_to_numbers.py +0 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
# See https://pre-commit.com for more information
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
3
|
+
repos:
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
5
|
+
rev: v5.0.0
|
6
|
+
hooks:
|
7
|
+
- id: check-case-conflict
|
8
|
+
- id: check-merge-conflict
|
9
|
+
- id: check-toml
|
10
|
+
- id: check-yaml
|
11
|
+
- id: debug-statements
|
12
|
+
- id: detect-private-key
|
13
|
+
- id: end-of-file-fixer
|
14
|
+
exclude: "locales/.*$"
|
15
|
+
- id: mixed-line-ending
|
16
|
+
- id: trailing-whitespace
|
17
|
+
|
18
|
+
- repo: https://github.com/abravalheri/validate-pyproject
|
19
|
+
rev: v0.24.1
|
20
|
+
hooks:
|
21
|
+
- id: validate-pyproject
|
22
|
+
name: validate pyproject
|
23
|
+
|
24
|
+
- repo: https://github.com/codespell-project/codespell
|
25
|
+
rev: v2.4.1
|
26
|
+
hooks:
|
27
|
+
- id: codespell
|
28
|
+
args:
|
29
|
+
- --skip=uv.lock
|
30
|
+
|
31
|
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
32
|
+
rev: v4.0.0-alpha.8
|
33
|
+
hooks:
|
34
|
+
- id: prettier
|
35
|
+
exclude: (poetry.lock)
|
36
|
+
|
37
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
38
|
+
rev: v0.12.0
|
39
|
+
hooks:
|
40
|
+
- id: ruff-check
|
41
|
+
args:
|
42
|
+
- --fix
|
43
|
+
- --exit-non-zero-on-fix
|
44
|
+
|
45
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
46
|
+
rev: v1.16.1
|
47
|
+
hooks:
|
48
|
+
- id: mypy
|
49
|
+
exclude: docs/
|
@@ -7,6 +7,22 @@ and this project adheres to [0-based versioning](https://0ver.org/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## v0.1.145 (2025-06-22)
|
11
|
+
|
12
|
+
- Bump deps and `pre-commit` hooks
|
13
|
+
- Clear previous release builds before releasing
|
14
|
+
- Remove other lint tools from `pre-commit`
|
15
|
+
- Update translations
|
16
|
+
|
17
|
+
## v0.1.144 (2025-06-15)
|
18
|
+
|
19
|
+
- Bump deps
|
20
|
+
- Bump `pre-commit` hook for `ruff`
|
21
|
+
- Fix deps upgrade and relax deps requirements
|
22
|
+
- Fix incorrect type in args
|
23
|
+
- Fix missing langconf to parser class
|
24
|
+
- Resolve `uv` not using nox's `venv` warning
|
25
|
+
|
10
26
|
## v0.1.143 (2025-06-08)
|
11
27
|
|
12
28
|
- Add `ruff` to `pre-commit` hook
|
@@ -15,6 +15,8 @@
|
|
15
15
|
|
16
16
|
"""Nox configuration."""
|
17
17
|
|
18
|
+
import os
|
19
|
+
import shutil
|
18
20
|
import datetime
|
19
21
|
|
20
22
|
import nox
|
@@ -25,11 +27,10 @@ nox.options.default_venv_backend = "uv"
|
|
25
27
|
@nox.session(python="3.9")
|
26
28
|
def deps(session: nox.Session) -> None:
|
27
29
|
"""Update pre-commit hooks and deps."""
|
28
|
-
session
|
30
|
+
_uv_install(session)
|
29
31
|
session.run("pre-commit", "autoupdate", *session.posargs)
|
30
32
|
|
31
33
|
|
32
|
-
@nox.session()
|
33
34
|
@nox.session(python="3.13")
|
34
35
|
def lint(session: nox.Session) -> None:
|
35
36
|
"""Run pre-commit tasks.
|
@@ -212,14 +213,12 @@ def release(session: nox.Session) -> None:
|
|
212
213
|
|
213
214
|
prompt = "Build and publish package to pypi? (y/n): "
|
214
215
|
if input(prompt).lower() in ["y", "yes"]:
|
216
|
+
dist_dir = os.path.join(os.getcwd(), "dist")
|
217
|
+
shutil.rmtree(dist_dir)
|
215
218
|
session.run("uv", "build")
|
216
219
|
session.run("uv", "publish")
|
217
220
|
|
218
221
|
|
219
|
-
def _uv_install(session: nox.Session) -> None:
|
220
|
-
session.run("uv", "sync", "--active")
|
221
|
-
|
222
|
-
|
223
222
|
def _search_and_replace(file, search, replace) -> None:
|
224
223
|
with open(file, "r+", encoding="utf8") as f:
|
225
224
|
content = f.read()
|
@@ -227,3 +226,22 @@ def _search_and_replace(file, search, replace) -> None:
|
|
227
226
|
f.seek(0)
|
228
227
|
f.write(content)
|
229
228
|
f.truncate()
|
229
|
+
|
230
|
+
|
231
|
+
def _uv_install(session: nox.Session) -> None:
|
232
|
+
"""Install the project and its development dependencies using uv.
|
233
|
+
|
234
|
+
This also resolves the following error:
|
235
|
+
warning: `VIRTUAL_ENV=.nox/lint` does not match the project environment
|
236
|
+
path `.venv` and will be ignored
|
237
|
+
|
238
|
+
See https://nox.thea.codes/en/stable/cookbook.html#using-a-lockfile
|
239
|
+
"""
|
240
|
+
session.run_install(
|
241
|
+
"uv",
|
242
|
+
"sync",
|
243
|
+
"--upgrade",
|
244
|
+
"--all-packages",
|
245
|
+
f"--python={session.virtualenv.location}",
|
246
|
+
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
|
247
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "txt2ebook"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.145"
|
4
4
|
description = "CLI tool to convert txt file to ebook format"
|
5
5
|
authors = [{ name = "Kian-Meng Ang", email = "kianmeng@cpan.org" }]
|
6
6
|
requires-python = "~=3.9"
|
@@ -57,26 +57,25 @@ tte = "txt2ebook.cli:main"
|
|
57
57
|
|
58
58
|
[dependency-groups]
|
59
59
|
dev = [
|
60
|
-
"babel
|
61
|
-
"bandit
|
62
|
-
"flake8-simplify
|
63
|
-
"mypy
|
64
|
-
"myst-parser
|
65
|
-
"nox
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
70
|
-
"pytest-
|
71
|
-
"pytest-
|
72
|
-
"pytest
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"sphinx-
|
77
|
-
"sphinx
|
78
|
-
"
|
79
|
-
"vulture~=2.11",
|
60
|
+
"babel",
|
61
|
+
"bandit",
|
62
|
+
"flake8-simplify",
|
63
|
+
"mypy",
|
64
|
+
"myst-parser",
|
65
|
+
"nox",
|
66
|
+
"pep8-naming",
|
67
|
+
"pre-commit",
|
68
|
+
"pylint",
|
69
|
+
"pytest-cov",
|
70
|
+
"pytest-randomly",
|
71
|
+
"pytest-xdist",
|
72
|
+
"pytest",
|
73
|
+
"ruff",
|
74
|
+
"scripttest",
|
75
|
+
"sphinx-autodoc-typehints",
|
76
|
+
"sphinx-copybutton",
|
77
|
+
"sphinx",
|
78
|
+
"vulture",
|
80
79
|
]
|
81
80
|
|
82
81
|
[build-system]
|
@@ -1,26 +1,26 @@
|
|
1
|
-
#: src/txt2ebook/formats/base.py:
|
1
|
+
#: src/txt2ebook/formats/base.py:137
|
2
2
|
msgid "title:"
|
3
3
|
msgstr "Title:"
|
4
4
|
|
5
|
-
#: src/txt2ebook/formats/base.py:
|
5
|
+
#: src/txt2ebook/formats/base.py:138
|
6
6
|
msgid "author:"
|
7
7
|
msgstr "Author:"
|
8
8
|
|
9
|
-
#: src/txt2ebook/formats/base.py:
|
9
|
+
#: src/txt2ebook/formats/base.py:139
|
10
10
|
msgid "translator:"
|
11
11
|
msgstr "Translator:"
|
12
12
|
|
13
|
-
#: src/txt2ebook/formats/base.py:
|
13
|
+
#: src/txt2ebook/formats/base.py:140
|
14
14
|
msgid "tag:"
|
15
15
|
msgstr "Tag:"
|
16
16
|
|
17
|
-
#: src/txt2ebook/formats/base.py:
|
17
|
+
#: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
|
18
18
|
#: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
|
19
19
|
#: src/txt2ebook/formats/txt.py:71
|
20
20
|
msgid "toc"
|
21
21
|
msgstr "Table of Content"
|
22
22
|
|
23
|
-
#: src/txt2ebook/formats/epub.py:
|
23
|
+
#: src/txt2ebook/formats/epub.py:141
|
24
24
|
msgid "cover"
|
25
25
|
msgstr "Cover"
|
26
26
|
|
@@ -1,26 +1,26 @@
|
|
1
|
-
#: src/txt2ebook/formats/base.py:
|
1
|
+
#: src/txt2ebook/formats/base.py:137
|
2
2
|
msgid "title:"
|
3
3
|
msgstr ""
|
4
4
|
|
5
|
-
#: src/txt2ebook/formats/base.py:
|
5
|
+
#: src/txt2ebook/formats/base.py:138
|
6
6
|
msgid "author:"
|
7
7
|
msgstr ""
|
8
8
|
|
9
|
-
#: src/txt2ebook/formats/base.py:
|
9
|
+
#: src/txt2ebook/formats/base.py:139
|
10
10
|
msgid "translator:"
|
11
11
|
msgstr ""
|
12
12
|
|
13
|
-
#: src/txt2ebook/formats/base.py:
|
13
|
+
#: src/txt2ebook/formats/base.py:140
|
14
14
|
msgid "tag:"
|
15
15
|
msgstr ""
|
16
16
|
|
17
|
-
#: src/txt2ebook/formats/base.py:
|
17
|
+
#: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
|
18
18
|
#: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
|
19
19
|
#: src/txt2ebook/formats/txt.py:71
|
20
20
|
msgid "toc"
|
21
21
|
msgstr ""
|
22
22
|
|
23
|
-
#: src/txt2ebook/formats/epub.py:
|
23
|
+
#: src/txt2ebook/formats/epub.py:141
|
24
24
|
msgid "cover"
|
25
25
|
msgstr ""
|
26
26
|
|
{txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po
RENAMED
@@ -1,26 +1,26 @@
|
|
1
|
-
#: src/txt2ebook/formats/base.py:
|
1
|
+
#: src/txt2ebook/formats/base.py:137
|
2
2
|
msgid "title:"
|
3
3
|
msgstr "书名:"
|
4
4
|
|
5
|
-
#: src/txt2ebook/formats/base.py:
|
5
|
+
#: src/txt2ebook/formats/base.py:138
|
6
6
|
msgid "author:"
|
7
7
|
msgstr "作者:"
|
8
8
|
|
9
|
-
#: src/txt2ebook/formats/base.py:
|
9
|
+
#: src/txt2ebook/formats/base.py:139
|
10
10
|
msgid "translator:"
|
11
11
|
msgstr "翻译:"
|
12
12
|
|
13
|
-
#: src/txt2ebook/formats/base.py:
|
13
|
+
#: src/txt2ebook/formats/base.py:140
|
14
14
|
msgid "tag:"
|
15
15
|
msgstr "票签:"
|
16
16
|
|
17
|
-
#: src/txt2ebook/formats/base.py:
|
17
|
+
#: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
|
18
18
|
#: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
|
19
19
|
#: src/txt2ebook/formats/txt.py:71
|
20
20
|
msgid "toc"
|
21
21
|
msgstr "目录"
|
22
22
|
|
23
|
-
#: src/txt2ebook/formats/epub.py:
|
23
|
+
#: src/txt2ebook/formats/epub.py:141
|
24
24
|
msgid "cover"
|
25
25
|
msgstr "封面"
|
26
26
|
|
{txt2ebook-0.1.143 → txt2ebook-0.1.145}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po
RENAMED
@@ -1,26 +1,26 @@
|
|
1
|
-
#: src/txt2ebook/formats/base.py:
|
1
|
+
#: src/txt2ebook/formats/base.py:137
|
2
2
|
msgid "title:"
|
3
3
|
msgstr "书名:"
|
4
4
|
|
5
|
-
#: src/txt2ebook/formats/base.py:
|
5
|
+
#: src/txt2ebook/formats/base.py:138
|
6
6
|
msgid "author:"
|
7
7
|
msgstr "作者:"
|
8
8
|
|
9
|
-
#: src/txt2ebook/formats/base.py:
|
9
|
+
#: src/txt2ebook/formats/base.py:139
|
10
10
|
msgid "translator:"
|
11
11
|
msgstr "翻译:"
|
12
12
|
|
13
|
-
#: src/txt2ebook/formats/base.py:
|
13
|
+
#: src/txt2ebook/formats/base.py:140
|
14
14
|
msgid "tag:"
|
15
15
|
msgstr "标签:"
|
16
16
|
|
17
|
-
#: src/txt2ebook/formats/base.py:
|
17
|
+
#: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
|
18
18
|
#: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
|
19
19
|
#: src/txt2ebook/formats/txt.py:71
|
20
20
|
msgid "toc"
|
21
21
|
msgstr "目录"
|
22
22
|
|
23
|
-
#: src/txt2ebook/formats/epub.py:
|
23
|
+
#: src/txt2ebook/formats/epub.py:141
|
24
24
|
msgid "cover"
|
25
25
|
msgstr "封面"
|
26
26
|
|
@@ -20,8 +20,6 @@ from collections import Counter
|
|
20
20
|
from dataclasses import dataclass, field
|
21
21
|
from typing import List, Union
|
22
22
|
|
23
|
-
from typing_extensions import Literal
|
24
|
-
|
25
23
|
from txt2ebook.models.chapter import Chapter
|
26
24
|
from txt2ebook.models.volume import Volume
|
27
25
|
|
@@ -52,7 +50,7 @@ class Book:
|
|
52
50
|
logger.debug("Book stats: %s", repr(stats))
|
53
51
|
return stats
|
54
52
|
|
55
|
-
def filename_format(self, filename_format:
|
53
|
+
def filename_format(self, filename_format: int) -> str:
|
56
54
|
"""Generate the filename format based on the available selection."""
|
57
55
|
authors = ", ".join(self.authors)
|
58
56
|
format_options = {
|
@@ -202,8 +202,10 @@ def run(args: argparse.Namespace) -> None:
|
|
202
202
|
"""
|
203
203
|
massaged_txt = massage_txt(args)
|
204
204
|
args.language = detect_and_expect_language(massaged_txt, args.language)
|
205
|
+
config_lang = args.language.replace("-", "_")
|
206
|
+
langconf = import_module(f"txt2ebook.languages.{config_lang}")
|
205
207
|
args.with_toc = False
|
206
|
-
parser = Parser(massaged_txt, args)
|
208
|
+
parser = Parser(massaged_txt, args, langconf)
|
207
209
|
book = parser.parse()
|
208
210
|
|
209
211
|
if args.debug:
|