txt2ebook 0.1.143__py3-none-any.whl → 0.1.145__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.
@@ -1,26 +1,26 @@
1
- #: src/txt2ebook/formats/base.py:140
1
+ #: src/txt2ebook/formats/base.py:137
2
2
  msgid "title:"
3
3
  msgstr "Title:"
4
4
 
5
- #: src/txt2ebook/formats/base.py:141
5
+ #: src/txt2ebook/formats/base.py:138
6
6
  msgid "author:"
7
7
  msgstr "Author:"
8
8
 
9
- #: src/txt2ebook/formats/base.py:142
9
+ #: src/txt2ebook/formats/base.py:139
10
10
  msgid "translator:"
11
11
  msgstr "Translator:"
12
12
 
13
- #: src/txt2ebook/formats/base.py:143
13
+ #: src/txt2ebook/formats/base.py:140
14
14
  msgid "tag:"
15
15
  msgstr "Tag:"
16
16
 
17
- #: src/txt2ebook/formats/base.py:154 src/txt2ebook/formats/gmi.py:62
17
+ #: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
18
18
  #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
19
  #: src/txt2ebook/formats/txt.py:71
20
20
  msgid "toc"
21
21
  msgstr "Table of Content"
22
22
 
23
- #: src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:141
24
24
  msgid "cover"
25
25
  msgstr "Cover"
26
26
 
@@ -1,26 +1,26 @@
1
- #: src/txt2ebook/formats/base.py:140
1
+ #: src/txt2ebook/formats/base.py:137
2
2
  msgid "title:"
3
3
  msgstr ""
4
4
 
5
- #: src/txt2ebook/formats/base.py:141
5
+ #: src/txt2ebook/formats/base.py:138
6
6
  msgid "author:"
7
7
  msgstr ""
8
8
 
9
- #: src/txt2ebook/formats/base.py:142
9
+ #: src/txt2ebook/formats/base.py:139
10
10
  msgid "translator:"
11
11
  msgstr ""
12
12
 
13
- #: src/txt2ebook/formats/base.py:143
13
+ #: src/txt2ebook/formats/base.py:140
14
14
  msgid "tag:"
15
15
  msgstr ""
16
16
 
17
- #: src/txt2ebook/formats/base.py:154 src/txt2ebook/formats/gmi.py:62
17
+ #: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
18
18
  #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
19
  #: src/txt2ebook/formats/txt.py:71
20
20
  msgid "toc"
21
21
  msgstr ""
22
22
 
23
- #: src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:141
24
24
  msgid "cover"
25
25
  msgstr ""
26
26
 
@@ -1,26 +1,26 @@
1
- #: src/txt2ebook/formats/base.py:140
1
+ #: src/txt2ebook/formats/base.py:137
2
2
  msgid "title:"
3
3
  msgstr "书名:"
4
4
 
5
- #: src/txt2ebook/formats/base.py:141
5
+ #: src/txt2ebook/formats/base.py:138
6
6
  msgid "author:"
7
7
  msgstr "作者:"
8
8
 
9
- #: src/txt2ebook/formats/base.py:142
9
+ #: src/txt2ebook/formats/base.py:139
10
10
  msgid "translator:"
11
11
  msgstr "翻译:"
12
12
 
13
- #: src/txt2ebook/formats/base.py:143
13
+ #: src/txt2ebook/formats/base.py:140
14
14
  msgid "tag:"
15
15
  msgstr "票签:"
16
16
 
17
- #: src/txt2ebook/formats/base.py:154 src/txt2ebook/formats/gmi.py:62
17
+ #: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
18
18
  #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
19
  #: src/txt2ebook/formats/txt.py:71
20
20
  msgid "toc"
21
21
  msgstr "目录"
22
22
 
23
- #: src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:141
24
24
  msgid "cover"
25
25
  msgstr "封面"
26
26
 
@@ -1,26 +1,26 @@
1
- #: src/txt2ebook/formats/base.py:140
1
+ #: src/txt2ebook/formats/base.py:137
2
2
  msgid "title:"
3
3
  msgstr "书名:"
4
4
 
5
- #: src/txt2ebook/formats/base.py:141
5
+ #: src/txt2ebook/formats/base.py:138
6
6
  msgid "author:"
7
7
  msgstr "作者:"
8
8
 
9
- #: src/txt2ebook/formats/base.py:142
9
+ #: src/txt2ebook/formats/base.py:139
10
10
  msgid "translator:"
