improved 'patch.py' compatibility

This commit is contained in:
easyw 2019-11-27 12:48:33 +01:00
parent e4d1a42b7c
commit 7363260c42

View file

@ -13,7 +13,8 @@ class ConfigFile():
idx = 0 idx = 0
for line in file: for line in file:
l = line.strip() l = line.strip()
if l != '': #print(line.startswith('#'), line)
if l != '' and not (line.startswith('[') or line.startswith('#')):
try: try:
key, value = l.split('=', 1) key, value = l.split('=', 1)
except: except:
@ -26,7 +27,7 @@ class ConfigFile():
idx = 0 idx = 0
for line in file: for line in file:
l = line.strip() l = line.strip()
if l == '': if l == '' or (line.startswith('[') or line.startswith('#')):
continue continue
try: try:
@ -112,7 +113,7 @@ if not args.pcb_disable:
if not args.footprint_disable: if not args.footprint_disable:
fpe_patch = args.scheme_path[0] / 'footprint_editor' fpe_patch = args.scheme_path[0] / 'footprint_editor'
if not pcb_patch.is_file(): if not fpe_patch.is_file():
print("Scheme does not contain a definition for the footprint editor, skipped.") print("Scheme does not contain a definition for the footprint editor, skipped.")
else: else:
print("Updating footprint editor configuration.") print("Updating footprint editor configuration.")