txt2ebook 0.1.136__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/subcommands/epub.py +2 -1
- {txt2ebook-0.1.136.dist-info → txt2ebook-0.1.137.dist-info}/METADATA +1 -1
- {txt2ebook-0.1.136.dist-info → txt2ebook-0.1.137.dist-info}/RECORD +7 -7
- {txt2ebook-0.1.136.dist-info → txt2ebook-0.1.137.dist-info}/LICENSE.md +0 -0
- {txt2ebook-0.1.136.dist-info → txt2ebook-0.1.137.dist-info}/WHEEL +0 -0
- {txt2ebook-0.1.136.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/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
|
@@ -35,7 +35,7 @@ txt2ebook/models/volume.py,sha256=koz1KfWjvGWLFbmGEQlZ23frsP93cDsuBMySYBHiXm8,15
|
|
35
35
|
txt2ebook/parser.py,sha256=IOSTbkvLQ9Uvo1hUBDTKozMQagA547N3qr-xU8aE0RI,9009
|
36
36
|
txt2ebook/subcommands/__init__.py,sha256=ldhzvsrMsR8lZmhZef77JFz0jValpV3pytFfwJSkjls,1146
|
37
37
|
txt2ebook/subcommands/env.py,sha256=gEzra4b6guy7pRZUTCWX1_eiR7JmrtR1Z-J-vxljvMY,1549
|
38
|
-
txt2ebook/subcommands/epub.py,sha256=
|
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
|