Fix glade file conversion

This commit is contained in:
Joseph Coffland 2016-07-05 17:00:49 -07:00
parent cfeeebd410
commit 34f89d09e7

View File

@ -9,11 +9,13 @@ print 'dir =', dir
os.chdir(dir) os.chdir(dir)
# Convert glade data # Convert glade data
in_file = dir + '/fah/FAHControl.glade' in_file = 'fah/FAHControl.glade'
out_file = dir + '/fah/FAHControl_glade.py' out_file = 'fah/FAHControl_glade.py'
input = None
output = None if os.path.exists(in_file):
try: input = None
output = None
try:
input = open(in_file, 'r') input = open(in_file, 'r')
output = open(out_file, 'w') output = open(out_file, 'w')
@ -21,7 +23,7 @@ try:
output.write('glade_data = """') output.write('glade_data = """')
output.write(input.read()) output.write(input.read())
output.write('"""\n') output.write('"""\n')
finally: finally:
if input is not None: input.close() if input is not None: input.close()
if output is not None: output.close() if output is not None: output.close()