aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-12-03 21:06:02 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-12-07 12:13:50 +0100
commitaa7e1cac11f04f997317c5263b00d1e7d0b94608 (patch)
treea6ce8e2e005b5525820d10b303e6897cd5493ebf
parent8d7c1f320544d47e5715dbd544f7bd29baeafef0 (diff)
downloadee-python-aa7e1cac11f04f997317c5263b00d1e7d0b94608.tar.gz
ee-python-aa7e1cac11f04f997317c5263b00d1e7d0b94608.tar.bz2
ee-python-aa7e1cac11f04f997317c5263b00d1e7d0b94608.tar.xz
ee-python-aa7e1cac11f04f997317c5263b00d1e7d0b94608.zip
o Ignoring AR component fields (for now).
-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))