txt2ebook 0.1.140__tar.gz → 0.1.141__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.140 → txt2ebook-0.1.141}/CHANGELOG.md +5 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/PKG-INFO +4 -4
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/README.md +3 -3
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/noxfile.py +3 -2
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/pyproject.toml +19 -19
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/sample.txt +10 -0
- txt2ebook-0.1.141/tests/test_subcommand_massage.py +115 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/uv.lock +77 -73
- txt2ebook-0.1.140/tests/test_subcommand_massage.py +0 -36
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/.coveragerc +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/.gitignore +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/.pre-commit-config.yaml +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/.python-version +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/CONTRIBUTING.md +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/LICENSE.md +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/Makefile +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/make.bat +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/CHANGELOG.md +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/CONTRIBUTING.md +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/LICENSE.md +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/README.md +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/_static/logo.png +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/conf.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/index.rst +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/txt2ebook.formats.rst +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/txt2ebook.helpers.rst +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/txt2ebook.models.rst +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/txt2ebook.parsers.rst +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/docs/source/txt2ebook.rst +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/__main__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/cli.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/exceptions.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/base.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/epub.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/gmi.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/md.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/pdf.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/templates/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/templates/epub/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/templates/epub/clean.css +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/templates/epub/condense.css +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/templates/epub/noindent.css +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/tex.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/txt.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/formats/typ.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/helpers/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/languages/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/languages/en.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/languages/zh_cn.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/languages/zh_tw.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/txt2ebook.pot +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/models/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/models/book.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/models/chapter.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/models/volume.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/parser.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/env.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/epub.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/gmi.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/massage.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/md.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/parse.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/pdf.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/tex.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/subcommands/typ.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/tokenizer.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/zh_utils.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/__init__.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/conftest.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/empty_file.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/missing_chapters.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/sample_all_headers.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/sample_long_headers.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/sample_remove_wrapping.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/sample_unsorted_headers.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/sample_with_issues.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/fixtures/sample_with_metadata.txt +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_epub_writer.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_filename_format_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_format_option.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_header_number_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_input_file_arg.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_language_option.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_output_file_arg.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_overwrite_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_parser.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_purge_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_quiet_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_raise_warnings.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_sort_volume_and_chapter_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_split_volume_and_chapter_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_subcommand_env.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_subcommand_epub.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_test_parsing_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_tokenizer.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_translator_option.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_txt2ebook.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_verbose_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_volume_page_flag.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_zh_utils_zh_halfwidth_to_fullwidth.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_zh_utils_zh_numeric.py +0 -0
- {txt2ebook-0.1.140 → txt2ebook-0.1.141}/tests/test_zh_utils_zh_words_to_numbers.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: txt2ebook
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.141
|
4
4
|
Summary: CLI tool to convert txt file to ebook format
|
5
5
|
Project-URL: Homepage, https://github.com/kianmeng/txt2ebook
|
6
6
|
Project-URL: Repository, https://github.com/kianmeng/txt2ebook
|
@@ -108,12 +108,12 @@ positional arguments:
|
|
108
108
|
typ
|
109
109
|
generate ebook in Typst format
|
110
110
|
|
111
|
-
|
112
|
-
-of, --output-folder OUTPUT_FOLDER
|
111
|
+
optional arguments:
|
112
|
+
-of OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER
|
113
113
|
set default output folder (default: 'output')
|
114
114
|
-p, --purge
|
115
115
|
remove converted ebooks specified by --output-folder option (default: 'False')
|
116
|
-
-l, --language LANGUAGE
|
116
|
+
-l LANGUAGE, --language LANGUAGE
|
117
117
|
language of the ebook (default: 'None')
|
118
118
|
-rw, --raise-on-warning
|
119
119
|
raise exception and stop parsing upon warning
|
@@ -65,12 +65,12 @@ positional arguments:
|
|
65
65
|
typ
|
66
66
|
generate ebook in Typst format
|
67
67
|
|
68
|
-
|
69
|
-
-of, --output-folder OUTPUT_FOLDER
|
68
|
+
optional arguments:
|
69
|
+
-of OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER
|
70
70
|
set default output folder (default: 'output')
|
71
71
|
-p, --purge
|
72
72
|
remove converted ebooks specified by --output-folder option (default: 'False')
|
73
|
-
-l, --language LANGUAGE
|
73
|
+
-l LANGUAGE, --language LANGUAGE
|
74
74
|
language of the ebook (default: 'None')
|
75
75
|
-rw, --raise-on-warning
|
76
76
|
raise exception and stop parsing upon warning
|
@@ -19,6 +19,8 @@ import datetime
|
|
19
19
|
|
20
20
|
import nox
|
21
21
|
|
22
|
+
nox.options.default_venv_backend = "uv"
|
23
|
+
|
22
24
|
|
23
25
|
@nox.session(python="3.9")
|
24
26
|
def deps(session: nox.Session) -> None:
|
@@ -219,8 +221,7 @@ def release(session: nox.Session) -> None:
|
|
219
221
|
|
220
222
|
|
221
223
|
def _uv_install(session: nox.Session) -> None:
|
222
|
-
session.
|
223
|
-
session.run("uv", "sync")
|
224
|
+
session.run("uv", "sync", "--active")
|
224
225
|
|
225
226
|
|
226
227
|
def _search_and_replace(file, search, replace) -> None:
|
@@ -1,16 +1,16 @@
|
|
1
1
|
[project]
|
2
2
|
name = "txt2ebook"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.141"
|
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"
|
7
7
|
readme = "README.md"
|
8
8
|
license = "AGPL-3.0-or-later"
|
9
9
|
keywords = [
|
10
|
-
"
|
10
|
+
"cjk",
|
11
11
|
"ebook",
|
12
12
|
"epub",
|
13
|
-
"
|
13
|
+
"txt",
|
14
14
|
]
|
15
15
|
classifiers = [
|
16
16
|
"Development Status :: 4 - Beta",
|
@@ -35,16 +35,16 @@ dependencies = [
|
|
35
35
|
"CJKwrap~=2.2",
|
36
36
|
"EbookLib>=0.17.1,<0.18",
|
37
37
|
"bs4>=0.0.1,<0.0.2",
|
38
|
+
"importlib-resources>=6.1.1,<7",
|
39
|
+
"jieba>=0.42.1,<0.43",
|
38
40
|
"langdetect>=1.0.9,<2",
|
39
|
-
"
|
41
|
+
"lxml>=5.2.2,<6",
|
42
|
+
"pylatex>=1.4.2,<2",
|
40
43
|
"pypandoc~=1.11",
|
41
|
-
"
|
44
|
+
"regex>=2021.11.10,<2022",
|
42
45
|
"reportlab>=4.0.0,<5",
|
46
|
+
"typing-extensions>=4.5.0,<5",
|
43
47
|
"typst>=0.13.0",
|
44
|
-
"importlib-resources>=6.1.1,<7",
|
45
|
-
"pylatex>=1.4.2,<2",
|
46
|
-
"lxml>=5.2.2,<6",
|
47
|
-
"jieba>=0.42.1,<0.43",
|
48
48
|
]
|
49
49
|
|
50
50
|
[project.urls]
|
@@ -58,24 +58,24 @@ tte = "txt2ebook.cli:main"
|
|
58
58
|
[dependency-groups]
|
59
59
|
dev = [
|
60
60
|
"babel>=2.12.1,<3",
|
61
|
-
"
|
61
|
+
"bandit~=1.7.1",
|
62
62
|
"flake8-simplify>=0.21.0,<0.22",
|
63
|
-
"nox>=2024.4.15,<2025",
|
64
|
-
"nox-poetry>=1.0.3,<2",
|
65
|
-
"vulture~=2.11",
|
66
63
|
"mypy>=1.10.0,<2",
|
67
|
-
"
|
64
|
+
"myst-parser>=3.0.1,<4",
|
65
|
+
"nox-poetry>=1.0.3,<2",
|
66
|
+
"nox>=2024.4.15,<2025",
|
68
67
|
"pep8-naming>=0.13.3,<0.14",
|
68
|
+
"pre-commit>=2.20,<2.21",
|
69
69
|
"pylint>=3.2.0,<4",
|
70
|
-
"pytest>=8.2.0,<9",
|
71
70
|
"pytest-cov>=5.0.0,<6",
|
72
71
|
"pytest-randomly>=3.15.0,<4",
|
73
72
|
"pytest-xdist>=3.6.1,<4",
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"myst-parser>=3.0.1,<4",
|
77
|
-
"sphinx-copybutton>=0.5.2,<0.6",
|
73
|
+
"pytest>=8.2.0,<9",
|
74
|
+
"scripttest~=1.3",
|
78
75
|
"sphinx-autodoc-typehints>=2.2.2,<3",
|
76
|
+
"sphinx-copybutton>=0.5.2,<0.6",
|
77
|
+
"sphinx>=7.3.7,<8",
|
78
|
+
"vulture~=2.11",
|
79
79
|
]
|
80
80
|
|
81
81
|
[build-system]
|
@@ -8,6 +8,16 @@
|
|
8
8
|
花间一壶酒,独酌无相亲。
|
9
9
|
举杯邀明月,对影成三人。
|
10
10
|
|
11
|
+
This is a paragraph with some halfwidth characters like 123, ABC, and symbols !@#$.
|
12
|
+
|
13
|
+
This paragraph has
|
14
|
+
multiple newlines
|
15
|
+
|
16
|
+
|
17
|
+
between lines.
|
18
|
+
|
19
|
+
This is a very long line that should be wrapped when a width is specified. It needs to be long enough to exceed the typical default width and force wrapping. Let's make it even longer to be sure. This is a very long line that should be wrapped when a width is specified. It needs to be long enough to exceed the typical default width and force wrapping. Let's make it even longer to be sure.
|
20
|
+
|
11
21
|
第1章 月既不解饮
|
12
22
|
|
13
23
|
我歌月徘徊,我舞影零乱。醒时同交欢,醉后各分散。永结无情游,相期邈云汉。
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# pylint: disable=C0114,C0116
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
|
6
|
+
@pytest.mark.parametrize("option", ["-rl", "--regex-delete-line"])
|
7
|
+
def test_delete_line_regex(tte, infile, option):
|
8
|
+
txtfile = infile("sample.txt")
|
9
|
+
tte("massage", txtfile, "-ow", option, "我歌月徘徊")
|
10
|
+
|
11
|
+
with open(txtfile, encoding="utf8") as file:
|
12
|
+
content = file.read()
|
13
|
+
assert "我歌月徘徊" not in content
|
14
|
+
|
15
|
+
|
16
|
+
@pytest.mark.parametrize("option", ["-rr", "--regex-replace"])
|
17
|
+
def test_single_replace_regex(tte, infile, option):
|
18
|
+
txtfile = infile("sample.txt")
|
19
|
+
|
20
|
+
tte("massage", txtfile, "-ow", option, "章", "章:")
|
21
|
+
|
22
|
+
with open(txtfile, encoding="utf8") as file:
|
23
|
+
content = file.read()
|
24
|
+
assert "第1章:" in content
|
25
|
+
assert "第2章:" in content
|
26
|
+
assert "第3章:" in content
|
27
|
+
|
28
|
+
|
29
|
+
@pytest.mark.parametrize("option", ["-rd", "--regex-delete"])
|
30
|
+
def test_single_delete_regex(tte, infile, option):
|
31
|
+
txtfile = infile("sample.txt")
|
32
|
+
tte("massage", txtfile, "-ow", option, "歌月", option, "我")
|
33
|
+
|
34
|
+
with open(txtfile, encoding="utf8") as file:
|
35
|
+
content = file.read()
|
36
|
+
assert "徘徊,舞影零乱。" in content
|
37
|
+
|
38
|
+
|
39
|
+
@pytest.mark.parametrize("option", ["-fw", "--fullwidth"])
|
40
|
+
def test_fullwidth(tte, infile, option):
|
41
|
+
txtfile = infile("sample.txt")
|
42
|
+
tte("massage", txtfile, "-ow", option)
|
43
|
+
|
44
|
+
with open(txtfile, encoding="utf8") as file:
|
45
|
+
content = file.read()
|
46
|
+
# Check for conversion of halfwidth characters
|
47
|
+
assert "123" in content
|
48
|
+
assert "ABC" in content
|
49
|
+
assert "!@#$" in content
|
50
|
+
|
51
|
+
|
52
|
+
@pytest.mark.parametrize("option", ["-sn", "--single-newline"])
|
53
|
+
def test_single_newline(tte, infile, option):
|
54
|
+
txtfile = infile("sample.txt")
|
55
|
+
tte("massage", txtfile, "-ow", option)
|
56
|
+
|
57
|
+
with open(txtfile, encoding="utf8") as file:
|
58
|
+
content = file.read()
|
59
|
+
# Check that multiple newlines are reduced to single newlines between paragraphs
|
60
|
+
assert "This paragraph has\n\nmultiple newlines" in content
|
61
|
+
assert "between lines.\n\nThis is a very long line" in content
|
62
|
+
# Ensure single newlines within a paragraph are preserved by wrapping logic
|
63
|
+
# (though single_newline runs before wrapping, the effect is tested here)
|
64
|
+
assert "花间一壶酒,独酌无相亲。\n\n举杯邀明月,对影成三人。" in content
|
65
|
+
|
66
|
+
|
67
|
+
@pytest.mark.parametrize("option", ["-w", "--width"])
|
68
|
+
def test_width(tte, infile, option):
|
69
|
+
txtfile = infile("sample.txt")
|
70
|
+
# Use a small width to force wrapping
|
71
|
+
tte("massage", txtfile, "-ow", option, "40")
|
72
|
+
|
73
|
+
with open(txtfile, encoding="utf8") as file:
|
74
|
+
content = file.read()
|
75
|
+
# Check that the long line is wrapped
|
76
|
+
long_line_wrapped = "This is a very long line that should be\nwrapped when a width is specified. It needs\nto be long enough to exceed the typical\ndefault width and force wrapping. Let's\nmake it even longer to be sure. This is a\nvery long line that should be wrapped when\na width is specified. It needs to be long\nenough to exceed the typical default width\nand force wrapping. Let's make it even\nlonger to be sure."
|
77
|
+
assert long_line_wrapped in content
|
78
|
+
|
79
|
+
|
80
|
+
@pytest.mark.parametrize("option", ["-ps", "--paragraph_separator"])
|
81
|
+
def test_paragraph_separator(tte, infile, option):
|
82
|
+
txtfile = infile("sample.txt")
|
83
|
+
separator = "<br>"
|
84
|
+
tte("massage", txtfile, "-ow", option, separator)
|
85
|
+
|
86
|
+
with open(txtfile, encoding="utf8") as file:
|
87
|
+
content = file.read()
|
88
|
+
# Check that the custom separator is used between paragraphs
|
89
|
+
assert "花间一壶酒,独酌无相亲。" + separator + "举杯邀明月,对影成三人。" in content
|
90
|
+
assert "between lines." + separator + "This is a very long line" in content
|
91
|
+
|
92
|
+
|
93
|
+
def test_multiple_regex(tte, infile):
|
94
|
+
txtfile = infile("sample.txt")
|
95
|
+
# Apply multiple regex options
|
96
|
+
tte(
|
97
|
+
"massage",
|
98
|
+
txtfile,
|
99
|
+
"-ow",
|
100
|
+
"-rl",
|
101
|
+
"我歌月徘徊", # Delete line
|
102
|
+
"-rr",
|
103
|
+
"章",
|
104
|
+
"章:", # Replace
|
105
|
+
"-rd",
|
106
|
+
"无相亲", # Delete word/phrase
|
107
|
+
)
|
108
|
+
|
109
|
+
with open(txtfile, encoding="utf8") as file:
|
110
|
+
content = file.read()
|
111
|
+
# Check all regex effects
|
112
|
+
assert "我歌月徘徊" not in content # Line deleted
|
113
|
+
assert "第1章:" in content # Replace applied
|
114
|
+
assert "独酌无相亲" not in content # Word/phrase deleted
|
115
|
+
assert "花间一壶酒,独酌。" in content # Check surrounding text after deletion
|
@@ -241,72 +241,76 @@ wheels = [
|
|
241
241
|
|
242
242
|
[[package]]
|
243
243
|
name = "coverage"
|
244
|
-
version = "7.8.
|
245
|
-
source = { registry = "https://pypi.org/simple" }
|
246
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
247
|
-
wheels = [
|
248
|
-
{ url = "https://files.pythonhosted.org/packages/
|
249
|
-
{ url = "https://files.pythonhosted.org/packages/
|
250
|
-
{ url = "https://files.pythonhosted.org/packages/
|
251
|
-
{ url = "https://files.pythonhosted.org/packages/
|
252
|
-
{ url = "https://files.pythonhosted.org/packages/
|
253
|
-
{ url = "https://files.pythonhosted.org/packages/
|
254
|
-
{ url = "https://files.pythonhosted.org/packages/
|
255
|
-
{ url = "https://files.pythonhosted.org/packages/
|
256
|
-
{ url = "https://files.pythonhosted.org/packages/
|
257
|
-
{ url = "https://files.pythonhosted.org/packages/
|
258
|
-
{ url = "https://files.pythonhosted.org/packages/
|
259
|
-
{ url = "https://files.pythonhosted.org/packages/
|
260
|
-
{ url = "https://files.pythonhosted.org/packages/
|
261
|
-
{ url = "https://files.pythonhosted.org/packages/
|
262
|
-
{ url = "https://files.pythonhosted.org/packages/
|
263
|
-
{ url = "https://files.pythonhosted.org/packages/
|
264
|
-
{ url = "https://files.pythonhosted.org/packages/
|
265
|
-
{ url = "https://files.pythonhosted.org/packages/
|
266
|
-
{ url = "https://files.pythonhosted.org/packages/
|
267
|
-
{ url = "https://files.pythonhosted.org/packages/
|
268
|
-
{ url = "https://files.pythonhosted.org/packages/
|
269
|
-
{ url = "https://files.pythonhosted.org/packages/
|
270
|
-
{ url = "https://files.pythonhosted.org/packages/
|
271
|
-
{ url = "https://files.pythonhosted.org/packages/
|
272
|
-
{ url = "https://files.pythonhosted.org/packages/
|
273
|
-
{ url = "https://files.pythonhosted.org/packages/
|
274
|
-
{ url = "https://files.pythonhosted.org/packages/
|
275
|
-
{ url = "https://files.pythonhosted.org/packages/
|
276
|
-
{ url = "https://files.pythonhosted.org/packages/
|
277
|
-
{ url = "https://files.pythonhosted.org/packages/
|
278
|
-
{ url = "https://files.pythonhosted.org/packages/
|
279
|
-
{ url = "https://files.pythonhosted.org/packages/
|
280
|
-
{ url = "https://files.pythonhosted.org/packages/
|
281
|
-
{ url = "https://files.pythonhosted.org/packages/
|
282
|
-
{ url = "https://files.pythonhosted.org/packages/
|
283
|
-
{ url = "https://files.pythonhosted.org/packages/
|
284
|
-
{ url = "https://files.pythonhosted.org/packages/
|
285
|
-
{ url = "https://files.pythonhosted.org/packages/
|
286
|
-
{ url = "https://files.pythonhosted.org/packages/
|
287
|
-
{ url = "https://files.pythonhosted.org/packages/
|
288
|
-
{ url = "https://files.pythonhosted.org/packages/
|
289
|
-
{ url = "https://files.pythonhosted.org/packages/
|
290
|
-
{ url = "https://files.pythonhosted.org/packages/
|
291
|
-
{ url = "https://files.pythonhosted.org/packages/
|
292
|
-
{ url = "https://files.pythonhosted.org/packages/
|
293
|
-
{ url = "https://files.pythonhosted.org/packages/
|
294
|
-
{ url = "https://files.pythonhosted.org/packages/
|
295
|
-
{ url = "https://files.pythonhosted.org/packages/
|
296
|
-
{ url = "https://files.pythonhosted.org/packages/
|
297
|
-
{ url = "https://files.pythonhosted.org/packages/
|
298
|
-
{ url = "https://files.pythonhosted.org/packages/
|
299
|
-
{ url = "https://files.pythonhosted.org/packages/
|
300
|
-
{ url = "https://files.pythonhosted.org/packages/
|
301
|
-
{ url = "https://files.pythonhosted.org/packages/
|
302
|
-
{ url = "https://files.pythonhosted.org/packages/
|
303
|
-
{ url = "https://files.pythonhosted.org/packages/
|
304
|
-
{ url = "https://files.pythonhosted.org/packages/
|
305
|
-
{ url = "https://files.pythonhosted.org/packages/
|
306
|
-
{ url = "https://files.pythonhosted.org/packages/
|
307
|
-
{ url = "https://files.pythonhosted.org/packages/
|
308
|
-
{ url = "https://files.pythonhosted.org/packages/
|
309
|
-
{ url = "https://files.pythonhosted.org/packages/
|
244
|
+
version = "7.8.2"
|
245
|
+
source = { registry = "https://pypi.org/simple" }
|
246
|
+
sdist = { url = "https://files.pythonhosted.org/packages/ba/07/998afa4a0ecdf9b1981ae05415dad2d4e7716e1b1f00abbd91691ac09ac9/coverage-7.8.2.tar.gz", hash = "sha256:a886d531373a1f6ff9fad2a2ba4a045b68467b779ae729ee0b3b10ac20033b27", size = 812759, upload-time = "2025-05-23T11:39:57.856Z" }
|
247
|
+
wheels = [
|
248
|
+
{ url = "https://files.pythonhosted.org/packages/26/6b/7dd06399a5c0b81007e3a6af0395cd60e6a30f959f8d407d3ee04642e896/coverage-7.8.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bd8ec21e1443fd7a447881332f7ce9d35b8fbd2849e761bb290b584535636b0a", size = 211573, upload-time = "2025-05-23T11:37:47.207Z" },
|
249
|
+
{ url = "https://files.pythonhosted.org/packages/f0/df/2b24090820a0bac1412955fb1a4dade6bc3b8dcef7b899c277ffaf16916d/coverage-7.8.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4c26c2396674816deaeae7ded0e2b42c26537280f8fe313335858ffff35019be", size = 212006, upload-time = "2025-05-23T11:37:50.289Z" },
|
250
|
+
{ url = "https://files.pythonhosted.org/packages/c5/c4/e4e3b998e116625562a872a342419652fa6ca73f464d9faf9f52f1aff427/coverage-7.8.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1aec326ed237e5880bfe69ad41616d333712c7937bcefc1343145e972938f9b3", size = 241128, upload-time = "2025-05-23T11:37:52.229Z" },
|
251
|
+
{ url = "https://files.pythonhosted.org/packages/b1/67/b28904afea3e87a895da850ba587439a61699bf4b73d04d0dfd99bbd33b4/coverage-7.8.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5e818796f71702d7a13e50c70de2a1924f729228580bcba1607cccf32eea46e6", size = 239026, upload-time = "2025-05-23T11:37:53.846Z" },
|
252
|
+
{ url = "https://files.pythonhosted.org/packages/8c/0f/47bf7c5630d81bc2cd52b9e13043685dbb7c79372a7f5857279cc442b37c/coverage-7.8.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:546e537d9e24efc765c9c891328f30f826e3e4808e31f5d0f87c4ba12bbd1622", size = 240172, upload-time = "2025-05-23T11:37:55.711Z" },
|
253
|
+
{ url = "https://files.pythonhosted.org/packages/ba/38/af3eb9d36d85abc881f5aaecf8209383dbe0fa4cac2d804c55d05c51cb04/coverage-7.8.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ab9b09a2349f58e73f8ebc06fac546dd623e23b063e5398343c5270072e3201c", size = 240086, upload-time = "2025-05-23T11:37:57.724Z" },
|
254
|
+
{ url = "https://files.pythonhosted.org/packages/9e/64/c40c27c2573adeba0fe16faf39a8aa57368a1f2148865d6bb24c67eadb41/coverage-7.8.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fd51355ab8a372d89fb0e6a31719e825cf8df8b6724bee942fb5b92c3f016ba3", size = 238792, upload-time = "2025-05-23T11:37:59.737Z" },
|
255
|
+
{ url = "https://files.pythonhosted.org/packages/8e/ab/b7c85146f15457671c1412afca7c25a5696d7625e7158002aa017e2d7e3c/coverage-7.8.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:0774df1e093acb6c9e4d58bce7f86656aeed6c132a16e2337692c12786b32404", size = 239096, upload-time = "2025-05-23T11:38:01.693Z" },
|
256
|
+
{ url = "https://files.pythonhosted.org/packages/d3/50/9446dad1310905fb1dc284d60d4320a5b25d4e3e33f9ea08b8d36e244e23/coverage-7.8.2-cp310-cp310-win32.whl", hash = "sha256:00f2e2f2e37f47e5f54423aeefd6c32a7dbcedc033fcd3928a4f4948e8b96af7", size = 214144, upload-time = "2025-05-23T11:38:03.68Z" },
|
257
|
+
{ url = "https://files.pythonhosted.org/packages/23/ed/792e66ad7b8b0df757db8d47af0c23659cdb5a65ef7ace8b111cacdbee89/coverage-7.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:145b07bea229821d51811bf15eeab346c236d523838eda395ea969d120d13347", size = 215043, upload-time = "2025-05-23T11:38:05.217Z" },
|
258
|
+
{ url = "https://files.pythonhosted.org/packages/6a/4d/1ff618ee9f134d0de5cc1661582c21a65e06823f41caf801aadf18811a8e/coverage-7.8.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b99058eef42e6a8dcd135afb068b3d53aff3921ce699e127602efff9956457a9", size = 211692, upload-time = "2025-05-23T11:38:08.485Z" },
|
259
|
+
{ url = "https://files.pythonhosted.org/packages/96/fa/c3c1b476de96f2bc7a8ca01a9f1fcb51c01c6b60a9d2c3e66194b2bdb4af/coverage-7.8.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5feb7f2c3e6ea94d3b877def0270dff0947b8d8c04cfa34a17be0a4dc1836879", size = 212115, upload-time = "2025-05-23T11:38:09.989Z" },
|
260
|
+
{ url = "https://files.pythonhosted.org/packages/f7/c2/5414c5a1b286c0f3881ae5adb49be1854ac5b7e99011501f81c8c1453065/coverage-7.8.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:670a13249b957bb9050fab12d86acef7bf8f6a879b9d1a883799276e0d4c674a", size = 244740, upload-time = "2025-05-23T11:38:11.947Z" },
|
261
|
+
{ url = "https://files.pythonhosted.org/packages/cd/46/1ae01912dfb06a642ef3dd9cf38ed4996fda8fe884dab8952da616f81a2b/coverage-7.8.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0bdc8bf760459a4a4187b452213e04d039990211f98644c7292adf1e471162b5", size = 242429, upload-time = "2025-05-23T11:38:13.955Z" },
|
262
|
+
{ url = "https://files.pythonhosted.org/packages/06/58/38c676aec594bfe2a87c7683942e5a30224791d8df99bcc8439fde140377/coverage-7.8.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07a989c867986c2a75f158f03fdb413128aad29aca9d4dbce5fc755672d96f11", size = 244218, upload-time = "2025-05-23T11:38:15.631Z" },
|
263
|
+
{ url = "https://files.pythonhosted.org/packages/80/0c/95b1023e881ce45006d9abc250f76c6cdab7134a1c182d9713878dfefcb2/coverage-7.8.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2db10dedeb619a771ef0e2949ccba7b75e33905de959c2643a4607bef2f3fb3a", size = 243865, upload-time = "2025-05-23T11:38:17.622Z" },
|
264
|
+
{ url = "https://files.pythonhosted.org/packages/57/37/0ae95989285a39e0839c959fe854a3ae46c06610439350d1ab860bf020ac/coverage-7.8.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e6ea7dba4e92926b7b5f0990634b78ea02f208d04af520c73a7c876d5a8d36cb", size = 242038, upload-time = "2025-05-23T11:38:19.966Z" },
|
265
|
+
{ url = "https://files.pythonhosted.org/packages/4d/82/40e55f7c0eb5e97cc62cbd9d0746fd24e8caf57be5a408b87529416e0c70/coverage-7.8.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ef2f22795a7aca99fc3c84393a55a53dd18ab8c93fb431004e4d8f0774150f54", size = 242567, upload-time = "2025-05-23T11:38:21.912Z" },
|
266
|
+
{ url = "https://files.pythonhosted.org/packages/f9/35/66a51adc273433a253989f0d9cc7aa6bcdb4855382cf0858200afe578861/coverage-7.8.2-cp311-cp311-win32.whl", hash = "sha256:641988828bc18a6368fe72355df5f1703e44411adbe49bba5644b941ce6f2e3a", size = 214194, upload-time = "2025-05-23T11:38:23.571Z" },
|
267
|
+
{ url = "https://files.pythonhosted.org/packages/f6/8f/a543121f9f5f150eae092b08428cb4e6b6d2d134152c3357b77659d2a605/coverage-7.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:8ab4a51cb39dc1933ba627e0875046d150e88478dbe22ce145a68393e9652975", size = 215109, upload-time = "2025-05-23T11:38:25.137Z" },
|
268
|
+
{ url = "https://files.pythonhosted.org/packages/77/65/6cc84b68d4f35186463cd7ab1da1169e9abb59870c0f6a57ea6aba95f861/coverage-7.8.2-cp311-cp311-win_arm64.whl", hash = "sha256:8966a821e2083c74d88cca5b7dcccc0a3a888a596a04c0b9668a891de3a0cc53", size = 213521, upload-time = "2025-05-23T11:38:27.123Z" },
|
269
|
+
{ url = "https://files.pythonhosted.org/packages/8d/2a/1da1ada2e3044fcd4a3254fb3576e160b8fe5b36d705c8a31f793423f763/coverage-7.8.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e2f6fe3654468d061942591aef56686131335b7a8325684eda85dacdf311356c", size = 211876, upload-time = "2025-05-23T11:38:29.01Z" },
|
270
|
+
{ url = "https://files.pythonhosted.org/packages/70/e9/3d715ffd5b6b17a8be80cd14a8917a002530a99943cc1939ad5bb2aa74b9/coverage-7.8.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:76090fab50610798cc05241bf83b603477c40ee87acd358b66196ab0ca44ffa1", size = 212130, upload-time = "2025-05-23T11:38:30.675Z" },
|
271
|
+
{ url = "https://files.pythonhosted.org/packages/a0/02/fdce62bb3c21649abfd91fbdcf041fb99be0d728ff00f3f9d54d97ed683e/coverage-7.8.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2bd0a0a5054be160777a7920b731a0570284db5142abaaf81bcbb282b8d99279", size = 246176, upload-time = "2025-05-23T11:38:32.395Z" },
|
272
|
+
{ url = "https://files.pythonhosted.org/packages/a7/52/decbbed61e03b6ffe85cd0fea360a5e04a5a98a7423f292aae62423b8557/coverage-7.8.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da23ce9a3d356d0affe9c7036030b5c8f14556bd970c9b224f9c8205505e3b99", size = 243068, upload-time = "2025-05-23T11:38:33.989Z" },
|
273
|
+
{ url = "https://files.pythonhosted.org/packages/38/6c/d0e9c0cce18faef79a52778219a3c6ee8e336437da8eddd4ab3dbd8fadff/coverage-7.8.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9392773cffeb8d7e042a7b15b82a414011e9d2b5fdbbd3f7e6a6b17d5e21b20", size = 245328, upload-time = "2025-05-23T11:38:35.568Z" },
|
274
|
+
{ url = "https://files.pythonhosted.org/packages/f0/70/f703b553a2f6b6c70568c7e398ed0789d47f953d67fbba36a327714a7bca/coverage-7.8.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:876cbfd0b09ce09d81585d266c07a32657beb3eaec896f39484b631555be0fe2", size = 245099, upload-time = "2025-05-23T11:38:37.627Z" },
|
275
|
+
{ url = "https://files.pythonhosted.org/packages/ec/fb/4cbb370dedae78460c3aacbdad9d249e853f3bc4ce5ff0e02b1983d03044/coverage-7.8.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3da9b771c98977a13fbc3830f6caa85cae6c9c83911d24cb2d218e9394259c57", size = 243314, upload-time = "2025-05-23T11:38:39.238Z" },
|
276
|
+
{ url = "https://files.pythonhosted.org/packages/39/9f/1afbb2cb9c8699b8bc38afdce00a3b4644904e6a38c7bf9005386c9305ec/coverage-7.8.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9a990f6510b3292686713bfef26d0049cd63b9c7bb17e0864f133cbfd2e6167f", size = 244489, upload-time = "2025-05-23T11:38:40.845Z" },
|
277
|
+
{ url = "https://files.pythonhosted.org/packages/79/fa/f3e7ec7d220bff14aba7a4786ae47043770cbdceeea1803083059c878837/coverage-7.8.2-cp312-cp312-win32.whl", hash = "sha256:bf8111cddd0f2b54d34e96613e7fbdd59a673f0cf5574b61134ae75b6f5a33b8", size = 214366, upload-time = "2025-05-23T11:38:43.551Z" },
|
278
|
+
{ url = "https://files.pythonhosted.org/packages/54/aa/9cbeade19b7e8e853e7ffc261df885d66bf3a782c71cba06c17df271f9e6/coverage-7.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:86a323a275e9e44cdf228af9b71c5030861d4d2610886ab920d9945672a81223", size = 215165, upload-time = "2025-05-23T11:38:45.148Z" },
|
279
|
+
{ url = "https://files.pythonhosted.org/packages/c4/73/e2528bf1237d2448f882bbebaec5c3500ef07301816c5c63464b9da4d88a/coverage-7.8.2-cp312-cp312-win_arm64.whl", hash = "sha256:820157de3a589e992689ffcda8639fbabb313b323d26388d02e154164c57b07f", size = 213548, upload-time = "2025-05-23T11:38:46.74Z" },
|
280
|
+
{ url = "https://files.pythonhosted.org/packages/1a/93/eb6400a745ad3b265bac36e8077fdffcf0268bdbbb6c02b7220b624c9b31/coverage-7.8.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ea561010914ec1c26ab4188aef8b1567272ef6de096312716f90e5baa79ef8ca", size = 211898, upload-time = "2025-05-23T11:38:49.066Z" },
|
281
|
+
{ url = "https://files.pythonhosted.org/packages/1b/7c/bdbf113f92683024406a1cd226a199e4200a2001fc85d6a6e7e299e60253/coverage-7.8.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cb86337a4fcdd0e598ff2caeb513ac604d2f3da6d53df2c8e368e07ee38e277d", size = 212171, upload-time = "2025-05-23T11:38:51.207Z" },
|
282
|
+
{ url = "https://files.pythonhosted.org/packages/91/22/594513f9541a6b88eb0dba4d5da7d71596dadef6b17a12dc2c0e859818a9/coverage-7.8.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26a4636ddb666971345541b59899e969f3b301143dd86b0ddbb570bd591f1e85", size = 245564, upload-time = "2025-05-23T11:38:52.857Z" },
|
283
|
+
{ url = "https://files.pythonhosted.org/packages/1f/f4/2860fd6abeebd9f2efcfe0fd376226938f22afc80c1943f363cd3c28421f/coverage-7.8.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5040536cf9b13fb033f76bcb5e1e5cb3b57c4807fef37db9e0ed129c6a094257", size = 242719, upload-time = "2025-05-23T11:38:54.529Z" },
|
284
|
+
{ url = "https://files.pythonhosted.org/packages/89/60/f5f50f61b6332451520e6cdc2401700c48310c64bc2dd34027a47d6ab4ca/coverage-7.8.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc67994df9bcd7e0150a47ef41278b9e0a0ea187caba72414b71dc590b99a108", size = 244634, upload-time = "2025-05-23T11:38:57.326Z" },
|
285
|
+
{ url = "https://files.pythonhosted.org/packages/3b/70/7f4e919039ab7d944276c446b603eea84da29ebcf20984fb1fdf6e602028/coverage-7.8.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6e6c86888fd076d9e0fe848af0a2142bf606044dc5ceee0aa9eddb56e26895a0", size = 244824, upload-time = "2025-05-23T11:38:59.421Z" },
|
286
|
+
{ url = "https://files.pythonhosted.org/packages/26/45/36297a4c0cea4de2b2c442fe32f60c3991056c59cdc3cdd5346fbb995c97/coverage-7.8.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:684ca9f58119b8e26bef860db33524ae0365601492e86ba0b71d513f525e7050", size = 242872, upload-time = "2025-05-23T11:39:01.049Z" },
|
287
|
+
{ url = "https://files.pythonhosted.org/packages/a4/71/e041f1b9420f7b786b1367fa2a375703889ef376e0d48de9f5723fb35f11/coverage-7.8.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8165584ddedb49204c4e18da083913bdf6a982bfb558632a79bdaadcdafd0d48", size = 244179, upload-time = "2025-05-23T11:39:02.709Z" },
|
288
|
+
{ url = "https://files.pythonhosted.org/packages/bd/db/3c2bf49bdc9de76acf2491fc03130c4ffc51469ce2f6889d2640eb563d77/coverage-7.8.2-cp313-cp313-win32.whl", hash = "sha256:34759ee2c65362163699cc917bdb2a54114dd06d19bab860725f94ef45a3d9b7", size = 214393, upload-time = "2025-05-23T11:39:05.457Z" },
|
289
|
+
{ url = "https://files.pythonhosted.org/packages/c6/dc/947e75d47ebbb4b02d8babb1fad4ad381410d5bc9da7cfca80b7565ef401/coverage-7.8.2-cp313-cp313-win_amd64.whl", hash = "sha256:2f9bc608fbafaee40eb60a9a53dbfb90f53cc66d3d32c2849dc27cf5638a21e3", size = 215194, upload-time = "2025-05-23T11:39:07.171Z" },
|
290
|
+
{ url = "https://files.pythonhosted.org/packages/90/31/a980f7df8a37eaf0dc60f932507fda9656b3a03f0abf188474a0ea188d6d/coverage-7.8.2-cp313-cp313-win_arm64.whl", hash = "sha256:9fe449ee461a3b0c7105690419d0b0aba1232f4ff6d120a9e241e58a556733f7", size = 213580, upload-time = "2025-05-23T11:39:08.862Z" },
|
291
|
+
{ url = "https://files.pythonhosted.org/packages/8a/6a/25a37dd90f6c95f59355629417ebcb74e1c34e38bb1eddf6ca9b38b0fc53/coverage-7.8.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:8369a7c8ef66bded2b6484053749ff220dbf83cba84f3398c84c51a6f748a008", size = 212734, upload-time = "2025-05-23T11:39:11.109Z" },
|
292
|
+
{ url = "https://files.pythonhosted.org/packages/36/8b/3a728b3118988725f40950931abb09cd7f43b3c740f4640a59f1db60e372/coverage-7.8.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:159b81df53a5fcbc7d45dae3adad554fdbde9829a994e15227b3f9d816d00b36", size = 212959, upload-time = "2025-05-23T11:39:12.751Z" },
|
293
|
+
{ url = "https://files.pythonhosted.org/packages/53/3c/212d94e6add3a3c3f412d664aee452045ca17a066def8b9421673e9482c4/coverage-7.8.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e6fcbbd35a96192d042c691c9e0c49ef54bd7ed865846a3c9d624c30bb67ce46", size = 257024, upload-time = "2025-05-23T11:39:15.569Z" },
|
294
|
+
{ url = "https://files.pythonhosted.org/packages/a4/40/afc03f0883b1e51bbe804707aae62e29c4e8c8bbc365c75e3e4ddeee9ead/coverage-7.8.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:05364b9cc82f138cc86128dc4e2e1251c2981a2218bfcd556fe6b0fbaa3501be", size = 252867, upload-time = "2025-05-23T11:39:17.64Z" },
|
295
|
+
{ url = "https://files.pythonhosted.org/packages/18/a2/3699190e927b9439c6ded4998941a3c1d6fa99e14cb28d8536729537e307/coverage-7.8.2-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:46d532db4e5ff3979ce47d18e2fe8ecad283eeb7367726da0e5ef88e4fe64740", size = 255096, upload-time = "2025-05-23T11:39:19.328Z" },
|
296
|
+
{ url = "https://files.pythonhosted.org/packages/b4/06/16e3598b9466456b718eb3e789457d1a5b8bfb22e23b6e8bbc307df5daf0/coverage-7.8.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:4000a31c34932e7e4fa0381a3d6deb43dc0c8f458e3e7ea6502e6238e10be625", size = 256276, upload-time = "2025-05-23T11:39:21.077Z" },
|
297
|
+
{ url = "https://files.pythonhosted.org/packages/a7/d5/4b5a120d5d0223050a53d2783c049c311eea1709fa9de12d1c358e18b707/coverage-7.8.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:43ff5033d657cd51f83015c3b7a443287250dc14e69910577c3e03bd2e06f27b", size = 254478, upload-time = "2025-05-23T11:39:22.838Z" },
|
298
|
+
{ url = "https://files.pythonhosted.org/packages/ba/85/f9ecdb910ecdb282b121bfcaa32fa8ee8cbd7699f83330ee13ff9bbf1a85/coverage-7.8.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:94316e13f0981cbbba132c1f9f365cac1d26716aaac130866ca812006f662199", size = 255255, upload-time = "2025-05-23T11:39:24.644Z" },
|
299
|
+
{ url = "https://files.pythonhosted.org/packages/50/63/2d624ac7d7ccd4ebbd3c6a9eba9d7fc4491a1226071360d59dd84928ccb2/coverage-7.8.2-cp313-cp313t-win32.whl", hash = "sha256:3f5673888d3676d0a745c3d0e16da338c5eea300cb1f4ada9c872981265e76d8", size = 215109, upload-time = "2025-05-23T11:39:26.722Z" },
|
300
|
+
{ url = "https://files.pythonhosted.org/packages/22/5e/7053b71462e970e869111c1853afd642212568a350eba796deefdfbd0770/coverage-7.8.2-cp313-cp313t-win_amd64.whl", hash = "sha256:2c08b05ee8d7861e45dc5a2cc4195c8c66dca5ac613144eb6ebeaff2d502e73d", size = 216268, upload-time = "2025-05-23T11:39:28.429Z" },
|
301
|
+
{ url = "https://files.pythonhosted.org/packages/07/69/afa41aa34147655543dbe96994f8a246daf94b361ccf5edfd5df62ce066a/coverage-7.8.2-cp313-cp313t-win_arm64.whl", hash = "sha256:1e1448bb72b387755e1ff3ef1268a06617afd94188164960dba8d0245a46004b", size = 214071, upload-time = "2025-05-23T11:39:30.55Z" },
|
302
|
+
{ url = "https://files.pythonhosted.org/packages/71/1e/388267ad9c6aa126438acc1ceafede3bb746afa9872e3ec5f0691b7d5efa/coverage-7.8.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:496948261eaac5ac9cf43f5d0a9f6eb7a6d4cb3bedb2c5d294138142f5c18f2a", size = 211566, upload-time = "2025-05-23T11:39:32.333Z" },
|
303
|
+
{ url = "https://files.pythonhosted.org/packages/8f/a5/acc03e5cf0bba6357f5e7c676343de40fbf431bb1e115fbebf24b2f7f65e/coverage-7.8.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:eacd2de0d30871eff893bab0b67840a96445edcb3c8fd915e6b11ac4b2f3fa6d", size = 211996, upload-time = "2025-05-23T11:39:34.512Z" },
|
304
|
+
{ url = "https://files.pythonhosted.org/packages/5b/a2/0fc0a9f6b7c24fa4f1d7210d782c38cb0d5e692666c36eaeae9a441b6755/coverage-7.8.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b039ffddc99ad65d5078ef300e0c7eed08c270dc26570440e3ef18beb816c1ca", size = 240741, upload-time = "2025-05-23T11:39:36.252Z" },
|
305
|
+
{ url = "https://files.pythonhosted.org/packages/e6/da/1c6ba2cf259710eed8916d4fd201dccc6be7380ad2b3b9f63ece3285d809/coverage-7.8.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e49824808d4375ede9dd84e9961a59c47f9113039f1a525e6be170aa4f5c34d", size = 238672, upload-time = "2025-05-23T11:39:38.03Z" },
|
306
|
+
{ url = "https://files.pythonhosted.org/packages/ac/51/c8fae0dc3ca421e6e2509503696f910ff333258db672800c3bdef256265a/coverage-7.8.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b069938961dfad881dc2f8d02b47645cd2f455d3809ba92a8a687bf513839787", size = 239769, upload-time = "2025-05-23T11:39:40.24Z" },
|
307
|
+
{ url = "https://files.pythonhosted.org/packages/59/8e/b97042ae92c59f40be0c989df090027377ba53f2d6cef73c9ca7685c26a6/coverage-7.8.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:de77c3ba8bb686d1c411e78ee1b97e6e0b963fb98b1637658dd9ad2c875cf9d7", size = 239555, upload-time = "2025-05-23T11:39:42.3Z" },
|
308
|
+
{ url = "https://files.pythonhosted.org/packages/47/35/b8893e682d6e96b1db2af5997fc13ef62219426fb17259d6844c693c5e00/coverage-7.8.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1676628065a498943bd3f64f099bb573e08cf1bc6088bbe33cf4424e0876f4b3", size = 237768, upload-time = "2025-05-23T11:39:44.069Z" },
|
309
|
+
{ url = "https://files.pythonhosted.org/packages/03/6c/023b0b9a764cb52d6243a4591dcb53c4caf4d7340445113a1f452bb80591/coverage-7.8.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8e1a26e7e50076e35f7afafde570ca2b4d7900a491174ca357d29dece5aacee7", size = 238757, upload-time = "2025-05-23T11:39:46.195Z" },
|
310
|
+
{ url = "https://files.pythonhosted.org/packages/03/ed/3af7e4d721bd61a8df7de6de9e8a4271e67f3d9e086454558fd9f48eb4f6/coverage-7.8.2-cp39-cp39-win32.whl", hash = "sha256:6782a12bf76fa61ad9350d5a6ef5f3f020b57f5e6305cbc663803f2ebd0f270a", size = 214166, upload-time = "2025-05-23T11:39:47.934Z" },
|
311
|
+
{ url = "https://files.pythonhosted.org/packages/9d/30/ee774b626773750dc6128354884652507df3c59d6aa8431526107e595227/coverage-7.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:1efa4166ba75ccefd647f2d78b64f53f14fb82622bc94c5a5cb0a622f50f1c9e", size = 215050, upload-time = "2025-05-23T11:39:50.252Z" },
|
312
|
+
{ url = "https://files.pythonhosted.org/packages/69/2f/572b29496d8234e4a7773200dd835a0d32d9e171f2d974f3fe04a9dbc271/coverage-7.8.2-pp39.pp310.pp311-none-any.whl", hash = "sha256:ec455eedf3ba0bbdf8f5a570012617eb305c63cb9f03428d39bf544cb2b94837", size = 203636, upload-time = "2025-05-23T11:39:52.002Z" },
|
313
|
+
{ url = "https://files.pythonhosted.org/packages/a0/1a/0b9c32220ad694d66062f571cc5cedfa9997b64a591e8a500bb63de1bd40/coverage-7.8.2-py3-none-any.whl", hash = "sha256:726f32ee3713f7359696331a18daf0c3b3a70bb0ae71141b9d3c52be7c595e32", size = 203623, upload-time = "2025-05-23T11:39:53.846Z" },
|
310
314
|
]
|
311
315
|
|
312
316
|
[package.optional-dependencies]
|
@@ -410,11 +414,11 @@ wheels = [
|
|
410
414
|
|
411
415
|
[[package]]
|
412
416
|
name = "identify"
|
413
|
-
version = "2.6.
|
417
|
+
version = "2.6.12"
|
414
418
|
source = { registry = "https://pypi.org/simple" }
|
415
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
419
|
+
sdist = { url = "https://files.pythonhosted.org/packages/a2/88/d193a27416618628a5eea64e3223acd800b40749a96ffb322a9b55a49ed1/identify-2.6.12.tar.gz", hash = "sha256:d8de45749f1efb108badef65ee8386f0f7bb19a7f26185f74de6367bffbaf0e6", size = 99254, upload-time = "2025-05-23T20:37:53.3Z" }
|
416
420
|
wheels = [
|
417
|
-
{ url = "https://files.pythonhosted.org/packages/
|
421
|
+
{ url = "https://files.pythonhosted.org/packages/7a/cd/18f8da995b658420625f7ef13f037be53ae04ec5ad33f9b718240dcfd48c/identify-2.6.12-py2.py3-none-any.whl", hash = "sha256:ad9672d5a72e0d2ff7c5c8809b62dfa60458626352fb0eb7b55e69bdc45334a2", size = 99145, upload-time = "2025-05-23T20:37:51.495Z" },
|
418
422
|
]
|
419
423
|
|
420
424
|
[[package]]
|
@@ -1259,11 +1263,11 @@ sdist = { url = "https://files.pythonhosted.org/packages/c8/48/609b5463da485943d
|
|
1259
1263
|
|
1260
1264
|
[[package]]
|
1261
1265
|
name = "setuptools"
|
1262
|
-
version = "80.
|
1266
|
+
version = "80.8.0"
|
1263
1267
|
source = { registry = "https://pypi.org/simple" }
|
1264
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
1268
|
+
sdist = { url = "https://files.pythonhosted.org/packages/8d/d2/ec1acaaff45caed5c2dedb33b67055ba9d4e96b091094df90762e60135fe/setuptools-80.8.0.tar.gz", hash = "sha256:49f7af965996f26d43c8ae34539c8d99c5042fbff34302ea151eaa9c207cd257", size = 1319720, upload-time = "2025-05-20T14:02:53.503Z" }
|
1265
1269
|
wheels = [
|
1266
|
-
{ url = "https://files.pythonhosted.org/packages/
|
1270
|
+
{ url = "https://files.pythonhosted.org/packages/58/29/93c53c098d301132196c3238c312825324740851d77a8500a2462c0fd888/setuptools-80.8.0-py3-none-any.whl", hash = "sha256:95a60484590d24103af13b686121328cc2736bee85de8936383111e421b9edc0", size = 1201470, upload-time = "2025-05-20T14:02:51.348Z" },
|
1267
1271
|
]
|
1268
1272
|
|
1269
1273
|
[[package]]
|
@@ -1471,7 +1475,7 @@ wheels = [
|
|
1471
1475
|
|
1472
1476
|
[[package]]
|
1473
1477
|
name = "txt2ebook"
|
1474
|
-
version = "0.1.
|
1478
|
+
version = "0.1.140"
|
1475
1479
|
source = { editable = "." }
|
1476
1480
|
dependencies = [
|
1477
1481
|
{ name = "bs4" },
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# pylint: disable=C0114,C0116
|
2
|
-
|
3
|
-
import pytest
|
4
|
-
|
5
|
-
|
6
|
-
@pytest.mark.parametrize("option", ["-rl", "--regex-delete-line"])
|
7
|
-
def test_delete_line_regex(tte, infile, option):
|
8
|
-
txtfile = infile("sample.txt")
|
9
|
-
tte("massage", txtfile, "-ow", option, "我歌月徘徊")
|
10
|
-
|
11
|
-
with open(txtfile, encoding="utf8") as file:
|
12
|
-
content = file.read()
|
13
|
-
assert "我歌月徘徊" not in content
|
14
|
-
|
15
|
-
|
16
|
-
@pytest.mark.parametrize("option", ["-rr", "--regex-replace"])
|
17
|
-
def test_single_replace_regex(tte, infile, option):
|
18
|
-
txtfile = infile("sample.txt")
|
19
|
-
|
20
|
-
tte("massage", txtfile, "-ow", option, "章", "章:")
|
21
|
-
|
22
|
-
with open(txtfile, encoding="utf8") as file:
|
23
|
-
content = file.read()
|
24
|
-
assert "第1章:" in content
|
25
|
-
assert "第2章:" in content
|
26
|
-
assert "第3章:" in content
|
27
|
-
|
28
|
-
|
29
|
-
@pytest.mark.parametrize("option", ["-rd", "--regex-delete"])
|
30
|
-
def test_single_delete_regex(tte, infile, option):
|
31
|
-
txtfile = infile("sample.txt")
|
32
|
-
tte("massage", txtfile, "-ow", option, "歌月", option, "我")
|
33
|
-
|
34
|
-
with open(txtfile, encoding="utf8") as file:
|
35
|
-
content = file.read()
|
36
|
-
assert "徘徊,舞影零乱。" in content
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo
RENAMED
File without changes
|
{txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po
RENAMED
File without changes
|
{txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo
RENAMED
File without changes
|
{txt2ebook-0.1.140 → txt2ebook-0.1.141}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|