-
Notifications
You must be signed in to change notification settings - Fork 1
/
difftotex.py
executable file
·36 lines (29 loc) · 916 Bytes
/
difftotex.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
import tex, diffparser, argumentparser
from classes import *
version = "0.1.2"
debug = False
def main():
(inputLines) = argumentparser.parse_cli()
files = diffparser.parseLines( inputLines, settings.diffPrefixRegex )
try:
tex.output(files)
except Exception as e:
raise ToTexError(e)
if __name__ == "__main__":
realException = None
try:
main()
except (ParseError, ToTexError) as e:
print ("")
print (str(e))
print ("")
print ("If you think this is not your fault, please submit an issue,")
print ("preferably including your diff file, at")
print ("https://github.com/RasmusWriedtLarsen/difftotex")
realException = e.e
except KeyboardInterrupt:
print (" Thank you, come again!")
if debug and realException != None:
print ("\n")
raise realException