txt2ebook 0.1.135__py3-none-any.whl → 0.1.137__py3-none-any.whl
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/cli.py +15 -9
- txt2ebook/parser.py +1 -1
- txt2ebook/subcommands/env.py +2 -1
- txt2ebook/subcommands/epub.py +2 -1
- {txt2ebook-0.1.135.dist-info → txt2ebook-0.1.137.dist-info}/METADATA +1 -1
- {txt2ebook-0.1.135.dist-info → txt2ebook-0.1.137.dist-info}/RECORD +9 -9
- {txt2ebook-0.1.135.dist-info → txt2ebook-0.1.137.dist-info}/LICENSE.md +0 -0
- {txt2ebook-0.1.135.dist-info → txt2ebook-0.1.137.dist-info}/WHEEL +0 -0
- {txt2ebook-0.1.135.dist-info → txt2ebook-0.1.137.dist-info}/entry_points.txt +0 -0
txt2ebook/cli.py
CHANGED
@@ -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
|
-
|
140
|
-
|
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:
|
txt2ebook/parser.py
CHANGED
@@ -224,7 +224,7 @@ class Parser:
|
|
224
224
|
book_title = self.config.title
|
225
225
|
|
226
226
|
if hasattr(self.config, "translator") and self.config.translator:
|
227
|
-
|
227
|
+
translators = self.config.translator
|
228
228
|
|
229
229
|
logger.info("Found or set book title: %s", book_title)
|
230
230
|
logger.info("Found or set authors: %s", repr(authors))
|
txt2ebook/subcommands/env.py
CHANGED
@@ -38,7 +38,8 @@ def run(_args: argparse.Namespace) -> None:
|
|
38
38
|
"""Run the env subcommand to print environment information.
|
39
39
|
|
40
40
|
Args:
|
41
|
-
_args (argparse.Namespace): Config from command line arguments
|
41
|
+
_args (argparse.Namespace): Config from command line arguments
|
42
|
+
(unused).
|
42
43
|
|
43
44
|
Returns:
|
44
45
|
None
|
txt2ebook/subcommands/epub.py
CHANGED
@@ -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)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
txt2ebook/__init__.py,sha256=wnrJownTB3sKXv3BpcXn4exkpWRSCXhKYWKJib5APNI,3073
|
2
2
|
txt2ebook/__main__.py,sha256=L29rlfPSx9XMnVaHBYP2dyYgDmutJvONR3yUejjYwRY,855
|
3
|
-
txt2ebook/cli.py,sha256=
|
3
|
+
txt2ebook/cli.py,sha256=X91GnzdSTZI4Cl2ttskMmQpBy6QuyENuX_VnwOHtA7Q,4423
|
4
4
|
txt2ebook/exceptions.py,sha256=PT3m85PE5QopHHUfRwEQzp0kJ4AA9yjLO6V6lYC8WhQ,858
|
5
5
|
txt2ebook/formats/__init__.py,sha256=yNF426_jHKNCKenKj1JTbOs22vEBuGScEk6TKhFaZUk,1716
|
6
6
|
txt2ebook/formats/base.py,sha256=ODguJ7OBPXfRQLLeoL-G66NZihroXb4kG5-56ZrlygI,5819
|
@@ -32,10 +32,10 @@ txt2ebook/models/__init__.py,sha256=Z3zClWLj08Q8HgaWV1RRgIKatEhIUfYBAVWm-j4m05w,
|
|
32
32
|
txt2ebook/models/book.py,sha256=OkYg9ogOyH6mizP4qACTBTq4x6OAfY01gmaEzlerhLw,2788
|
33
33
|
txt2ebook/models/chapter.py,sha256=6YvUDHzR6amGMZgkQl_xHWrYZUmlfpF7mnDLilG2BpA,1686
|
34
34
|
txt2ebook/models/volume.py,sha256=koz1KfWjvGWLFbmGEQlZ23frsP93cDsuBMySYBHiXm8,1597
|
35
|
-
txt2ebook/parser.py,sha256=
|
35
|
+
txt2ebook/parser.py,sha256=IOSTbkvLQ9Uvo1hUBDTKozMQagA547N3qr-xU8aE0RI,9009
|
36
36
|
txt2ebook/subcommands/__init__.py,sha256=ldhzvsrMsR8lZmhZef77JFz0jValpV3pytFfwJSkjls,1146
|
37
|
-
txt2ebook/subcommands/env.py,sha256=
|
38
|
-
txt2ebook/subcommands/epub.py,sha256=
|
37
|
+
txt2ebook/subcommands/env.py,sha256=gEzra4b6guy7pRZUTCWX1_eiR7JmrtR1Z-J-vxljvMY,1549
|
38
|
+
txt2ebook/subcommands/epub.py,sha256=WiCah28BV3iS-MjgS7wLWvrInTrglTVcLpRK8mFxfLs,3562
|
39
39
|
txt2ebook/subcommands/gmi.py,sha256=IE6NsQJz7Rz8mXmYgJJXuaaPP7gznf0ZNhxhWFxjjm0,3319
|
40
40
|
txt2ebook/subcommands/massage.py,sha256=EuC-C03NMJk9V1_PEUOa-n4SmQCRpj1TJ_GwSJE8_Ss,11809
|
41
41
|
txt2ebook/subcommands/md.py,sha256=P-oFtb2u-v2F_KU8t249-f5Ihjb_TCT_NWMlOYoq5p4,3330
|
@@ -45,8 +45,8 @@ txt2ebook/subcommands/tex.py,sha256=X6ZBfuAs_mcJe8PNjzoW339ecPynZduVbcCq0henjiA,
|
|
45
45
|
txt2ebook/subcommands/typ.py,sha256=r4Xf7xSINbYfaIKkVzdyQDlUMWPvOIcbvOwC71spu6w,3682
|
46
46
|
txt2ebook/tokenizer.py,sha256=H9AaZVmNP43L3ONvj58u_5weZAjFG9SzQSeS9upGN1U,9642
|
47
47
|
txt2ebook/zh_utils.py,sha256=0Yq9r-JL4HntW68vFR6TBP9yQim1a07mfsh_sp-XmaE,4887
|
48
|
-
txt2ebook-0.1.
|
49
|
-
txt2ebook-0.1.
|
50
|
-
txt2ebook-0.1.
|
51
|
-
txt2ebook-0.1.
|
52
|
-
txt2ebook-0.1.
|
48
|
+
txt2ebook-0.1.137.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
|
49
|
+
txt2ebook-0.1.137.dist-info/METADATA,sha256=xdXDHKv1Ea1W8LTQocp1jcvkrTTlB4iLoR2xYOnns-8,4968
|
50
|
+
txt2ebook-0.1.137.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
51
|
+
txt2ebook-0.1.137.dist-info/entry_points.txt,sha256=AFikuCV6fqf8_GHwsvWuo9jTGNrCkWY1TJWk5GfMWSk,71
|
52
|
+
txt2ebook-0.1.137.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|