txt2ebook 0.1.139__tar.gz → 0.1.140__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.
Files changed (110) hide show
  1. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/.pre-commit-config.yaml +0 -1
  2. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/CHANGELOG.md +9 -2
  3. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/PKG-INFO +1 -1
  4. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/noxfile.py +6 -3
  5. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/pyproject.toml +1 -1
  6. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/__init__.py +4 -3
  7. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/cli.py +4 -4
  8. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/__init__.py +0 -3
  9. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/helpers/__init__.py +1 -4
  10. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/models/book.py +5 -5
  11. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/parser.py +4 -3
  12. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/epub.py +5 -5
  13. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/gmi.py +1 -2
  14. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/md.py +1 -2
  15. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/pdf.py +2 -3
  16. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/typ.py +2 -3
  17. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/tokenizer.py +0 -1
  18. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_subcommand_epub.py +0 -1
  19. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/uv.lock +22 -19
  20. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/.coveragerc +0 -0
  21. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/.gitignore +0 -0
  22. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/.python-version +0 -0
  23. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/CONTRIBUTING.md +0 -0
  24. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/LICENSE.md +0 -0
  25. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/README.md +0 -0
  26. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/Makefile +0 -0
  27. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/make.bat +0 -0
  28. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/CHANGELOG.md +0 -0
  29. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/CONTRIBUTING.md +0 -0
  30. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/LICENSE.md +0 -0
  31. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/README.md +0 -0
  32. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/_static/logo.png +0 -0
  33. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/conf.py +0 -0
  34. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/index.rst +0 -0
  35. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/txt2ebook.formats.rst +0 -0
  36. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/txt2ebook.helpers.rst +0 -0
  37. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/txt2ebook.models.rst +0 -0
  38. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/txt2ebook.parsers.rst +0 -0
  39. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/docs/source/txt2ebook.rst +0 -0
  40. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/__main__.py +0 -0
  41. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/exceptions.py +0 -0
  42. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/base.py +0 -0
  43. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/epub.py +0 -0
  44. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/gmi.py +0 -0
  45. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/md.py +0 -0
  46. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/pdf.py +0 -0
  47. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/templates/__init__.py +0 -0
  48. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/templates/epub/__init__.py +0 -0
  49. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/templates/epub/clean.css +0 -0
  50. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/templates/epub/condense.css +0 -0
  51. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/templates/epub/noindent.css +0 -0
  52. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/tex.py +0 -0
  53. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/txt.py +0 -0
  54. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/formats/typ.py +0 -0
  55. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/languages/__init__.py +0 -0
  56. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/languages/en.py +0 -0
  57. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/languages/zh_cn.py +0 -0
  58. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/languages/zh_tw.py +0 -0
  59. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo +0 -0
  60. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po +0 -0
  61. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/locales/txt2ebook.pot +0 -0
  62. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo +0 -0
  63. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po +0 -0
  64. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo +0 -0
  65. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po +0 -0
  66. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/models/__init__.py +0 -0
  67. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/models/chapter.py +0 -0
  68. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/models/volume.py +0 -0
  69. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/__init__.py +0 -0
  70. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/env.py +0 -0
  71. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/massage.py +0 -0
  72. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/parse.py +0 -0
  73. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/subcommands/tex.py +1 -1
  74. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/src/txt2ebook/zh_utils.py +0 -0
  75. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/__init__.py +0 -0
  76. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/conftest.py +0 -0
  77. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/empty_file.txt +0 -0
  78. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/missing_chapters.txt +0 -0
  79. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/sample.txt +0 -0
  80. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/sample_all_headers.txt +0 -0
  81. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/sample_long_headers.txt +0 -0
  82. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/sample_remove_wrapping.txt +0 -0
  83. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/sample_unsorted_headers.txt +0 -0
  84. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/sample_with_issues.txt +0 -0
  85. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/fixtures/sample_with_metadata.txt +0 -0
  86. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_epub_writer.py +0 -0
  87. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_filename_format_flag.py +0 -0
  88. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_format_option.py +0 -0
  89. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_header_number_flag.py +0 -0
  90. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_input_file_arg.py +0 -0
  91. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_language_option.py +0 -0
  92. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_output_file_arg.py +0 -0
  93. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_overwrite_flag.py +0 -0
  94. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_parser.py +0 -0
  95. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_purge_flag.py +0 -0
  96. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_quiet_flag.py +0 -0
  97. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_raise_warnings.py +0 -0
  98. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_sort_volume_and_chapter_flag.py +0 -0
  99. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_split_volume_and_chapter_flag.py +0 -0
  100. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_subcommand_env.py +0 -0
  101. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_subcommand_massage.py +0 -0
  102. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_test_parsing_flag.py +0 -0
  103. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_tokenizer.py +0 -0
  104. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_translator_option.py +0 -0
  105. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_txt2ebook.py +0 -0
  106. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_verbose_flag.py +0 -0
  107. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_volume_page_flag.py +0 -0
  108. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_zh_utils_zh_halfwidth_to_fullwidth.py +0 -0
  109. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_zh_utils_zh_numeric.py +0 -0
  110. {txt2ebook-0.1.139 → txt2ebook-0.1.140}/tests/test_zh_utils_zh_words_to_numbers.py +0 -0
