From 3a5dbcf1e13704b7352d5fb3c4777d7df3fed081 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sun, 28 Sep 2014 21:17:13 -0400 Subject: added ExcellonFile class --- gerber/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gerber/__init__.py') 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 -- cgit From f8449ad2b60b8a715d0867325e257a8297193b49 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Tue, 30 Sep 2014 23:42:02 -0400 Subject: tests update --- gerber/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 089d7b6..e31bd6f 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -18,6 +18,17 @@ def read(filename): """ Read a gerber or excellon file and return a representative object. + + Parameters + ---------- + filename : string + Filename of the file to read. + + Returns + ------- + file : CncFile subclass + CncFile object representing the file, either GerberFile or + ExcellonFile. Returns None if file is not an Excellon or Gerber file. """ import gerber import excellon -- cgit From 0b8e2e4b8b552e90d55eabe39aefba0b5b3daef5 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Wed, 1 Oct 2014 14:39:32 -0400 Subject: added numpydoc --- gerber/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index e31bd6f..3197335 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -14,7 +14,12 @@ # 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. +""" +gerber module +============ +**Gerber Tools** +""" def read(filename): """ Read a gerber or excellon file and return a representative object. -- cgit From 1653ae5cbe88757e453bccf499dc1b8ccb278e58 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Wed, 8 Oct 2014 09:27:52 -0400 Subject: Update readme and example --- gerber/__init__.py | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 3197335..4637713 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -21,27 +21,3 @@ gerber module """ -def read(filename): - """ Read a gerber or excellon file and return a representative object. - - Parameters - ---------- - filename : string - Filename of the file to read. - - Returns - ------- - file : CncFile subclass - CncFile object representing the file, either GerberFile or - ExcellonFile. Returns None if file is not an Excellon or Gerber file. - """ - 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 -- cgit From f2f411493ea303075d5dbdd7656c572dda61cf67 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Thu, 9 Oct 2014 22:10:28 -0400 Subject: doc update --- gerber/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index 4637713..fce6483 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -15,9 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. """ -gerber module +Gerber Tools ============ **Gerber Tools** +gerber-tools provides utilities for working with Gerber (RS-274X) and Excellon +files in python. """ -- cgit From 18e3b87625ddb739faeddffcaed48e12db6c7e8b Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sun, 19 Oct 2014 22:23:00 -0400 Subject: Test update --- gerber/__init__.py | 1 + 1 file changed, 1 insertion(+) (limited to 'gerber/__init__.py') diff --git a/gerber/__init__.py b/gerber/__init__.py index fce6483..1a11159 100644 --- a/gerber/__init__.py +++ b/gerber/__init__.py @@ -23,3 +23,4 @@ gerber-tools provides utilities for working with Gerber (RS-274X) and Excellon files in python. """ +from .common import read \ No newline at end of file -- cgit