11
11
  msgstr "翻译:"
12
12
 
13
- #: src/txt2ebook/formats/base.py:143
13
+ #: src/txt2ebook/formats/base.py:140
14
14
  msgid "tag:"
15
15
  msgstr "标签:"
16
16
 
17
- #: src/txt2ebook/formats/base.py:154 src/txt2ebook/formats/gmi.py:62
17
+ #: src/txt2ebook/formats/base.py:146 src/txt2ebook/formats/gmi.py:62
18
18
  #: src/txt2ebook/formats/md.py:61 src/txt2ebook/formats/pdf.py:130
19
19
  #: src/txt2ebook/formats/txt.py:71
20
20
  msgid "toc"
21
21
  msgstr "目录"
22
22
 
23
- #: src/txt2ebook/formats/epub.py:147
23
+ #: src/txt2ebook/formats/epub.py:141
24
24
  msgid "cover"
25
25
  msgstr "封面"
26
26
 
txt2ebook/models/book.py CHANGED
@@ -20,8 +20,6 @@ from collections import Counter
20
20
  from dataclasses import dataclass, field
21
21
  from typing import List, Union
22
22
 
23
- from typing_extensions import Literal
24
-
25
23
  from txt2ebook.models.chapter import Chapter
26
24
  from txt2ebook.models.volume import Volume
27
25
 
@@ -52,7 +50,7 @@ class Book:
52
50
  logger.debug("Book stats: %s", repr(stats))
53
51
  return stats
54
52
 
55
- def filename_format(self, filename_format: Union[str, Literal[True]]) -> str:
53
+ def filename_format(self, filename_format: int) -> str:
56
54
  """Generate the filename format based on the available selection."""
57
55
  authors = ", ".join(self.authors)
