diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-01-28 12:19:03 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-01-28 12:19:03 -0500 |
commit | 5df38c014fd09792995b2b12b1982c535c962c9a (patch) | |
tree | 3dd1f118a752b7b6e75511e1f3b3af3ac1b67bdc /gerber/excellon.py | |
parent | b9f1b106c3006f1dddb1279ae9622630a29d18c7 (diff) | |
download | gerbonara-5df38c014fd09792995b2b12b1982c535c962c9a.tar.gz gerbonara-5df38c014fd09792995b2b12b1982c535c962c9a.tar.bz2 gerbonara-5df38c014fd09792995b2b12b1982c535c962c9a.zip |
Cleanup, rendering fixes.
fixed rendering of tented vias
fixed rendering of semi-transparent layers
fixed file type detection issues
added some examples
Diffstat (limited to 'gerber/excellon.py')
-rwxr-xr-x | gerber/excellon.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py index b29f7f0..24715d8 100755 --- a/gerber/excellon.py +++ b/gerber/excellon.py @@ -28,7 +28,7 @@ import operator try:
from cStringIO import StringIO
-except(ImportError):
+except ImportError:
from io import StringIO
from .excellon_statements import *
@@ -57,13 +57,16 @@ def read(filename): return ExcellonParser(settings).parse(filename)
-def loads(data):
+def loads(data, filename=None):
""" Read data from string and return an ExcellonFile
Parameters
----------
data : string
string containing Excellon file contents
+ filename : string, optional
+ string containing the filename of the data source
+
Returns
-------
file : :class:`gerber.excellon.ExcellonFile`
@@ -72,7 +75,7 @@ def loads(data): """
# File object should use settings from source file by default.
settings = FileSettings(**detect_excellon_format(data))
- return ExcellonParser(settings).parse_raw(data)
+ return ExcellonParser(settings).parse_raw(data, filename)
class DrillHit(object):
|