aboutsummaryrefslogtreecommitdiff
path: root/src/ee/kicad
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/kicad')
-rw-r--r--src/ee/kicad/read_schematic.py7
1 files changed, 5 insertions, 2 deletions
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))