Skip to content

Commit

Permalink
[UPD] Check beamer file integrity
Browse files Browse the repository at this point in the history
youakrim committed Jun 7, 2017
1 parent e5073b7 commit 3273b45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exipe/beamer_parser.py
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@ def parse_beamer(path):
with open(path, 'r') as content_file:
content = content_file.read()

if len(re.compile(r'\\begin{frame}').split(content)) == 0:
raise Exception("Invalid LaTeX Beamer file. No frame found.")

if len(re.findall(r'\\title{(.*?)\}', content, re.S)) > 0:
title = re.findall(r'\\title{(.*?)\}', content, re.S)[0]
else:

0 comments on commit 3273b45

Please sign in to comment.