From 78f5dd2df94bb33ccc109a98ef56c733bd3cb2c4 Mon Sep 17 00:00:00 2001 From: dev-id Date: Fri, 8 Sep 2017 10:12:15 -0500 Subject: [PATCH] Improved no-cards set debug print --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index 557d7ac9..4936f336 100644 --- a/main.py +++ b/main.py @@ -111,6 +111,7 @@ if __name__ == '__main__': parseargs() AllSets = spoilers.get_allsets() # get AllSets from mtgjson combinedjson = {} + noCards = [] for setinfo in setinfos: if setinfo['code'] in AllSets: print "Found " +setinfo['code']+ " set from set_info.yml in MTGJSON, not adding it" @@ -138,6 +139,9 @@ if __name__ == '__main__': [mtgjson, errors] = spoilers.error_check( mtgjson, card_corrections) # check for errors where possible errorlog += errors + if not 'cards' in mtgjson or mtgjson['cards'] == [] or not mtgjson['cards']: + noCards.append(setinfo['code']) + continue spoilers.write_xml( mtgjson, setinfo['code'], setinfo['name'], setinfo['releaseDate']) #save_xml(spoilers.pretty_xml(setinfo['code']), 'out/spoiler.xml') @@ -163,6 +167,8 @@ if __name__ == '__main__': combinedjson[setinfo['code']] = mtgjson if os.path.isfile('out/' + setinfo['code'] + '.xml'): save_xml(spoilers.pretty_xml('out/' + setinfo['code'] + '.xml'), 'out/' + setinfo['code'] + '.xml') + if noCards != []: + print("Not proccesing set(s) with no cards: {}".format(noCards)) save_setjson(combinedjson, 'spoiler') spoilers.write_combined_xml(combinedjson, setinfos) save_xml(spoilers.pretty_xml('out/spoiler.xml'), 'out/spoiler.xml')