blob: 2a3a25582b78623e36e5e11a13708174fc87f795 (
plain)
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
|
#!/usr/bin/env python
import sys, os.path, optparse
sys.path.append(sys.path[0]+"/source")
import globals, expatimpl
def main ():
parser = optparse.OptionParser()
options, args = parser.parse_args()
if len(args) == 0:
parser.print_help()
sys.exit(1)
for fpath in args:
if not os.path.isfile(args[0]):
globals.error(args[0] + " is not a valid file. Skipping.")
file = open(args[0], 'r')
strm = file.read()
file.close()
p = expatimpl.Parser(strm)
p.parse()
if __name__ == '__main__':
main()
|