Material: redundant card reader and writer, add some print messages

This commit is contained in:
Bernd Hahnebach
2019-04-23 09:12:55 +02:00
parent 5b1d977df1
commit 04d9836b88

View File

@@ -20,6 +20,9 @@
# * *
# ***************************************************************************
import FreeCAD
# here the usage description if you use this tool from the command line ("__main__")
CommandlineUsage = """Material - Tool to work with FreeCAD Material definition cards
@@ -49,8 +52,9 @@ Version:
"""
# see comments in module importFCMat, there is an independent parser implementation for reading and writing FCMat files
# inside FreeCAD a mixture of these parsers and the ones in importFCMat.py is used
# see comments in module importFCMat, there is an independent parser implementation
# for reading and writing FCMat files
# inside FreeCAD mostly the one from importFCMat.py is used
def importFCMat(fileName):
@@ -60,6 +64,10 @@ def importFCMat(fileName):
except ImportError:
import configparser
FreeCAD.Console.PrintError(
'This mat card reader is probably depretiated and not widely used in FreeCAD. '
'See comment in Material.py module.\n'
)
Config = configparser.RawConfigParser()
Config.optionxform = str
Config.read(fileName)
@@ -81,6 +89,10 @@ def exportFCMat(fileName, matDict):
import string
Config = configparser.RawConfigParser()
FreeCAD.Console.PrintError(
'This mat card writer is probably depretiated and not widely used in FreeCAD. '
'See comment in Material.py module.\n'
)
# create groups
for x in matDict.keys():
grp, key = string.split(x, sep='_')