pyeasyphd 0.0.4__py3-none-any.whl → 0.0.6__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.

Potentially problematic release.


This version of pyeasyphd might be problematic. Click here for more details.

@@ -1,6 +1,7 @@
1
1
  import copy
2
2
  import os
3
3
  import re
4
+ import subprocess
4
5
  import time
5
6
  from typing import Dict, List, Optional, Tuple
6
7
 
@@ -67,20 +68,20 @@ class PandocMdTo(BasicInput):
67
68
  if os.path.exists(self.full_csl_style_pandoc):
68
69
  cmd = (
69
70
  f"pandoc {full_md_one} -t {self.markdown_citation} "
70
- f'-o {full_md_two} -M reference-section-title="References" '
71
- f"-C --bibliography={path_bib} --csl={self.full_csl_style_pandoc} --columns {self.columns_in_md}"
71
+ f"-o {full_md_two} -M reference-section-title='References' "
72
+ f"--citeproc --bibliography={path_bib} --csl={self.full_csl_style_pandoc} --columns {self.columns_in_md}"
72
73
  )
73
74
  else:
74
75
  cmd = (
75
76
  f"pandoc {full_md_one} -t {self.markdown_citation} "
76
- f'-o {full_md_two} -M reference-section-title="References" '
77
- f"-C --bibliography={path_bib} --columns {self.columns_in_md}"
77
+ f"-o {full_md_two} -M reference-section-title='References' "
78
+ f"--citeproc --bibliography={path_bib} --columns {self.columns_in_md}"
78
79
  )
79
80
 
80
81
  try:
81
- os.system(cmd)
82
- except Exception as e:
83
- print("pandoc md to md:", e)
82
+ subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
83
+ except subprocess.CalledProcessError as e:
84
+ print("Pandoc error in pandoc md to md:", e.stderr)
84
85
 
85
86
  if not os.path.exists(full_md_two):
86
87
  print(f"- pandoc false from md to md: {os.path.basename(full_md_two)}\n")
@@ -114,13 +115,15 @@ class PandocMdTo(BasicInput):
114
115
  if not os.path.exists(path_tex := os.path.dirname(full_tex)):
115
116
  os.makedirs(path_tex)
116
117
 
118
+ if template_name.lower() == "beamer":
119
+ cmd = f"pandoc {full_md} -t beamer -o {full_tex} --from markdown "
120
+ else:
121
+ cmd = f"pandoc {full_md} -o {full_tex} --from markdown "
122
+
117
123
  try:
118
- if template_name.lower() == "beamer":
119
- os.system(f"pandoc {full_md} -t beamer -o {full_tex} --from markdown ")
120
- else:
121
- os.system(f"pandoc {full_md} -o {full_tex} --from markdown ")
122
- except Exception as e:
123
- print("pandoc md to tex:", e)
124
+ subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
125
+ except subprocess.CalledProcessError as e:
126
+ print("Pandoc error in pandoc md to tex:", e.stderr)
124
127
 
125
128
  if not os.path.exists(full_tex):
126
129
  print(f"- pandoc false from md to tex: {os.path.basename(full_md)}\n")
@@ -152,9 +155,9 @@ class PandocMdTo(BasicInput):
152
155
  cmd = f"pandoc {full_md} -o {full_html} --from markdown "
153
156
 
154
157
  try:
155
- os.system(cmd)
156
- except Exception as e:
157
- print("pandoc md to html:", e)
158
+ subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
159
+ except subprocess.CalledProcessError as e:
160
+ print("Pandoc error in pandoc md to html:", e.stderr)
158
161
 
159
162
  if not os.path.exists(full_html):
160
163
  return f"- pandoc false from md to html: {os.path.basename(full_md)}\n"
@@ -189,9 +192,9 @@ class PandocMdTo(BasicInput):
189
192
  cmd = f"pandoc {full_md} -o {full_pdf} --from markdown --listings --pdf-engine=xelatex"
190
193
 
191
194
  try:
