From aa7e1cac11f04f997317c5263b00d1e7d0b94608 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 3 Dec 2017 21:06:02 +0100 Subject: o Ignoring AR component fields (for now). --- src/ee/kicad/read_schematic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ee') diff --git a/src/ee/kicad/read_schematic.py b/src/ee/kicad/read_schematic.py index fc4c484..56cdca8 100644 --- a/src/ee/kicad/read_schematic.py +++ b/src/ee/kicad/read_schematic.py @@ -17,6 +17,7 @@ def read_schematics(path): return Schematics(read(path)) def read_schematic(path): + path_basename = os.path.basename(path) schematic = Schematic() def descr_section(lines): @@ -59,7 +60,7 @@ def read_schematic(path): else: parts = shlex.split(line) if len(parts) < 3: - raise EeException("Bad component line: {}".format(line)) + raise EeException("Bad component line: {}:{}".format(path_basename, line)) if parts[0] == "L" and len(parts) == 3: name = parts[1] @@ -70,6 +71,8 @@ def read_schematic(path): timestamp = parts[3] elif parts[0] == "P" and len(parts) == 3: position = Position(int(parts[1]), int(parts[2])) + elif parts[0] == "AR": + pass elif parts[0] == "F" and len(parts) >= 10: # orientation = parts[3] pos = Position(int(parts[4]), int(parts[5])) @@ -88,7 +91,7 @@ def read_schematic(path): "Bad index: {}, expected={}. component={}, line={}".format(idx, len(fields), ref, line)) fields.append(ComponentField(idx, field_name, value, pos)) else: - raise EeException("Bad component field: '{}'".format(line)) + raise EeException("Bad component field: {}: '{}'".format(path_basename, line)) schematic.add_component(Component(position, timestamp, library, name, unit, ref, fields)) -- cgit v1.2.3