Skip to content
Snippets Groups Projects
Commit 7c65f4be authored by tuhe's avatar tuhe
Browse files

converter cli + tests

parent 085c42c5
Branches
No related tags found
No related merge requests found
Pipeline #7540 passed
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: beamer-slider Name: beamer-slider
Version: 0.1.25 Version: 0.1.25.1
Summary: Software to create inkscape overlays in Beamer Summary: Software to create inkscape overlays in Beamer
Home-page: https://lab.compute.dtu.dk/tuhe/slider Home-page: https://lab.compute.dtu.dk/tuhe/slider
Author: Tue Herlau Author: Tue Herlau
Author-email: tuhe@dtu.dk Author-email: tuhe@dtu.dk
License: MIT License: MIT
Project-URL: Bug Tracker, https://lab.compute.dtu.dk/tuhe/slider/issues Project-URL: Bug Tracker, https://lab.compute.dtu.dk/tuhe/slider/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent Classifier: Operating System :: OS Independent
...@@ -108,3 +109,4 @@ Thats is! And since this is an overlay, you are free to add more LaTeX to the sl ...@@ -108,3 +109,4 @@ Thats is! And since this is an overlay, you are free to add more LaTeX to the sl
year={2021}, year={2021},
} }
``` ```
[console_scripts] [console_scripts]
slider = slider.slider_cli:clize_main_entry_point slider = slider.slider_cli:clize_main_entry_point
slider_convert = slider.slider_cli:slide_converter_main_entry_point
Jinja2 Jinja2
numpy PyPDF2
beautifulsoup4
chardet chardet
scipy click
seaborn clize
lxml lxml
matplotlib matplotlib
numpy
pylatexenc pylatexenc
beautifulsoup4 scipy
PyPDF2 seaborn
clize
click
...@@ -38,11 +38,13 @@ class TestSlider(TestCase): ...@@ -38,11 +38,13 @@ class TestSlider(TestCase):
if os.path.isdir("./automatic"): if os.path.isdir("./automatic"):
shutil.rmtree("./automatic") shutil.rmtree("./automatic")
os.mkdir("automatic") os.mkdir("automatic")
if not os.path.isdir("./tests_images"):
if os.path.isdir("./tests_images"):
shutil.rmtree("./tests_images")
os.mkdir("./tests_images") os.mkdir("./tests_images")
# if os.path.isdir("./tests_images"):
# shutil.rmtree("./tests_images")
# os.mkdir("./tests_images")
slider_cli("automatic/index.tex", interactive=False) slider_cli("automatic/index.tex", interactive=False)
with open("automatic/index.tex", 'r') as f: with open("automatic/index.tex", 'r') as f:
s = f.read() s = f.read()
...@@ -91,6 +93,9 @@ class TestConverter(TestCase): ...@@ -91,6 +93,9 @@ class TestConverter(TestCase):
shutil.rmtree("./converted") shutil.rmtree("./converted")
os.mkdir("converted") os.mkdir("converted")
if not os.path.isdir("./tests_images"):
os.mkdir("./tests_images")
shutil.copyfile("slideshow.pdf", "converted/slideshow.pdf") shutil.copyfile("slideshow.pdf", "converted/slideshow.pdf")
from slider.slider_cli import slider_converter_cli from slider.slider_cli import slider_converter_cli
slider_converter_cli("converted/slideshow.pdf") slider_converter_cli("converted/slideshow.pdf")
...@@ -101,7 +106,10 @@ class TestConverter(TestCase): ...@@ -101,7 +106,10 @@ class TestConverter(TestCase):
import glob import glob
for f in glob.glob("./*"): for f in glob.glob("./*"):
print(f) print(f)
print("Content of tests_images is") tests_images = os.path.abspath("./tests_images")
print("Content of tests_images is. Exists?", tests_images, os.path.isdir(tests_images))
for f in glob.glob("./tests_images/*"):
print(f)
shutil.copyfile("converted/converted_10.png", "tests_images/converted_10.png") shutil.copyfile("converted/converted_10.png", "tests_images/converted_10.png")
# pdf2png("automatic/index.pdf", fout="automatic/index_b.png", page_to_convert=2) # pdf2png("automatic/index.pdf", fout="automatic/index_b.png", page_to_convert=2)
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment