OLD | NEW |
1 #!@PYTHON@ | 1 #!@PYTHON@ |
2 import codecs | 2 import codecs |
3 import os | 3 import os |
4 import sys | 4 import sys |
5 import getopt | 5 import getopt |
6 import tempfile | 6 import tempfile |
7 | 7 |
8 # usage: | 8 # usage: |
9 def usage (): | 9 def usage (): |
10 print 'usage: bib2texi.py [-s style] [-o <outfile>] [-q] BIBFILES...' | 10 print('usage: bib2texi.py [-s style] [-o <outfile>] [-q] BIBFILES...') |
11 print '-q suppresses most output' | 11 print('-q suppresses most output') |
12 | 12 |
13 (options, files) = getopt.getopt (sys.argv[1:], 's:o:hq', []) | 13 (options, files) = getopt.getopt (sys.argv[1:], 's:o:hq', []) |
14 | 14 |
15 output = 'bib.itexi' | 15 output = 'bib.itexi' |
16 style = 'long' | 16 style = 'long' |
17 show_output = True | 17 show_output = True |
18 | 18 |
19 for (o,a) in options: | 19 for (o,a) in options: |
20 if o == '-h' or o == '--help': | 20 if o == '-h' or o == '--help': |
21 usage () | 21 usage () |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 def cleanup (tmpfile): | 98 def cleanup (tmpfile): |
99 for a in ['aux','bbl', 'blg']: | 99 for a in ['aux','bbl', 'blg']: |
100 os.unlink (tmpfile + '.' + a) | 100 os.unlink (tmpfile + '.' + a) |
101 | 101 |
102 | 102 |
103 cleanup (tmpfile) | 103 cleanup (tmpfile) |
104 #Following line added by PEH - script was leaving a dangling temporary file with
no extension | 104 #Following line added by PEH - script was leaving a dangling temporary file with
no extension |
105 os.unlink (tmpfile) | 105 os.unlink (tmpfile) |
106 | 106 |
OLD | NEW |