txt2ebook 0.1.79__py3-none-any.whl → 0.1.81__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/__init__.py CHANGED
@@ -22,7 +22,7 @@ import sys
22
22
 
23
23
  logger = logging.getLogger(__name__)
24
24
 
25
- __version__ = "0.1.79"
25
+ __version__ = "0.1.81"
26
26
 
27
27
 
28
28
  def setup_logger(config: argparse.Namespace) -> None:
@@ -62,9 +62,10 @@ def log_or_raise_on_warning(msg: str, raise_on_warning: bool = False) -> None:
62
62
 
63
63
  def print_env() -> None:
64
64
  """Print environment details for bug reporting."""
65
+ sys_version = sys.version.replace("\n", "")
65
66
  print(
66
67
  f"txt2ebook: {__version__}",
67
- f"python: {sys.version}",
68
+ f"python: {sys_version}",
68
69
  f"platform: {platform.platform()}",
69
70
  sep="\n",
70
71
  )
txt2ebook/formats/pdf.py CHANGED
@@ -16,6 +16,7 @@
16
16
  """Convert and back source text file into text as well."""
17
17
 
18
18
  import logging
19
+ from pathlib import Path
19
20
  from typing import List, Tuple
20
21
 
21
22
  import reportlab
@@ -86,6 +87,9 @@ class PdfWriter(BaseWriter):
86
87
  pdf, onFirstPage=self._cover_page, onLaterPages=self._regular_page
87
88
  )
88
89
 
90
+ if self.config.open:
91
+ self._open_file(Path(self.doc.filename))
92
+
89
93
  def _cover_page(self, canvas, _doc) -> None:
90
94
  (page_width, page_height) = self._get_pagesize()
91
95
  canvas.saveState()
txt2ebook/formats/typ.py CHANGED
@@ -97,7 +97,6 @@ class TypWriter(BaseWriter):
97
97
 
98
98
  #set par(
99
99
  justify: true,
100
- first-line-indent: 2em,
101
100
  )
102
101
  #set text(
103
102
  font: "Noto Serif CJK SC",
@@ -17,7 +17,7 @@ msgstr "Tag:"
17
17
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
18
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
19
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:126
20
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
21
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
22
22
  msgid "toc"
23
23
  msgstr "Table of Content"
@@ -17,7 +17,7 @@ msgstr ""
17
17
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
18
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
19
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:126
20
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
21
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
22
22
  msgid "toc"
23
23
  msgstr ""
@@ -17,7 +17,7 @@ msgstr "票签:"
17
17
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
18
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
19
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:126
20
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
21
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
22
22
  msgid "toc"
23
23
  msgstr "目录"
@@ -17,7 +17,7 @@ msgstr "标签:"
17
17
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/base.py:155
18
18
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/gmi.py:62
19
19
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/md.py:61
20
- #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:126
20
+ #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/pdf.py:130
21
21
  #: /home/ang/src/self/txt2ebook/txt2ebook/src/txt2ebook/formats/txt.py:71
22
22
  msgid "toc"
23
23
  msgstr "目录"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: txt2ebook
3
- Version: 0.1.79
3
+ Version: 0.1.81
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,4 +1,4 @@
1
- txt2ebook/__init__.py,sha256=Yk2c6K6YUpwDv956uvu6Qm7rx4VJkZMHoFWfqiHEG9s,2013
1
+ txt2ebook/__init__.py,sha256=_TCqs7mbj-rTNP-FSDOlxwa265L2kRUEPgNb2K4FNLk,2061
2
2
  txt2ebook/__main__.py,sha256=gMLvgpqc_BL4cBqNe0vqErRF5dlJPAbvqu1zndcAHYI,850
3
3
  txt2ebook/exceptions.py,sha256=b2HDsXdqweLJbvSJEGt48nxvGkZq20SfYezSjwp77JU,842
