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:
Bernd Hahnebach
2019-03-01 21:01:40 +01:00
committed by wmayer
parent 93456fda4c
commit 6a3a3f9f3e

View File

@@ -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__':