|
@@ -24,16 +24,20 @@ for location in root.iter('Location'):
|
|
iname = location.attrib['name']
|
|
iname = location.attrib['name']
|
|
iname = iname.strip(' $')
|
|
iname = iname.strip(' $')
|
|
|
|
|
|
- ifile = io.open(os.path.join(idir,iname), 'rt', encoding='utf-8')
|
|
|
|
- text = ifile.read()
|
|
|
|
-
|
|
|
|
- # make sure there's a line at the end of file
|
|
|
|
- # (why wouldn't there be one? WINDOWS!
|
|
|
|
- if text[-1] != u'\n':
|
|
|
|
- text += u'\n\n'
|
|
|
|
-
|
|
|
|
- ofile.write(text)
|
|
|
|
- ifile.close()
|
|
|
|
|
|
+ try:
|
|
|
|
+ ifile = io.open(os.path.join(idir,iname), 'rt', encoding='utf-8')
|
|
|
|
+ text = ifile.read()
|
|
|
|
+
|
|
|
|
+ # make sure there's a line at the end of file
|
|
|
|
+ # (why wouldn't there be one? WINDOWS!
|
|
|
|
+ if text[-1] != u'\n':
|
|
|
|
+ text += u'\n\n'
|
|
|
|
+
|
|
|
|
+ ofile.write(text)
|
|
|
|
+ ifile.close()
|
|
|
|
+ except IOError:
|
|
|
|
+ print "WARNING: missing location %s" % iname
|
|
|
|
+ pass
|
|
|
|
|
|
ofile.close()
|
|
ofile.close()
|
|
|
|
|