beiyanpiki 1 year ago
parent 9c33036a50
commit cdccac013a

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -371,11 +371,6 @@ if __name__ == '__main__':
data = main()
sets = []
with open('../output/cards.json', 'w') as f:
f.write(convert_to_json(data))
with open('../output/cards_min.json', 'w') as f:
f.write(convert_to_json(data, compress=True))
for k, v in data.items():
folder = Path(f'../output/img/{k}')
folder.mkdir(parents=True, exist_ok=True)
@ -383,8 +378,6 @@ if __name__ == '__main__':
src = f'../PTCG-CHS-Datasets/{card.img_path}'
dst = f'../output/img/{k}/{card.collection_attr.card_no}.jpg'
shutil.copy2(src, dst)
v.cards = []
sets.append(v)
with open('../output/sets.json', 'w') as f:

@ -344,7 +344,7 @@ class PSet:
self.set_type = SetType.SideProduct
def __json__(self):
data = {
return {
'name': self.name,
'symbol': self.symbol,
'release_date': self.release_date,
@ -353,6 +353,3 @@ class PSet:
'cards': [card.__json__() for card in self.cards],
'cards_num': self.cards_num
}
if len(data['cards']) == 0:
del data['cards']
return data

Loading…
Cancel
Save