summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-10-12 18:38:38 +0100
committerTom Hacohen <tom@stosb.com>2013-10-12 18:38:38 +0100
commit5e44c9677e193bf115270d793c3fe8e1c96a04a8 (patch)
tree808a5274cfd57ff0e9bf2076e95f0bc2851a2a3e
initial commit.
-rwxr-xr-xlatex-pdfpc.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/latex-pdfpc.py b/latex-pdfpc.py
new file mode 100755
index 0000000..9a22a4d
--- /dev/null
+++ b/latex-pdfpc.py
@@ -0,0 +1,40 @@
1#!/usr/bin/env python2
2import sys, os
3import re
4
5# Duration in minutes
6duration = 45
7
8if len(sys.argv) != 2:
9 exit(1)
10
11document_notes = []
12current_notes = []
13
14f = open(sys.argv[1], 'r')
15
16if not f:
17 exit(2)
18
19for line in f:
20 match = re.search("%NOTE{?([^}]*)}?", line)
21 if match:
22 current_notes.append(match.group(1))
23 elif re.search("\\end{frame}", line):
24 document_notes.append(current_notes)
25 current_notes = []
26
27frame = 0
28print "[file]"
29print os.path.splitext(os.path.basename(sys.argv[1]))[0] + ".pdf"
30
31print "[duration]"
32print "%d" % duration
33
34print "[notes]"
35for slide in document_notes:
36 frame += 1
37 if len(slide) > 0:
38 print "### %d" % frame
39 for note in slide:
40 print note.strip()