4
4
  txt2ebook/formats/__init__.py,sha256=yjZsVk2L6FkUuEpyilp1XTrJeYYljws99vebiweWAKU,2395
@@ -6,26 +6,26 @@ txt2ebook/formats/base.py,sha256=5fICz70rbN9WKu0ZL1KwXsXEpDHYMry3qaFfNHilg1E,584
6
6
  txt2ebook/formats/epub.py,sha256=ZRXRnEO-qCtRIQYM9zh-VaoJfrySRdAliWr5y91l_bA,6936
7
7
  txt2ebook/formats/gmi.py,sha256=deVCwFfCE7Ys9eFTnRgZUncJX6LiUM1iXG7HXFCHlPY,6783
8
8
  txt2ebook/formats/md.py,sha256=D-6bGaNNtL11A-a8xZDVVUbfUMIdkeV6umTlsXpLSOA,6532
9
- txt2ebook/formats/pdf.py,sha256=jtYuOrqwzWyG-0rpRreXWzs2jyypwiQfomijkXAe1Z0,7168
9
+ txt2ebook/formats/pdf.py,sha256=Mz-h300tKc_-NcqL6YZTTAPaBk0i9e0323LXFR8bR0U,7276
10
10
  txt2ebook/formats/templates/__init__.py,sha256=PmObHFVHXD0GIw4328g1i1KoBks1m5-7u00XMNgb38U,755
11
11
  txt2ebook/formats/templates/epub/__init__.py,sha256=DeIsL4WDqgTU7zCLxlCidFItvG4Nl4TMKWeoeTcUuuo,761
12
12
  txt2ebook/formats/templates/epub/clean.css,sha256=AnEwMckzUSKcjKsDiWtJW1oaceuklt2tyuS1VbpVK1s,462
13
13
  txt2ebook/formats/templates/epub/condense.css,sha256=Fz80ZqkPsFRmGdURduAxqMV8drD0CCUlrv41P8rUsm8,477
14
14
  txt2ebook/formats/templates/epub/noindent.css,sha256=_O5Tv90TKyyPBRdgjuNKFwtKFbdheh2V9PtDhgRUg3U,483
15
15
  txt2ebook/formats/txt.py,sha256=8PkJ54r-0saZYyYEH64nYSkM-oW5LnurCbAk6d2Ue78,7536
16
- txt2ebook/formats/typ.py,sha256=k28HLNtVtmE8VOuEpYStCjCWbZubHrzr_N9mNVMrXuY,5234
16
+ txt2ebook/formats/typ.py,sha256=79WQyaexmNVJ0Xh7ykNjpwcS0vK7sdkSlrOBm-uV6dA,5200
17
17
  txt2ebook/helpers/__init__.py,sha256=cQmFjEsEEI0gRxDPL-284FMS5Z-iBMcu-4qe7Icf7is,1971
18
18
  txt2ebook/languages/__init__.py,sha256=oShuwgKn784v_XYrAKQM2x1h0-KEsJPeia9XWMnJTYU,758
19
19
  txt2ebook/languages/en.py,sha256=LVZsvr6JLbQFrfI1XSYG54mFwzlHa0fhKghlUemkQbo,920
20
20
  txt2ebook/languages/zh_cn.py,sha256=_3DnB7mDW_EJW3-jy9ZfnxIZ85zNgfXqzPoc7daBHIY,1930
21
21
  txt2ebook/languages/zh_tw.py,sha256=ISjDXJes-jbOUC_5RDH8Bsc0ttBf-4Dt2HNDEBxwRgE,1464
22
22
  txt2ebook/locales/en/LC_MESSAGES/txt2ebook.mo,sha256=Ym6soeijV3zsv9FUPWlJnu18-CNb5tcOTN5JsMOfV9c,672
