Magic-Spoiler/verify_files.py
tritoch 813ded7802 Pre flight (#64)
* Pre-flight - verify input files before running main script.

* Pre-flight - verify input files before running main script.
2017-06-27 13:03:35 -05:00

29 lines
1.1 KiB
Python

import commentjson
import sys
try:
with open('set_info') as data_file:
setinfos = commentjson.load(data_file)
except Exception as ex:
print "Unable to load file: set_info\nException information:\n" + str(ex.args)
sys.exit("Unable to load file: set_info")
try:
with open('cards_manual') as data_file:
manual_sets = commentjson.load(data_file)
except Exception as ex:
print "Unable to load file: cards_manual\nException information:\n" + str(ex.args)
sys.exit("Unable to load file: cards_manual")
try:
with open('cards_corrections') as data_file:
card_corrections = commentjson.load(data_file)
except Exception as ex:
print "Unable to load file: cards_corrections\nException information:\n" + str(ex.args)
sys.exit("Unable to load file: cards_corrections")
try:
with open('cards_delete') as data_file:
delete_cards = commentjson.load(data_file)
except Exception as ex:
print "Unable to load file: cards_delete\nException information:\n" + str(ex.args)
sys.exit("Unable to load file: cards_delete")
print "Pre-flight: All input files loaded successfully."