Mercurial > dottes
annotate abctitle.py @ 114:7be0ada7bed7
Change Laride 6 comments to current usage.
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Fri, 16 Mar 2012 10:35:37 +0000 |
parents | a63e39fc3410 |
children |
rev | line source |
---|---|
110
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
2 # |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
3 # Extact the first tune title from a .abc data, and print it out |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
4 # formatted for use in LaTeX. |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
5 # |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
6 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
7 import optparse |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
8 import sys |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
9 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
10 accentedletters = { |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
11 # Acute accents |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
12 "'A" : ("Á", "\\'{A}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
13 "'E" : ("É", "\\'{E}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
14 "'I" : ("Í", "\\'{I}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
15 "'O" : ("Ó", "\\'{O}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
16 "'U" : ("Ú", "\\'{U}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
17 "'Y" : ("Ý", "\\'{Y}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
18 "'a" : ("á", "\\'{a}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
19 "'e" : ("é", "\\'{e}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
20 "'i" : ("í", "\\'{i}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
21 "'o" : ("ó", "\\'{o}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
22 "'u" : ("ú", "\\'{u}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
23 "'y" : ("ý", "\\'{y}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
24 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
25 # Grave accents |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
26 "`A" : ("À", "\\`{A}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
27 "`E" : ("È", "\\`{E}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
28 "`I" : ("Ì", "\\`{I}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
29 "`O" : ("Ò", "\\`{O}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
30 "`U" : ("Ù", "\\`{U}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
31 "`a" : ("à", "\\`{a}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
32 "`e" : ("è", "\\`{e}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
33 "`i" : ("ì", "\\`{i}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
34 "`o" : ("ò", "\\`{o}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
35 "`u" : ("ù", "\\`{u}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
36 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
37 # Umlauts |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
38 "\"A" : ("Ä", "\\\"{A}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
39 "\"E" : ("Ë", "\\\"{E}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
40 "\"I" : ("Ï", "\\\"{I}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
41 "\"O" : ("Ö", "\\\"{O}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
42 "\"U" : ("Ü", "\\\"{U}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
43 "\"Y" : ("Ÿ", "\\\"{Y}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
44 "\"a" : ("ä", "\\\"{a}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
45 "\"e" : ("ë", "\\\"{e}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
46 "\"i" : ("ï", "\\\"{\i}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
47 "\"o" : ("ö", "\\\"{o}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
48 "\"u" : ("ü", "\\\"{u}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
49 "\"y" : ("ÿ", "\\\"{y}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
50 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
51 # Circumflexes |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
52 "^A" : ("Â", "\\^{A}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
53 "^E" : ("Ê", "\\^{E}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
54 "^I" : ("Î", "\\^{I}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
55 "^O" : ("Ô", "\\^{O}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
56 "^U" : ("Û", "\\^{U}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
57 "^a" : ("â", "\\^{a}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
58 "^e" : ("ê", "\\^{e}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
59 "^i" : ("î", "\\^{\i}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
60 "^o" : ("ô", "\\^{o}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
61 "^u" : ("û", "\\^{u}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
62 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
63 # Tilde |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
64 "~A" : ("Ã", "\\~{A}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
65 "~N" : ("Ñ", "\\~{N}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
66 "~O" : ("Õ", "\\~{O}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
67 "~a" : ("ã", "\\~{a}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
68 "~n" : ("ñ", "\\~{n}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
69 "~o" : ("õ", "\\~{o}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
70 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
71 # Cedilla |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
72 ",C" : ("Ç", "\\c{C}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
73 ",c" : ("ç", "\\c{c}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
74 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
75 # Slash |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
76 "/O" : ("Ø", "\\O"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
77 "/o" : ("ø", "\\o"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
78 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
79 # Ring |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
80 "AA" : ("Å", "\\r{A}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
81 "aa" : ("å", "\\r{a}"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
82 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
83 # Ligatures |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
84 "AE" : ("Æ", "\\AE"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
85 "ae" : ("æ", "\\ae"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
86 "ss" : ("ß", "\\ss"), |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
87 } |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
88 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
89 def convertTitle(t, options): |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
90 res = "" |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
91 while True: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
92 p = t.partition('\\') |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
93 res += p[0] |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
94 if p[1] == "": |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
95 break |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
96 abc = p[2][0:2] |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
97 t = p[2][2:] |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
98 if (options.html or options.latex) and abc in accentedletters: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
99 if options.html: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
100 res += accentedletters[abc][0] |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
101 else: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
102 res += accentedletters[abc][1] |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
103 else: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
104 res += "\\" + abc |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
105 return res |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
106 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
107 def process(inf, options): |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
108 for line in inf: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
109 line = line.strip() |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
110 if line[0:2] == "T:": |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
111 print(convertTitle(line[2:].strip(), options)) |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
112 break |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
113 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
114 parser = optparse.OptionParser(usage="usage: %prog [options] [filename]\n\n" |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
115 " Extract title from ABC file.") |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
116 parser.add_option("-m", "--html", dest="html", |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
117 action="store_true", default=False, |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
118 help="format output for HTML") |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
119 parser.add_option("-l", "--latex", dest="latex", |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
120 action="store_true", default=False, |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
121 help="format ouput for LaTeX") |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
122 (options, args) = parser.parse_args() |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
123 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
124 if options.html and options.latex: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
125 sys.exit("You must choose one of HTML or LaTeX output") |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
126 |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
127 if len(args) > 0: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
128 for arg in args: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
129 try: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
130 inf = open(arg, "r") |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
131 process(inf, options) |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
132 finally: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
133 inf.close() |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
134 else: |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
135 process(sys.stdin, options) |
a63e39fc3410
Add basic diacritic handling for LaTeX and web.
Jim Hague <jim.hague@acm.org>
parents:
diff
changeset
|
136 sys.exit(0) |