58
56
  format_options = {
@@ -202,8 +202,10 @@ def run(args: argparse.Namespace) -> None:
202
202
  """
203
203
  massaged_txt = massage_txt(args)
204
204
  args.language = detect_and_expect_language(massaged_txt, args.language)
205
+ config_lang = args.language.replace("-", "_")
206
+ langconf = import_module(f"txt2ebook.languages.{config_lang}")
205
207
  args.with_toc = False
206
- parser = Parser(massaged_txt, args)
208
+ parser = Parser(massaged_txt, args, langconf)
207
209
  book = parser.parse()
208
210
 
209
211
  if args.debug:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txt2ebook
3
- Version: 0.1.143
3
+ Version: 0.1.145
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
@@ -24,29 +24,29 @@ txt2ebook/languages/__init__.py,sha256=1AfDn-D0q-dvODGP-9KxPHY_Wtk-ifZdN1FutZMT9
24
24
  txt2ebook/languages/en.py,sha256=e5VzZwfrO2kABMwEB0l--eo4XbOre6f6uJ-ySU3ORT8,960
25
25
  txt2ebook/languages/zh_cn.py,sha256=lcbgPFO4Uaog8sKHKF5fQtvRwkKiQ3v5wMvYNEvNk9k,1943
26
26
  txt2ebook/languages/zh_tw.py,sha256=_fdXOOSLK0nTMuBe1Om2qjb4zr2PVd6N4xi2rrYkNTI,1515
27
- txt2ebook/locales/txt2ebook.pot,sha256=NyqRL3frKSw9bry_vriA1pdXh1gh1qAUpi5_wzLb7jc,641
27
+ txt2ebook/locales/txt2ebook.pot,sha256=mAbxkYqivFTrRmmo412Um3ZcvIS_yGiG7zxE3MCRavU,641
28
28
  txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo,sha256=Ym6soeijV3zsv9FUPWlJnu18-CNb5tcOTN5JsMOfV9c,672
29
- txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=YhI4ZnZVWIqR3WpbLL940xXdLwAAp9-OBQShD6QtSWU,698
29
+ txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=ElBRjAM7rgGxoBfjs9nZrlhWwXP24wkI8FmeSZIhAdM,698
30
30
  txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo,sha256=rRGW7HByDVZV8WpQkhyIFOWYNTQc4NnStrn0eGJX8Wc,675
31
- txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=zVvD8AEL6gcxg4QPfc_NnDy22Qf9_AdeYejiVzbLsFc,698
31
+ txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=1CDj15DzFqpcUMYnZGsRlHiXZCS-MvoH09l43kc787o,698
32
32
  txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo,sha256=1GIuOcO_bISiFcfhFez-A7mSi11Mo-x3PBobBENgMEc,675
33
- txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=Y-oJYvufQKqiUmAJR6RAB9DZdsu2hChUUtkEApu7byI,698
33
+ txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=QSB2qrYJJUnY1S80uQi4wNchOLxsAtkYAKwR1JUw23I,698
34
34
  txt2ebook/models/__init__.py,sha256=Z3zClWLj08Q8HgaWV1RRgIKatEhIUfYBAVWm-j4m05w,930
35
- txt2ebook/models/book.py,sha256=e5Y414aSjy3Z3gSH3tERVQx0w1uEVCfLbztxHiH1ZcY,2761
35
+ txt2ebook/models/book.py,sha256=kJToU9uHElNons_6TTjkPtlQ70TTWQx1wo_sQFoANZY,2700
36
36
  txt2ebook/models/chapter.py,sha256=6YvUDHzR6amGMZgkQl_xHWrYZUmlfpF7mnDLilG2BpA,1686
37
37
  txt2ebook/models/volume.py,sha256=koz1KfWjvGWLFbmGEQlZ23frsP93cDsuBMySYBHiXm8,1597
38
38
  txt2ebook/subcommands/__init__.py,sha256=1O_yTOheT9QwYarGl-zqFsVtcYveL4R9EztEeSFe0h8,1138
39
39
  txt2ebook/subcommands/env.py,sha256=gEzra4b6guy7pRZUTCWX1_eiR7JmrtR1Z-J-vxljvMY,1549
40
40
  txt2ebook/subcommands/epub.py,sha256=_obM1_fvVBPHOBXBOCYK8nyJadBX3_gOn9kaXA5HipA,3570
41
41
  txt2ebook/subcommands/gmi.py,sha256=TUHoQ05q3TofYDRBAcXaDtqFWbqV0VcJHzFfGYKbqYs,3304
42
- txt2ebook/subcommands/massage.py,sha256=QGFr-vbAD_IzRDVSmBEIW2FnU2jdl31gAhY6jqtDLg4,11757
42
+ txt2ebook/subcommands/massage.py,sha256=BYshlwCgAr9CWK0OgtRafgIm5O5_5egwF25Z2SUVhSU,11884
43
43
  txt2ebook/subcommands/md.py,sha256=hwb65z95NTSLAz87FJI7ZLB3du1pBx3A4FlF2UD2xio,3315
44
44
  txt2ebook/subcommands/parse.py,sha256=tdWqssFsg70GSgz4S2YoaERydt3zQ5Sq1rLtkvB-WQU,2902
45
45
  txt2ebook/subcommands/pdf.py,sha256=-DjeMmRKPZoTg8WZfNc028ZaZZ3xLCSAdnZDZFtCsbI,2966
46
46
  txt2ebook/subcommands/tex.py,sha256=4Wk_-l3UzuJYck0oWkRaKXVrf05jkGTJiyc7YORwMK0,3117
47
47
  txt2ebook/subcommands/typ.py,sha256=qCbaGFP5n6yJ-P6biXw2JHhjiYk3emOpthoSf9XWhOY,3667
48
- txt2ebook-0.1.143.dist-info/METADATA,sha256=v5W1K7gNxfonJ7Nph47KJWJv8-Tl9apHD0VGXd-6b6c,4901
49
- txt2ebook-0.1.143.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
- txt2ebook-0.1.143.dist-info/entry_points.txt,sha256=3jm5vpUsDRgoM6S3CQVMMiP7tJQqfq1vfV0sh_KaK9s,74
51
- txt2ebook-0.1.143.dist-info/licenses/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
52
- txt2ebook-0.1.143.dist-info/RECORD,,
48
+ txt2ebook-0.1.145.dist-info/METADATA,sha256=zhreNz6L2jLyO99etM8D4BRY2VtfbrGHKSTGNtxqBWg,4901
49
+ txt2ebook-0.1.145.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
+ txt2ebook-0.1.145.dist-info/entry_points.txt,sha256=3jm5vpUsDRgoM6S3CQVMMiP7tJQqfq1vfV0sh_KaK9s,74
51
+ txt2ebook-0.1.145.dist-info/licenses/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
52
+ txt2ebook-0.1.145.dist-info/RECORD,,