23
- txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=4b4qyM3aSidV4m446Gh2Weq8Z2ydFRjBXfZJFXfY5zQ,1214
24
- txt2ebook/locales/txt2ebook.pot,sha256=AjwzbII79t-3yJalReEQ2r554fuSlmglbwANN3g1qXo,1157
23
+ txt2ebook/locales/en/LC_MESSAGES/txt2ebook.po,sha256=Idp783OJpRQGvohvt_nCaNfg1gz2QAcyDKXwJZ5-iZ8,1214
24
+ txt2ebook/locales/txt2ebook.pot,sha256=mVjjv_qcm498tOU5-avSv_2Qi97J9Hi6p6XWKId6_tc,1157
25
25
  txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.mo,sha256=rRGW7HByDVZV8WpQkhyIFOWYNTQc4NnStrn0eGJX8Wc,675
26
- txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=SNxJqZgNeHFU7nWEaGCPK5Bi02lQnlxbh0ix_IgA8X0,1214
26
+ txt2ebook/locales/zh-cn/LC_MESSAGES/txt2ebook.po,sha256=P5EHatQZg6G7ZDbs29v6VicNWKi6plCyRRPgYpjz9Qs,1214
27
27
  txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.mo,sha256=1GIuOcO_bISiFcfhFez-A7mSi11Mo-x3PBobBENgMEc,675
28
- txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=adVsPNZVKrYDNji_4MJfWsFt7W3JuCE975zN6wclnJY,1214
28
+ txt2ebook/locales/zh-tw/LC_MESSAGES/txt2ebook.po,sha256=bEQxFGwdkAX3or1VSMTNDnjUijJ4ZnSENefzreXPkL4,1214
29
29
  txt2ebook/models/__init__.py,sha256=8_k1oI_PnPMekhdZCXiTtg5WghdR6fugQEHJHsy1-Ds,925
30
30
  txt2ebook/models/book.py,sha256=GYXvklHnLIuodEgbjzulyA0OSX72K37ohGBn8xDwCgw,2759
31
31
  txt2ebook/models/chapter.py,sha256=buECAklNQgM3tDehzyVO9YfA_F0iXyLq2PaMZGV_Zaw,1681
@@ -34,8 +34,8 @@ txt2ebook/parser.py,sha256=vdC--8I2c89xve7OA1OkYTDjSMwwKoyv4Wkmca0iFhE,11823
34
34
  txt2ebook/tokenizer.py,sha256=y1CQ3Xf5g74o_mUZSOwrwwu0grKmgmt6x3yxCWWokhU,9318
35
35
  txt2ebook/txt2ebook.py,sha256=Nwf30JA5aAXwHZEH1bnqXtD_eT3QBbpHQfsG4DP9uAc,13212
36
36
  txt2ebook/zh_utils.py,sha256=EgKVbwqYGaTGswQUGcOCeSfRelzwkAb9WWY9TrsX1x4,4882
37
- txt2ebook-0.1.79.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
38
- txt2ebook-0.1.79.dist-info/METADATA,sha256=yY_w4jIJtTREht6hofi3pyC2Ry5lJl9KyXOnTpAkmTY,7388
39
- txt2ebook-0.1.79.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
40
- txt2ebook-0.1.79.dist-info/entry_points.txt,sha256=IQHyIIhd0MHjSSRVC1a6tMeIoLus8D06KHL_cumvEbg,83
41
- txt2ebook-0.1.79.dist-info/RECORD,,
37
+ txt2ebook-0.1.81.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
38
+ txt2ebook-0.1.81.dist-info/METADATA,sha256=wOCWGoN2LiF9DMu554ChEraLRR55Fb7aCk_KJ0kCviQ,7388
39
+ txt2ebook-0.1.81.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
40
+ txt2ebook-0.1.81.dist-info/entry_points.txt,sha256=IQHyIIhd0MHjSSRVC1a6tMeIoLus8D06KHL_cumvEbg,83
41
+ txt2ebook-0.1.81.dist-info/RECORD,,