Fine-tune some details

This commit is contained in:
Daniel Rojas 2020-06-14 00:18:16 +02:00
parent a43d7701f4
commit a5035456ea

View File

@ -103,8 +103,9 @@ class Harness:
for k, n in self.connectors.items(): for k, n in self.connectors.items():
if n.category == 'ferrule': if n.category == 'ferrule':
infostring = '{type} {color}'.format(type=n.type, infostring = '{type}{subtype} {color}'.format(type=n.type,
color=translate_color(n.color, self.color_mode) if n.color else '') subtype=', {}'.format(n.subtype) if n.subtype else '',
color=translate_color(n.color, self.color_mode) if n.color else '')
infostring_l = infostring if n.ports_right else '' infostring_l = infostring if n.ports_right else ''
infostring_r = infostring if n.ports_left else '' infostring_r = infostring if n.ports_left else ''
@ -567,7 +568,6 @@ def parse(file_in, file_out=None, gen_bom=False):
h.add_cable(name=k, **o) h.add_cable(name=k, **o)
elif sec == 'ferrules': elif sec == 'ferrules':
pass pass
# h.add_connector(name=k, category='ferrule', **o)
else: else:
# print('{} section empty'.format(sec)) # print('{} section empty'.format(sec))
pass pass
@ -702,7 +702,7 @@ if __name__ == '__main__':
ap = argparse.ArgumentParser() ap = argparse.ArgumentParser()
ap.add_argument('file_input', nargs='?', default='_test/test.yml') ap.add_argument('file_input', nargs='?', default='_test/test.yml')
ap.add_argument('file_output', nargs='?', default=None) ap.add_argument('file_output', nargs='?', default=None)
ap.add_argument('--bom', action='store_const', default=False, const=True) ap.add_argument('--bom', action='store_const', default=True, const=True)
args = ap.parse_args() args = ap.parse_args()
parse(args.file_input, file_out=args.file_output, gen_bom=args.bom) parse(args.file_input, file_out=args.file_output, gen_bom=args.bom)