Material: mat module, write all cards def, add a parameter to not write the template card, which is active by default
This commit is contained in:
@@ -139,16 +139,19 @@ def read_cards_from_path(cards_path):
|
||||
return mat_cards
|
||||
|
||||
|
||||
def write_cards_to_path(cards_path, cards_data, write_group_section=True):
|
||||
def write_cards_to_path(cards_path, cards_data, write_group_section=True, write_template=False):
|
||||
from importFCMat import write
|
||||
from os.path import join
|
||||
for card_data in cards_data:
|
||||
card_path = join(cards_path, (card_data['CardName'] + '.FCMat'))
|
||||
print(card_path)
|
||||
if write_group_section is True:
|
||||
write(card_path, card_data, True)
|
||||
if (card_data['CardName'] == 'TEMPLATE') and (write_template is False):
|
||||
continue
|
||||
else:
|
||||
write(card_path, card_data, False)
|
||||
card_path = join(cards_path, (card_data['CardName'] + '.FCMat'))
|
||||
print(card_path)
|
||||
if write_group_section is True:
|
||||
write(card_path, card_data, True)
|
||||
else:
|
||||
write(card_path, card_data, False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user