mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-04-24 15:07:48 -05:00
Merge pull request #17 from tritoch/comment-json
Allow comments in JSON files
This commit is contained in:
commit
9f51dce940
|
|
@ -1,3 +1,10 @@
|
|||
// Objects to be fixed
|
||||
// "Card Name": {
|
||||
// "Key": "New Value"
|
||||
// }
|
||||
// List of Keys:
|
||||
//
|
||||
|
||||
{
|
||||
"Angel of the God-Pharoh": {
|
||||
"name": "Angel of the God-Pharaoh",
|
||||
10
cards_delete
Normal file
10
cards_delete
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// List of card strings to be removed
|
||||
// [
|
||||
// "Card Name 1",
|
||||
// "Card Name 2"
|
||||
// ]
|
||||
// Case-sensitive
|
||||
|
||||
[
|
||||
"Sunset Pyramid (TO DELETE)"
|
||||
]
|
||||
|
|
@ -1 +0,0 @@
|
|||
["Sunset Pyramid (TO DELETE)"]
|
||||
23
main.py
23
main.py
|
|
@ -1,11 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import spoilers
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
#import configparser
|
||||
import commentjson
|
||||
import json
|
||||
#import urllib
|
||||
|
||||
presets = {
|
||||
"isfullspoil": False, #when full spoil comes around, we only want to use WOTC images
|
||||
|
|
@ -16,18 +13,18 @@ presets = {
|
|||
}
|
||||
}
|
||||
|
||||
with open('set_info.json') as data_file:
|
||||
setinfos = json.load(data_file)
|
||||
with open('set_info') as data_file:
|
||||
setinfos = commentjson.load(data_file)
|
||||
|
||||
with open('cards_manual.json') as data_file:
|
||||
manual_sets = json.load(data_file)
|
||||
with open('cards_manual') as data_file:
|
||||
manual_sets = commentjson.load(data_file)
|
||||
#manual_cards = manual_cards['cards']
|
||||
|
||||
with open('cards_corrections.json') as data_file:
|
||||
card_corrections = json.load(data_file)
|
||||
with open('cards_corrections') as data_file:
|
||||
card_corrections = commentjson.load(data_file)
|
||||
|
||||
with open('cards_delete.json') as data_file:
|
||||
delete_cards = json.load(data_file)
|
||||
with open('cards_delete') as data_file:
|
||||
delete_cards = commentjson.load(data_file)
|
||||
|
||||
errorlog = []
|
||||
|
||||
|
|
@ -115,4 +112,4 @@ if __name__ == '__main__':
|
|||
save_xml(spoilers.pretty_xml('out/spoiler.xml'), 'out/spoiler.xml')
|
||||
save_errorlog(errorlog)
|
||||
save_allsets(AllSets)
|
||||
#save_setjson(mtgjson)
|
||||
#save_setjson(mtgjson)
|
||||
|
|
@ -3,4 +3,5 @@ feedparser
|
|||
lxml
|
||||
Pillow
|
||||
datetime
|
||||
beautifulsoup4
|
||||
beautifulsoup4
|
||||
commentjson
|
||||
Loading…
Reference in New Issue
Block a user