@@ -86,7 +86,6 @@ repos:
86
86
  - flake8-pytest-style
87
87
  - flake8-simplify
88
88
  args:
89
- - --docstring-convention=google
90
89
  - --show-source
91
90
  - --max-line-length=79
92
91
  - --docstring-convention=google
@@ -7,6 +7,14 @@ and this project adheres to [0-based versioning](https://0ver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## v0.1.140 (2025-05-18)
11
+
12
+ - Bump deps
13
+ - Bump local editable installation
14
+ - Remove duplicate `pre-commit` config item
15
+ - Remove unused `cjkwrap` import
16
+ - Remove unused field import
17
+
10
18
  ## v0.1.139 (2025-05-11)
11
19
 
12
20
  - Bump deps
@@ -189,13 +197,12 @@ and this project adheres to [0-based versioning](https://0ver.org/).
189
197
 
190
198
  - Bump deps and `pre-commit` hooks
191
199
  - Migrate `typ` and `pdf` format to subcommand
192
- - Migrate deprecated regex-* options test cases
200
+ - Migrate deprecated regex-\* options test cases
193
201
  - Refactor `massage` subcommand
194
202
  - Refactor language detection and validation
195
203
  - Remove Tokenizer from handling `fullwidth` flag
196
204
  - Set `deps` job in `nox` to Python 3.9
197
205
 
198
-
199
206
  ## v0.1.113 (2024-11-10)
200
207
 
201
208
  - Extract top keywords from txt file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2ebook
3
- Version: 0.1.139
3
+ Version: 0.1.140
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
@@ -16,7 +16,6 @@
16
16
  """Nox configuration."""
17
17
 
18
18
  import datetime
19
- import re
20
19
 
21
20
  import nox
22
21
 
@@ -188,9 +187,13 @@ def release(session: nox.Session) -> None:
188
187
  """Bump release."""
189
188
  _uv_install(session)
190
189
 
191
- before_version = session.run("uv", "version", "--short", silent=True).strip()
190
+ before_version = session.run(
191
+ "uv", "version", "--short", silent=True
192
+ ).strip()
192
193
  session.run("uv", "version", "--bump", "patch")
193
- after_version = session.run("uv", "version", "--short", silent=True).strip()
194
+ after_version = session.run(
195
+ "uv", "version", "--short", silent=True
196
+ ).strip()
194
197
 
195
198
  _search_and_replace(
196
199
  "src/txt2ebook/__init__.py", before_version, after_version
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "txt2ebook"
3
- version = "0.1.139"
3
+ version = "0.1.140"
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"
@@ -18,7 +18,6 @@
18
18
  import argparse
19
19
  import logging
20
20
  import platform
21
- from typing import Optional
22
21
  import sys
23
22
 
24
23
  import langdetect
@@ -51,7 +50,9 @@ def setup_logger(config: argparse.Namespace) -> None:
51
50
  )
52
51
 
53
52
 
54
- def log_or_raise_on_warning(message: str, raise_on_warning: bool = False) -> None:
53
+ def log_or_raise_on_warning(
54
+ message: str, raise_on_warning: bool = False
55
+ ) -> None:
55
56
  """Logs a warning message or raises an exception.
56
57
 
57
58
  Args:
@@ -87,7 +88,7 @@ def detect_and_expect_language(content: str, config_language: str) -> str:
87
88
  Returns:
88
89
  The configured language, or the detected language if none is
89
90
  configured.
90
- """
91
+ """
91
92
  detect_language = langdetect.detect(content)
92
93
  config_language = config_language or detect_language
93
94
  logger.info("Config language: %s", config_language)
@@ -15,9 +15,9 @@
15
15
 
16
16
  """txt2ebook/tte is a cli tool to convert txt file to ebook format.
17
17
 
18
- website: https://github.com/kianmeng/txt2ebook
19
- changelog: https://github.com/kianmeng/txt2ebook/blob/master/CHANGELOG.md
20
- issues: https://github.com/kianmeng/txt2ebook/issues
18
+ website: https://github.com/kianmeng/txt2ebook
19
+ changelog: https://github.com/kianmeng/txt2ebook/blob/master/CHANGELOG.md
20
+ issues: https://github.com/kianmeng/txt2ebook/issues
21
21
  """
22
22
 
23
23
  import argparse
@@ -150,7 +150,7 @@ def main(args: Optional[Sequence[str]] = None):
150
150
  else:
151
151
  logger.error(
152
152
  "subcommand '%s' is missing its execution function.",
153
- parsed_args.command
153
+ parsed_args.command,
154
154
  )
155
155
  parser.print_help(sys.stderr)
156
156
 
@@ -15,10 +15,7 @@
15
15
 
16
16
  """Packpage of different e-book formats."""
17
17
 
18
- import argparse
19
- from typing import Union
20
18
 
21
- import txt2ebook.models.book
22
19
  from txt2ebook.formats.epub import TEMPLATES as EPUB_TEMPLATES
23
20
  from txt2ebook.formats.epub import EpubWriter
24
21
  from txt2ebook.formats.gmi import GmiWriter
@@ -17,9 +17,6 @@
17
17
 
18
18
  import logging
19
19
  import re
20
- import sys
21
- from importlib import import_module
22
- from typing import Any
23
20
 
24
21
  logger = logging.getLogger(__name__)
25
22
 
@@ -42,4 +39,4 @@ def lower_underscore(string: str) -> str:
42
39
  >>> lower_underscore("Hello\tWorld")
43
40
  'hello_world'
44
41
  """
45
- return re.sub(r'\s+', '_', string.lower().strip())
42
+ return re.sub(r"\s+", "_", string.lower().strip())
@@ -40,9 +40,7 @@ class Book:
40
40
  language: str = field(default="")
41
41
  cover: str = field(default="", repr=False)
42
42
  raw_content: str = field(default="", repr=False)
43
- toc: List[Union[Volume, Chapter]] = field(
44
- default_factory=list, repr=False
45
- )
43
+ toc: List[Union[Volume, Chapter]] = field(default_factory=list, repr=False)
46
44
 
47
45
  def stats(self) -> Counter:
48
46
  """Returns the statistics count for the parsed tokens.
@@ -61,12 +59,14 @@ class Book:
61
59
  authors = ", ".join(self.authors)
62
60
  format_options = {
63
61
  1: f"{self.title}_{authors}",
64
- 2: f"{authors}_{self.title}"
62
+ 2: f"{authors}_{self.title}",
65
63
  }
66
64
  try:
67
65
  return format_options[filename_format]
68
66
  except KeyError:
69
- raise AttributeError(f"Invalid filename format: '{filename_format}'!")
67
+ raise AttributeError(
68
+ f"Invalid filename format: '{filename_format}'!"
69
+ )
70
70
 
71
71
  def debug(self, verbosity: int = 1) -> None:
72
72
  """Dump debug log of sections in self.toc."""
@@ -17,11 +17,10 @@
17
17
 
18
18
  import argparse
19
19
  import logging
20
- from dataclasses import dataclass, field
20
+ from dataclasses import dataclass
21
21
  from importlib import import_module
22
22
  from typing import List, Tuple, Union
23
23
 
24
- import cjkwrap
25
24
  import regex as re
26
25
 
27
26
  from txt2ebook.models import Book, Chapter, Volume
@@ -88,7 +87,9 @@ class Parser:
88
87
  Returns:
89
88
  str: The formatted section header.
90
89
  """
91
- if not getattr(self.config, "header_number", False) or self.config.language not in (
90
+ if not getattr(
91
+ self.config, "header_number", False
92
+ ) or self.config.language not in (
92
93
  "zh-cn",
93
94
  "zh-tw",
94
95
  ):
@@ -19,10 +19,9 @@ import argparse
19
19
  import logging
20
20
  import sys
21
21
 
22
- from txt2ebook.subcommands.parse import run as parse_txt
23
- from txt2ebook.formats.epub import EpubWriter
24
22
  from txt2ebook.formats import EPUB_TEMPLATES
25
-
23
+ from txt2ebook.formats.epub import EpubWriter
24
+ from txt2ebook.subcommands.parse import run as parse_txt
26
25
 
27
26
  logger = logging.getLogger(__name__)
28
27
 
@@ -30,8 +29,9 @@ logger = logging.getLogger(__name__)
30
29
  def build_subparser(subparsers) -> None:
31
30
  """Build the subparser."""
32
31
  epub_parser = subparsers.add_parser(
33
- "epub", help="generate ebook in EPUB format",
34
- formatter_class=argparse.RawTextHelpFormatter
32
+ "epub",
33
+ help="generate ebook in EPUB format",
34
+ formatter_class=argparse.RawTextHelpFormatter,
35
35
  )
36
36
 
37
37
  epub_parser.set_defaults(func=run)
@@ -19,9 +19,8 @@ import argparse
19
19
  import logging
20
20
  import sys
21
21
 
22
- from txt2ebook.subcommands.parse import run as parse_txt
23
22
  from txt2ebook.formats.gmi import GmiWriter
24
-
23
+ from txt2ebook.subcommands.parse import run as parse_txt
25
24
 
26
25
  logger = logging.getLogger(__name__)
27
26
 
@@ -19,9 +19,8 @@ import argparse
19
19
  import logging
20
20
  import sys
21
21
 
22
- from txt2ebook.subcommands.parse import run as parse_txt
23
22
  from txt2ebook.formats.md import MdWriter as MarkdownWriter
24
-
23
+ from txt2ebook.subcommands.parse import run as parse_txt
25
24
 
26
25
  logger = logging.getLogger(__name__)
27
26
 
@@ -19,10 +19,9 @@ import argparse
19
19
  import logging
20
20
  import sys
21
21
 
22
- from txt2ebook.subcommands.parse import run as parse_txt
23
- from txt2ebook.formats.pdf import PdfWriter
24
22
  from txt2ebook.formats import PAGE_SIZES
25
-
23
+ from txt2ebook.formats.pdf import PdfWriter
24
+ from txt2ebook.subcommands.parse import run as parse_txt
26
25
 
27
26
  logger = logging.getLogger(__name__)
28
27
 
@@ -19,10 +19,9 @@ import argparse
19
19
  import logging
20
20
  import sys
21
21
 
22
- from txt2ebook.subcommands.parse import run as parse_txt
23
- from txt2ebook.formats.typ import TypWriter
24
22
  from txt2ebook.formats import PAGE_SIZES
25
-
23
+ from txt2ebook.formats.typ import TypWriter
24
+ from txt2ebook.subcommands.parse import run as parse_txt
26
25
 
27
26
  logger = logging.getLogger(__name__)
28
27
 
@@ -169,7 +169,6 @@ class Tokenizer:
169
169
 
170
170
  return metadata
171
171
 
172
-
173
172
  def _tokenize_content(self) -> None:
174
173
  # Determine the actual content part, after any metadata block
175
174
  metadata_block_re = (
@@ -1,7 +1,6 @@
1
1
  # pylint: disable=C0114,C0116
2
2
 
3
3
  import pytest
4
-
5
4
  from ebooklib import epub
6
5
 
7
6
 
@@ -36,14 +36,14 @@ wheels = [
36
36
 
37
37
  [[package]]
38
38
  name = "astroid"
39
- version = "3.3.9"
39
+ version = "3.3.10"
40
40
  source = { registry = "https://pypi.org/simple" }
41
41
  dependencies = [
42
42
  { name = "typing-extensions", marker = "python_full_version < '3.11'" },
43
43
  ]
44
- sdist = { url = "https://files.pythonhosted.org/packages/39/33/536530122a22a7504b159bccaf30a1f76aa19d23028bd8b5009eb9b2efea/astroid-3.3.9.tar.gz", hash = "sha256:622cc8e3048684aa42c820d9d218978021c3c3d174fb03a9f0d615921744f550", size = 398731, upload-time = "2025-03-09T11:54:36.388Z" }
44
+ sdist = { url = "https://files.pythonhosted.org/packages/00/c2/9b2de9ed027f9fe5734a6c0c0a601289d796b3caaf1e372e23fa88a73047/astroid-3.3.10.tar.gz", hash = "sha256:c332157953060c6deb9caa57303ae0d20b0fbdb2e59b4a4f2a6ba49d0a7961ce", size = 398941, upload-time = "2025-05-10T13:33:10.405Z" }
45
45
  wheels = [
46
- { url = "https://files.pythonhosted.org/packages/de/80/c749efbd8eef5ea77c7d6f1956e8fbfb51963b7f93ef79647afd4d9886e3/astroid-3.3.9-py3-none-any.whl", hash = "sha256:d05bfd0acba96a7bd43e222828b7d9bc1e138aaeb0649707908d3702a9831248", size = 275339, upload-time = "2025-03-09T11:54:34.489Z" },
46
+ { url = "https://files.pythonhosted.org/packages/15/58/5260205b9968c20b6457ed82f48f9e3d6edf2f1f95103161798b73aeccf0/astroid-3.3.10-py3-none-any.whl", hash = "sha256:104fb9cb9b27ea95e847a94c003be03a9e039334a8ebca5ee27dafaf5c5711eb", size = 275388, upload-time = "2025-05-10T13:33:08.391Z" },
47
47
  ]
48
48
 
49
49
  [[package]]
@@ -353,11 +353,14 @@ sdist = { url = "https://files.pythonhosted.org/packages/00/38/7d6ab2e569a916524
353
353
 
354
354
  [[package]]
355
355
  name = "exceptiongroup"
356
- version = "1.2.2"
356
+ version = "1.3.0"
357
357
  source = { registry = "https://pypi.org/simple" }
358
- sdist = { url = "https://files.pythonhosted.org/packages/09/35/2495c4ac46b980e4ca1f6ad6db102322ef3ad2410b79fdde159a4b0f3b92/exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc", size = 28883, upload-time = "2024-07-12T22:26:00.161Z" }
358
+ dependencies = [
359
+ { name = "typing-extensions", marker = "python_full_version < '3.11'" },
360
+ ]
361
+ sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749, upload-time = "2025-05-10T17:42:51.123Z" }
359
362
  wheels = [
360
- { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453, upload-time = "2024-07-12T22:25:58.476Z" },
363
+ { url = "https://files.pythonhosted.org/packages/36/f4/c6e662dade71f56cd2f3735141b265c3c79293c109549c1e6933b0651ffc/exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10", size = 16674, upload-time = "2025-05-10T17:42:49.33Z" },
361
364
  ]
362
365
 
363
366
  [[package]]
@@ -961,11 +964,11 @@ wheels = [
961
964
 
962
965
  [[package]]
963
966
  name = "pluggy"
964
- version = "1.5.0"
967
+ version = "1.6.0"
965
968
  source = { registry = "https://pypi.org/simple" }
966
- sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955, upload-time = "2024-04-20T21:34:42.531Z" }
969
+ sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
967
970
  wheels = [
968
- { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" },
971
+ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
969
972
  ]
970
973
 
971
974
  [[package]]
@@ -1208,15 +1211,15 @@ wheels = [
1208
1211
 
1209
1212
  [[package]]
1210
1213
  name = "reportlab"
1211
- version = "4.4.0"
1214
+ version = "4.4.1"
1212
1215
  source = { registry = "https://pypi.org/simple" }
1213
1216
  dependencies = [
1214
1217
  { name = "chardet" },
1215
1218
  { name = "pillow" },
1216
1219
  ]
1217
- sdist = { url = "https://files.pythonhosted.org/packages/88/69/291a56d8bb177017e6e5421c34baa51b2e9017434c0ca1822e5007e45a26/reportlab-4.4.0.tar.gz", hash = "sha256:a64d85513910e246c21dc97ccc3c9054a1d44370bf8fc1fab80af937814354d5", size = 3597413, upload-time = "2025-04-22T08:34:59.213Z" }
1220
+ sdist = { url = "https://files.pythonhosted.org/packages/7b/d8/c3366bf10a5a5fcc3467eefa9504f6aa24fcda5817b5b147eabd37a385e1/reportlab-4.4.1.tar.gz", hash = "sha256:5f9b9fc0b7a48e8912c25ccf69d26b82980ab0da718e4f583fa720e8f8f5073f", size = 3509107, upload-time = "2025-05-15T08:07:02.539Z" }
1218
1221
  wheels = [
1219
- { url = "https://files.pythonhosted.org/packages/52/15/4702e132ae36beb8daf3e20a92f166451148c4a89650cc9d3f19b3c66714/reportlab-4.4.0-py3-none-any.whl", hash = "sha256:0a993f1d4a765fcbdf4e26adc96b3351004ebf4d27583340595ba7edafebec32", size = 1953103, upload-time = "2025-04-17T16:04:03.876Z" },
1222
+ { url = "https://files.pythonhosted.org/packages/a1/2e/7994a139150abf11c8dd258feb091ad654823a83cfd9720bfdded27185c3/reportlab-4.4.1-py3-none-any.whl", hash = "sha256:9217a1c8c1917217f819718b24972a96ad0c485a1c494749562d097b58d974b7", size = 1953615, upload-time = "2025-05-15T08:06:59.248Z" },
1220
1223
  ]
1221
1224
 
1222
1225
  [[package]]
@@ -1256,11 +1259,11 @@ sdist = { url = "https://files.pythonhosted.org/packages/c8/48/609b5463da485943d
1256
1259
 
1257
1260
  [[package]]
1258
1261
  name = "setuptools"
1259
- version = "80.3.1"
1262
+ version = "80.7.1"
1260
1263
  source = { registry = "https://pypi.org/simple" }
1261
- sdist = { url = "https://files.pythonhosted.org/packages/70/dc/3976b322de9d2e87ed0007cf04cc7553969b6c7b3f48a565d0333748fbcd/setuptools-80.3.1.tar.gz", hash = "sha256:31e2c58dbb67c99c289f51c16d899afedae292b978f8051efaf6262d8212f927", size = 1315082, upload-time = "2025-05-04T18:47:04.397Z" }
1264
+ sdist = { url = "https://files.pythonhosted.org/packages/9e/8b/dc1773e8e5d07fd27c1632c45c1de856ac3dbf09c0147f782ca6d990cf15/setuptools-80.7.1.tar.gz", hash = "sha256:f6ffc5f0142b1bd8d0ca94ee91b30c0ca862ffd50826da1ea85258a06fd94552", size = 1319188, upload-time = "2025-05-15T02:41:00.955Z" }
1262
1265
  wheels = [
1263
- { url = "https://files.pythonhosted.org/packages/53/7e/5d8af3317ddbf9519b687bd1c39d8737fde07d97f54df65553faca5cffb1/setuptools-80.3.1-py3-none-any.whl", hash = "sha256:ea8e00d7992054c4c592aeb892f6ad51fe1b4d90cc6947cc45c45717c40ec537", size = 1201172, upload-time = "2025-05-04T18:47:02.575Z" },
1266
+ { url = "https://files.pythonhosted.org/packages/a1/18/0e835c3a557dc5faffc8f91092f62fc337c1dab1066715842e7a4b318ec4/setuptools-80.7.1-py3-none-any.whl", hash = "sha256:ca5cc1069b85dc23070a6628e6bcecb3292acac802399c7f8edc0100619f9009", size = 1200776, upload-time = "2025-05-15T02:40:58.887Z" },
1264
1267
  ]
1265
1268
 
1266
1269
  [[package]]
@@ -1274,11 +1277,11 @@ wheels = [
1274
1277
 
1275
1278
  [[package]]
1276
1279
  name = "snowballstemmer"
1277
- version = "3.0.0.1"
1280
+ version = "3.0.1"
1278
1281
  source = { registry = "https://pypi.org/simple" }
1279
- sdist = { url = "https://files.pythonhosted.org/packages/71/81/f47e97c9850c529ab233fd1cd8319e0e5a1cfae49c87c49ab2fd0a19c744/snowballstemmer-3.0.0.1.tar.gz", hash = "sha256:1d09493a5ecc85fb5b433674e9c83fcd41c6739b6979ce4b54e81a40ec078342", size = 105321, upload-time = "2025-05-08T12:30:36.516Z" }
1282
+ sdist = { url = "https://files.pythonhosted.org/packages/75/a7/9810d872919697c9d01295633f5d574fb416d47e535f258272ca1f01f447/snowballstemmer-3.0.1.tar.gz", hash = "sha256:6d5eeeec8e9f84d4d56b847692bacf79bc2c8e90c7f80ca4444ff8b6f2e52895", size = 105575, upload-time = "2025-05-09T16:34:51.843Z" }
1280
1283
  wheels = [
1281
- { url = "https://files.pythonhosted.org/packages/17/29/38d0cd1c958894aa042433a1515b7dab49a0a79b39df953b30b7ded716ce/snowballstemmer-3.0.0.1-py3-none-any.whl", hash = "sha256:d1cdabc06fb492e80620d9e2c44d39e67cfda290b2aaef8718b0691079443b10", size = 103250, upload-time = "2025-05-08T12:30:34.651Z" },
1284
+ { url = "https://files.pythonhosted.org/packages/c8/78/3565d011c61f5a43488987ee32b6f3f656e7f107ac2782dd57bdd7d91d9a/snowballstemmer-3.0.1-py3-none-any.whl", hash = "sha256:6cd7b3897da8d6c9ffb968a6781fa6532dce9c3618a4b127d920dab764a19064", size = 103274, upload-time = "2025-05-09T16:34:50.371Z" },
1282
1285
  ]
1283
1286
 
1284
1287
  [[package]]
@@ -1468,7 +1471,7 @@ wheels = [
1468
1471
 
1469
1472
  [[package]]
1470
1473
  name = "txt2ebook"
1471
- version = "0.1.138"
1474
+ version = "0.1.139"
1472
1475
  source = { editable = "." }
1473
1476
  dependencies = [
1474
1477
  { name = "bs4" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -19,8 +19,8 @@ import argparse
19
19
  import logging
20
20
  import sys
21
21
 
22
- from txt2ebook.subcommands.parse import run as parse_txt
23
22
  from txt2ebook.formats.tex import TexWriter
23
+ from txt2ebook.subcommands.parse import run as parse_txt
24
24
 
25
25
  logger = logging.getLogger(__name__)
26
26