Misc. source comment typo and whitespace fixes

Found via codespell
This commit is contained in:
luz.paz
2019-06-16 10:03:30 -04:00
committed by Bernd Hahnebach
parent 8b14c886ee
commit 9845c002ab
13 changed files with 78 additions and 76 deletions

View File

@@ -4,7 +4,7 @@
FCMAT_DIR="../"
MATERIALS_FILE=Materials
# Remove exisitng $MATERIALS_FILE.csv
# Remove existing $MATERIALS_FILE.csv
if [ -f "$MATERIALS_FILE.csv" ]
then
rm $MATERIALS_FILE.csv

View File

@@ -89,7 +89,7 @@ def decode(name):
# in the module Material.py is another implementation of reading and writing FCMat files
# this implementation uses the ConfigParser module
# in ViewProviderFemMaterial in add_cards_from_a_dir() the parser from Material.py is used
# since this mixture seams to be there for ages it should not be changed for 0.18
# since this mixture seems to have be there for ages it should not be changed for 0.18
# TODO: get rid of this mixture in FreeCAD 0.19
# Metainformation
@@ -102,7 +102,7 @@ def decode(name):
def read(filename):
"reads a FCMat file and returns a dictionary from it"
# the reader should return a dictionary in any case even if the file
# has problems, a empty dict shuld be returned un such case
# has problems, an empty dict should be returned in such case
if isinstance(filename, unicode):
if sys.version_info.major < 3:
filename = filename.encode(sys.getfilesystemencoding())
@@ -117,7 +117,7 @@ def read(filename):
for ln, line in enumerate(f):
ln += 1 # enumerate starts with 0, but we would like to have the real line number
if line.startswith('#'):
# a # is assumed to be a comment which is ignored
# a '#' is assumed to be a comment which is ignored
continue
# the use of line number is not smart for a data model
# a wrong user edit could break the file
@@ -141,7 +141,7 @@ def read(filename):
# [ is a Section
if line[0] not in ";[":
# split once on first occurrence
# a link could contain a = and thus would be split
# a link could contain a '=' and thus would be split
k = line.split("=", 1)
if len(k) == 2:
v = k[1].strip()
@@ -223,7 +223,7 @@ def write(filename, dictionary, write_group_section=True):
f.write("\n[" + s["keyname"] + "]\n")
for k, i in s.items():
if (k != "keyname" and i != '') or k == "Name":
# use only keys which are not empty and the name even if empty
# use only keys which are not empty and the name, even if empty
if sys.version_info.major >= 3:
f.write(k + " = " + i + "\n")
else:

View File

@@ -607,7 +607,8 @@ def output_value_unit_info(param, value):
def check_mat_units(mat):
known_quantities = get_known_material_quantity_parameter()
# check if the param is a Quantity according card template, than chaeck unit
# check if the param is a Quantity according to the card template
# then check unit
# print(known_quantities)
units_ok = True
for param, value in mat.items():