mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-08-22 01:15:02 -05:00
Merge pull request #145 from dev-id/future-sets-cleanup
Don't make set files for sets without cards.
This commit is contained in:
8
main.py
8
main.py
@@ -158,9 +158,11 @@ if __name__ == '__main__':
|
||||
save_masterpieces(masterpieces, setinfo)
|
||||
save_xml(spoilers.pretty_xml('out/' + setinfo['masterpieces']['code'] + '.xml'), 'out/' + setinfo['masterpieces']['code'] + '.xml')
|
||||
combinedjson[setinfo['masterpieces']['code']] = masterpieces
|
||||
save_setjson(mtgjson, setinfo['code'])
|
||||
save_xml(spoilers.pretty_xml('out/' + setinfo['code'] + '.xml'), 'out/' + setinfo['code'] + '.xml')
|
||||
combinedjson[setinfo['code']] = mtgjson
|
||||
if 'cards' in mtgjson and mtgjson['cards'] and not mtgjson['cards'] == []:
|
||||
save_setjson(mtgjson, setinfo['code'])
|
||||
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')
|
||||
save_setjson(combinedjson, 'spoiler')
|
||||
spoilers.write_combined_xml(combinedjson, setinfos)
|
||||
save_xml(spoilers.pretty_xml('out/spoiler.xml'), 'out/spoiler.xml')
|
||||
|
||||
@@ -362,6 +362,8 @@ def get_image_urls(mtgjson, isfullspoil, setinfo=False):
|
||||
|
||||
|
||||
def write_xml(mtgjson, code, name, releaseDate):
|
||||
if not 'cards' in mtgjson or not mtgjson['cards'] or mtgjson['cards'] == []:
|
||||
return
|
||||
if not os.path.isdir('out/'):
|
||||
os.makedirs('out/')
|
||||
cardsxml = open('out/' + code + '.xml', 'w+')
|
||||
|
||||
Reference in New Issue
Block a user