mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-04-25 15:47:15 -05:00
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:
parent
ea7c9228be
commit
813ded7802
|
|
@ -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
29
verify_files.py
Normal 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."
|
||||
Loading…
Reference in New Issue
Block a user