Pre flight (#64)

* Pre-flight - verify input files before running main script.

* Pre-flight - verify input files before running main script.
This commit is contained in:
tritoch 2017-06-27 13:03:35 -05:00 committed by GitHub
parent ea7c9228be
commit 813ded7802
2 changed files with 32 additions and 0 deletions

View File

@ -1,4 +1,7 @@
language: python
before_install:
- pip install commentjson
- python verify_files.py
install:
- pip install -r requirements.txt
script: bash ./deploy.sh

29
verify_files.py Normal file
View File

@ -0,0 +1,29 @@
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."