Skip to content

Commit

Permalink
Material: card utils, do not fail to return card dicts if reading a c…
Browse files Browse the repository at this point in the history
…ard fails
  • Loading branch information
berndhahnebach committed Jun 8, 2019
1 parent 6bb8f19 commit 5301013
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Mod/Material/materialtools/cardutils.py
Expand Up @@ -146,7 +146,14 @@ def add_cards_from_a_dir(materials, cards, icons, mat_dir, icon, template=False)
# duplicates are indicated on equality of mat dict
# TODO if the unit is different two cards would be different too
for a_path in dir_path_list:
mat_dict = read(a_path)
try:
mat_dict = read(a_path)
except:
FreeCAD.Console.PrintError(
'Error on reading card data. The card data will be empty for card:\n{}\n'
.format(a_path)
)
mat_dict = {}
card_name = os.path.splitext(os.path.basename(a_path))[0]
if (card_name == 'TEMPLATE') and (template is False):
continue
Expand Down

0 comments on commit 5301013

Please sign in to comment.