txt2ebook 0.1.136__tar.gz → 0.1.137__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 (51) hide show
  1. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/PKG-INFO +1 -1
  2. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/pyproject.toml +1 -1
  3. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/cli.py +15 -9
  4. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/epub.py +2 -1
  5. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/LICENSE.md +0 -0
  6. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/README.md +0 -0
  7. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/__init__.py +0 -0
  8. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/__main__.py +0 -0
  9. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/exceptions.py +0 -0
  10. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/__init__.py +0 -0
  11. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/base.py +0 -0
  12. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/epub.py +0 -0
  13. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/gmi.py +0 -0
  14. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/md.py +0 -0
  15. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/pdf.py +0 -0
  16. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/templates/__init__.py +0 -0
  17. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/templates/epub/__init__.py +0 -0
  18. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/templates/epub/clean.css +0 -0
  19. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/templates/epub/condense.css +0 -0
  20. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/templates/epub/noindent.css +0 -0
  21. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/tex.py +0 -0
  22. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/txt.py +0 -0
  23. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/formats/typ.py +0 -0
  24. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/helpers/__init__.py +0 -0
  25. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/languages/__init__.py +0 -0
  26. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/languages/en.py +0 -0
  27. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/languages/zh_cn.py +0 -0
  28. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/languages/zh_tw.py +0 -0
  29. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo +0 -0
  30. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po +0 -0
  31. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/locales/txt2ebook.pot +0 -0
  32. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo +0 -0
  33. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po +0 -0
  34. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo +0 -0
  35. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po +0 -0
  36. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/models/__init__.py +0 -0
  37. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/models/book.py +0 -0
  38. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/models/chapter.py +0 -0
  39. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/models/volume.py +0 -0
  40. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/parser.py +0 -0
  41. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/__init__.py +0 -0
  42. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/env.py +0 -0
  43. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/gmi.py +0 -0
  44. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/massage.py +0 -0
  45. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/md.py +0 -0
  46. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/parse.py +0 -0
  47. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/pdf.py +0 -0
  48. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/tex.py +0 -0
  49. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/subcommands/typ.py +0 -0
  50. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/tokenizer.py +0 -0
  51. {txt2ebook-0.1.136 → txt2ebook-0.1.137}/src/txt2ebook/zh_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: txt2ebook
3
- Version: 0.1.136
3
+ Version: 0.1.137
4
4
  Summary: CLI tool to convert txt file to ebook format
5
5
  Home-page: https://github.com/kianmeng/txt2ebook
6
6
  License: AGPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "txt2ebook"
3
- version = "0.1.136"
3
+ version = "0.1.137"
4
4
  description = "CLI tool to convert txt file to ebook format"
5
5
  authors = ["Kian-Meng Ang <kianmeng@cpan.org>"]
6
6
  license = "AGPL-3.0-or-later"
@@ -44,6 +44,13 @@ def build_parser() -> argparse.ArgumentParser:
44
44
  ),
45
45
  )
46
46
 
47
+ subparsers = parser.add_subparsers(
48
+ help="sub-command help",
49
+ dest="subcommand",
50
+ required=True,
51
+ )
52
+ txt2ebook.subcommands.build_subparser(subparsers)
53
+
47
54
  parser.add_argument(
48
55
  "-of",
49
56
  "--output-folder",
@@ -124,9 +131,6 @@ def build_parser() -> argparse.ArgumentParser:
124
131
  version=f"%(prog)s {__version__}",
125
132
  )
126
133
 
127
- subparsers = parser.add_subparsers(help="sub-command help")
128
- txt2ebook.subcommands.build_subparser(subparsers)
129
-
130
134
  return parser
131
135
 
132
136
 
@@ -136,16 +140,18 @@ def main(args: Optional[Sequence[str]] = None):
136
140
 
137
141
  try:
138
142
  parser = build_parser()
139
- if len(args) == 0:
140
- parser.print_help(sys.stderr)
141
- else:
142
- parsed_args = parser.parse_args(args)
143
- setup_logger(parsed_args)
143
+ parsed_args = parser.parse_args(args)
144
+ setup_logger(parsed_args)
144
145
 
146
+ if parsed_args.subcommand is not None:
147
+ logger.debug(parsed_args)
145
148
  if hasattr(parsed_args, "func"):
146
- logger.debug(parsed_args)
147
149
  parsed_args.func(parsed_args)
148
150
  else:
151
+ logger.error(
152
+ "subcommand '%s' is missing its execution function.",
153
+ parsed_args.command
154
+ )
149
155
  parser.print_help(sys.stderr)
150
156
 
151
157
  except Exception as error:
@@ -30,7 +30,8 @@ logger = logging.getLogger(__name__)
30
30
  def build_subparser(subparsers) -> None:
31
31
  """Build the subparser."""
32
32
  epub_parser = subparsers.add_parser(
33
- "epub", help="generate ebook in EPUB format"
33
+ "epub", help="generate ebook in EPUB format",
34
+ formatter_class=argparse.RawTextHelpFormatter
34
35
  )
35
36
 
36
37
  epub_parser.set_defaults(func=run)
File without changes
File without changes