Skip to content

Commit

Permalink
Fix unicode error and allow usage with nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
pointhi authored and yaqwsx committed Apr 13, 2017
1 parent b96c3b0 commit 9623cff
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pcbdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,13 @@ def walk_components(board, export):
module = module.Next()
continue
lib = str(module.GetFPID().GetLibNickname()).strip()
name = str(module.GetFPID().GetFootprintName()).strip()
value = str(module.GetValue()).strip()
ref = str(module.GetReference()).strip()
try:
name = str(module.GetFPID().GetFootprintName()).strip()
except AttributeError:
# it seems we are working on Kicad >4.0.6, which has a changed method name
name = str(module.GetFPID().GetLibItemName()).strip()
value = unicode(module.GetValue()).strip()
ref = unicode(module.GetReference()).strip()
center = module.GetCenter()
orient = math.radians(module.GetOrientation() / 10)
pos = (center.x, center.y, orient)
Expand Down

0 comments on commit 9623cff

Please sign in to comment.