aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoropiopan <opiopan@gmail.com>2019-04-01 22:07:56 +0900
committeropiopan <opiopan@gmail.com>2019-04-01 22:07:56 +0900
commiteda75275505e14439e2dcd1990d2b95217546db1 (patch)
treebcb65d8027626f243f1f816aa54d433e7e02e6e3
parentb7320a6b586e8cf12ea126e7ed4320e6d9f53e99 (diff)
downloadpcb-tools-extension-eda75275505e14439e2dcd1990d2b95217546db1.tar.gz
pcb-tools-extension-eda75275505e14439e2dcd1990d2b95217546db1.tar.bz2
pcb-tools-extension-eda75275505e14439e2dcd1990d2b95217546db1.zip
compliant with Python 2.7
-rw-r--r--README.md2
-rw-r--r--gerberex/dxf.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index 2099b21..fd589d9 100644
--- a/README.md
+++ b/README.md
@@ -128,7 +128,7 @@ ctx.dump('merged_drill.txt')
```
## Panelizing Example
-This example board image is generated by following scripts
+This example board image is generated by following scripts from [these source data](examples).
- [panelizing script](examples/panelize.py)
- [imaging script](examples/genimage.py)
diff --git a/gerberex/dxf.py b/gerberex/dxf.py
index e863238..1b2ddf7 100644
--- a/gerberex/dxf.py
+++ b/gerberex/dxf.py
@@ -3,7 +3,7 @@
# Copyright 2019 Hiroshi Murayama <opiopan@gmail.com>
-import io
+import io, sys
from math import pi, cos, sin, tan, atan, atan2, acos, asin, sqrt
import dxfgrabber
from gerber.cam import CamFile, FileSettings
@@ -561,6 +561,8 @@ class DxfFile(CamFile):
raise Exception('Not supported')
def loads(data, filename=None):
+ if sys.version_info.major == 2:
+ data = unicode(data)
stream = io.StringIO(data)
dxf = dxfgrabber.read(stream)
return DxfFile(dxf)