192
- os.system(cmd)
193
- except Exception as e:
194
- print("pandoc md to pdf:", e)
195
+ subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
196
+ except subprocess.CalledProcessError as e:
197
+ print("Pandoc error in pandoc md to pdf:", e.stderr)
195
198
 
196
199
  if not os.path.exists(full_pdf):
197
200
  return f"- pandoc false from md to pdf: {os.path.basename(full_md)}\n"
@@ -1,5 +1,6 @@
1
1
  import os
2
2
  import re
3
+ import subprocess
3
4
  from typing import Any, Dict, List, Optional
4
5
 
5
6
  from pyadvtools import (
@@ -133,10 +134,11 @@ class PythonRunTex(BasicInput):
133
134
  # run latex
134
135
  if self.run_latex:
135
136
  os.chdir(path_output)
137
+ cmd = "latexmk -{} {}".format(self.pdflatex_xelatex, main_name)
136
138
  try:
137
- os.system("latexmk -{} {}".format(self.pdflatex_xelatex, main_name))
138
- except Exception as e:
139
- print(e)
139
+ subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
140
+ except subprocess.CalledProcessError as e:
141
+ print("Error in Run LaTex:", e.stderr)
140
142
 
141
143
  # delete cache
142
144
  if self.delete_run_latex_cache:
@@ -305,7 +305,7 @@ class SearchResultsCore(BasicInput):
305
305
 
306
306
  for d in delete_folder_list:
307
307
  for field in self.search_field_list:
308
- path_delete = os.path.join(p_separate, rf"{keywords_type}/{field}-md-{d}")
308
+ path_delete = os.path.join(p_separate, keywords_type, rf"{field}-md-{d}")
309
309
  if os.path.exists(path_delete):
310
310
  shutil.rmtree(path_delete)
311
311
 
@@ -73,7 +73,7 @@ class WriteInitialResult(object):
73
73
  _python_writer.write_to_file(data_list[i], file_name, "w", path_write)
74
74
 
75
75
  # pandoc md to generate md file
76
- path_bib = f"{path_write}/{file_prefix}{mid_list[2]}.bib" # bib_for_abbr
76
+ path_bib = os.path.join(path_write, f"{file_prefix}{mid_list[2]}.bib") # bib_for_abbr
77
77
  data_list_pandoc_md = self._pandoc_md_to.pandoc_md_to_md(
78
78
  path_bib,
79
79
  path_write,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyeasyphd
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: pyeasyphd
5
5
  License: GPL-3.0-or-later
6
6
  Keywords: Python,Markdown,LaTex
@@ -49,10 +49,10 @@ pyeasyphd/bib/core/convert_str_to_library.py,sha256=CNB5UfSOcCqPPypxm9yIY7R7kvLQ
49
49
  pyeasyphd/bib/core/convert_str_to_str.py,sha256=jUxXD3v7t042OaMXPFlWGHjNNukpuoel12TpYt1krD4,900
50
50
  pyeasyphd/main/__init__.py,sha256=7_x6_RNSeha2zrgIbKjJgEvFWK62btOW9v6RUU1Ygm8,390
51
51
  pyeasyphd/main/basic_input.py,sha256=b2ilzgslD2W-10gLM3RM3zBn3-MxFkYeHeTzdILzbAU,6794
52
- pyeasyphd/main/pandoc_md_to.py,sha256=oC9KXnMqBJKKDvtBBMLkmPmcisWvWD0XiUwv18FUEbY,14828
52
+ pyeasyphd/main/pandoc_md_to.py,sha256=SPbQBlAvfB5hcXmfKlMDc2zoT2nJ_uQNyw8bHeiyy1s,15280
53
53
  pyeasyphd/main/python_run_bib.py,sha256=RRVeGXXs1MELpAYex9vT3x97Rqr211TP1aeHhD-8hXU,2891
54
54
  pyeasyphd/main/python_run_md.py,sha256=6K4zqYtl298-iS1XVGH4jY9FkDD9ezwpGfZk0NIgk2Q,10353
55
- pyeasyphd/main/python_run_tex.py,sha256=P5jqnyRfKyUJFvhd7LgASmwlfkHSJ0Br9_jeYwp2Ojg,5786
55
+ pyeasyphd/main/python_run_tex.py,sha256=BNSXp0KnxvYyXr5q43Sr4NwD32EiGaqZJ0QYDwit0tw,5937
56
56
  pyeasyphd/main/python_writers.py,sha256=VQpaAbdNNa1s327ADgl8Wy-rKBZy1alqmtmx6E3RDWI,8510
57
57
  pyeasyphd/pyeasyphd.py,sha256=vPM4uPmr6jSxVOy0zYetoijc8wUkQdXExUVdJyWynVQ,2875
58
58
  pyeasyphd/pyeasyphd.sublime-settings,sha256=6D5SYWsG6xn8OEu6IchIDGGGH7uLX4v451X28yeAevU,8718
@@ -67,14 +67,14 @@ pyeasyphd/tools/py_run_bib_md_tex.py,sha256=lc6JqfXeJSMA8icTJTC7X1pq4tgurOaXq9f0
67
67
  pyeasyphd/tools/replace/replace.py,sha256=wXdO72PpqZ-Iyzq5AjVCIpx8h2d1YCTiWY9VSbQAVvs,3337
68
68
  pyeasyphd/tools/search/data.py,sha256=7uHXfHTcn88zkfqAGZMNcSd2OjS2LhkpE9paNuSUUqw,10754
69
69
  pyeasyphd/tools/search/search_base.py,sha256=Q8IWqVLk-rGZwRZ316WkZNs0qyF7PVHP6lx6Ul5mLKI,4507
70
- pyeasyphd/tools/search/search_core.py,sha256=16nVB2j3mtrTxUJKgtYg65ux6bI81ofTHn1IAB3twPc,13783
70
+ pyeasyphd/tools/search/search_core.py,sha256=Gn_9vWojSn4Pg5jOaN54Kiv1osW3TM6D3SvZ53Xk9-Y,13782
71
71
  pyeasyphd/tools/search/search_keywords.py,sha256=O_ivQzElsjujTHqU0Sxw4w4v3VwcN560HcoBhS1B3WA,10430
72
- pyeasyphd/tools/search/search_writers.py,sha256=TuQGm9QwHy0bZHNtO_qg-MYEcip_rUPfwHyvPKO-sEg,12551
72
+ pyeasyphd/tools/search/search_writers.py,sha256=qP6UE_oK2LKriP7kfoDR4j8p7MlV09zdK7LnXHHB1_8,12564
73
73
  pyeasyphd/tools/search/utils.py,sha256=yLKrMmM2x-fHdm6P8haFZzagd9sLkViTdwJTHyGRgXY,6092
74
74
  pyeasyphd/tools/spider/process_spider_bib.py,sha256=p1UNUaLAxMZPYtuwjNi20e1ms--cyjlB7CIZFP3SX6U,10443
75
75
  pyeasyphd/tools/spider/process_spider_url.py,sha256=YKG4GER5TiFDjyk94n1ocUQ8bM7ZvXImx0lKNvnyVC4,2970
76
76
  pyeasyphd/tools/spider/process_spider_url_bib.py,sha256=1b0FnUlTt5BzaOqFZJmnY5gnAhdD4pbQolHR1e3wiyE,2705
77
77
  pyeasyphd/utils/utils.py,sha256=yuHy6D2mTsd2aAwNBSMC7CU4LV-MkWwzKeO_0Iehbyg,1655
78
- pyeasyphd-0.0.4.dist-info/METADATA,sha256=kyDu0_OV12RDFJ5_w-rfXiO_3ZgtEyadUtwH14GDdac,1043
79
- pyeasyphd-0.0.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
80
- pyeasyphd-0.0.4.dist-info/RECORD,,
78
+ pyeasyphd-0.0.6.dist-info/METADATA,sha256=J-PHRjVLGOppw6rt2GfRSiudrwc8Q-RAs-t-1Tw7oB0,1043
79
+ pyeasyphd-0.0.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
80
+ pyeasyphd-0.0.6.dist-info/RECORD,,