summaryrefslogtreecommitdiff
path: root/gerber/__init__.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-09-28 21:17:13 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-09-28 21:17:13 -0400
commit3a5dbcf1e13704b7352d5fb3c4777d7df3fed081 (patch)
treef138c8e1503dfff6d1eae69f1ddb6b802420478f /gerber/__init__.py
parent695e3d9220be8773f6630bb5c512d122b8576742 (diff)
downloadgerbonara-3a5dbcf1e13704b7352d5fb3c4777d7df3fed081.tar.gz
gerbonara-3a5dbcf1e13704b7352d5fb3c4777d7df3fed081.tar.bz2
gerbonara-3a5dbcf1e13704b7352d5fb3c4777d7df3fed081.zip
added ExcellonFile class
Diffstat (limited to 'gerber/__init__.py')
-rw-r--r--gerber/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/gerber/__init__.py b/gerber/__init__.py
index 0bf7c24..089d7b6 100644
--- a/gerber/__init__.py
+++ b/gerber/__init__.py
@@ -14,3 +14,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
+
+def read(filename):
+ """ Read a gerber or excellon file and return a representative object.
+ """
+ import gerber
+ import excellon
+ from utils import detect_file_format
+ fmt = detect_file_format(filename)
+ if fmt == 'rs274x':
+ return gerber.read(filename)
+ elif fmt == 'excellon':
+ return excellon.read(filename)
+ else:
+ return None