diff --git a/src/slider/slide.py b/src/slider/slide.py index 6c31f898a1398ec36b8eaf5f0305f29af9360eea..153ce68ef7755139e8fd5c127badb9b9eae1e4cb 100644 --- a/src/slider/slide.py +++ b/src/slider/slide.py @@ -184,9 +184,9 @@ def set_svg_background_images(lecture_tex, verbose=False, if not v.endswith("png"): os.remove(v) - for v in glob.glob(SVG_OSVG_DIR + "/x_do_not_edit*.pdf"): - # if not v.endswith("png"): - os.remove(v) + # for v in glob.glob(SVG_OSVG_DIR + "/x_do_not_edit*.pdf"): + # if not v.endswith("png"): + # os.remove(v) # Not sure I want to do add this as an option right now. It makes everything slower... # for f in glob.glob(lecture_tex[:-4] + '_NO_SVGS*'): diff --git a/src/slider/slider_cli.py b/src/slider/slider_cli.py index c5246dcc1e3a3dea8afbca258f6aff468106a0f1..2c3b6ed806f560bb5826ceaa2f83b36ddbe150fe 100644 --- a/src/slider/slider_cli.py +++ b/src/slider/slider_cli.py @@ -65,13 +65,16 @@ def slider_cli(latexfile=None, interactive=True, verbose=False, clean=False, ver if "\\begin{document}" in s and "{beamer}" in s and "_NO_SVGS" not in name: print("Main file found!") mfiles.append(name) - if len(mfiles) != 1: - print("Too candidate files found") + if len(mfiles) > 1: + print("Too candidate files found:") print(mfiles) sys.exit() + elif len(mfiles) == 0: + print("Please specify a LaTeX index file. For instance:\n> slider index.tex") + sys.exit() else: latexfile = mfiles[0] - # latexfile = "index.tex" + if not latexfile.endswith(".tex"): latexfile += ".tex" latexfile = os.path.join(wdir, latexfile) diff --git a/src/slider/slider_init.py b/src/slider/slider_init.py index 03333908dab0e221287fb119e02f43e5283e09e0..e086cc8ab67374f3c113bc1b3b653850ff6d9ed5 100644 --- a/src/slider/slider_init.py +++ b/src/slider/slider_init.py @@ -22,7 +22,7 @@ base_slide = """ % This slideshow is made using slider. Install using: pip install beamer-slider % check http://gitlab.compute.dtu.dk/tuhe/slider for more information. \\begin{frame}\\osvg{myoverlay} % Use the \\osvg{labelname} - tag to create new overlays. Run the command `slider` in the terminal and check the ./osvgs directory for the svg files! -\\title{Slide with an overlay} +\\frametitle{Slide with an overlay} This is some example text! \\end{frame} diff --git a/tests/test_images/index_a.png b/tests/test_images/index_a.png deleted file mode 100644 index f8f77c1b00b45d00e207128138cc761afc331b84..0000000000000000000000000000000000000000 Binary files a/tests/test_images/index_a.png and /dev/null differ diff --git a/tests/test_slider.py b/tests/test_slider.py index 45a794f8b430d9feed3e6f0ea5b08482efaa6659..15a9a4d164d4c502d8ac1ec17de05aef1cd374d3 100644 --- a/tests/test_slider.py +++ b/tests/test_slider.py @@ -43,9 +43,9 @@ class TestSlider(TestCase): shutil.rmtree("./automatic") os.mkdir("automatic") - if os.path.isdir("./test_images"): - shutil.rmtree("./test_images") - os.mkdir("./test_images") + if os.path.isdir("./tests_images"): + shutil.rmtree("./tests_images") + os.mkdir("./tests_images") slider_cli("automatic/index.tex", interactive=False) @@ -74,8 +74,9 @@ class TestSlider(TestCase): pdf2png("automatic/index.pdf", fout="tests_images/index_front.png", page_to_convert=1) shutil.copyfile("automatic/index.pdf", "tests_images/index.pdf") - def test_second_page_before_compile(self): - assert_images_equal("automatic/index_a.png", "expected/index_a.png") + # Not a too great idea to test this because of the date. + # def test_second_page_before_compile(self): + # assert_images_equal("automatic/index_a.png", "expected/index_a.png") def test_second_page_after_compile(self): assert_images_equal("automatic/index_b.png", "expected/index_b.png") diff --git a/tests/test_images/index.pdf b/tests/tests_images/index.pdf similarity index 98% rename from tests/test_images/index.pdf rename to tests/tests_images/index.pdf index 95bb0c3497cb87e7d3b1408688f189baf670385d..49c3f763c5e2c5107bf00e684f92cf9b4c03a66e 100644 Binary files a/tests/test_images/index.pdf and b/tests/tests_images/index.pdf differ diff --git a/tests/tests_images/index_a.png b/tests/tests_images/index_a.png new file mode 100644 index 0000000000000000000000000000000000000000..6fb5c787df048ab160ffdeac8b2c7102efbfecf4 Binary files /dev/null and b/tests/tests_images/index_a.png differ diff --git a/tests/test_images/index_b.png b/tests/tests_images/index_b.png similarity index 100% rename from tests/test_images/index_b.png rename to tests/tests_images/index_b.png diff --git a/tests/test_images/index_front.png b/tests/tests_images/index_front.png similarity index 100% rename from tests/test_images/index_front.png rename to tests/tests_images/index_front.png