From 0e98a3f0d451795b302a299fe801eb7ece8f735f Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Fri, 13 Feb 2015 01:42:39 +0100 Subject: Python3 needs print() --- gerber/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerber/__main__.py b/gerber/__main__.py index 8f20212..6e25bf3 100644 --- a/gerber/__main__.py +++ b/gerber/__main__.py @@ -27,7 +27,7 @@ if __name__ == '__main__': ctx = GerberSvgContext() ctx.alpha = 0.95 for filename in sys.argv[1:]: - print "parsing %s" % filename + print("parsing %s" % filename) if 'GTO' in filename or 'GBO' in filename: ctx.color = (1, 1, 1) ctx.alpha = 0.8 -- cgit From 7ace94b0230e9acd85097c1812840250d551015c Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Wed, 18 Feb 2015 15:35:01 +0100 Subject: Make gerber.render a package & fix more relative import statements --- gerber/__main__.py | 4 ++-- gerber/tests/test_cam.py | 2 +- gerber/tests/test_common.py | 2 +- gerber/tests/test_primitives.py | 2 +- gerber/tests/test_rs274x.py | 2 +- setup.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gerber/__main__.py b/gerber/__main__.py index 6e25bf3..599c161 100644 --- a/gerber/__main__.py +++ b/gerber/__main__.py @@ -16,9 +16,9 @@ # the License. if __name__ == '__main__': - from .common import read - from .render import GerberSvgContext import sys + from gerber.common import read + from gerber.render import GerberSvgContext if len(sys.argv) < 2: print >> sys.stderr, "Usage: python -m gerber ..." diff --git a/gerber/tests/test_cam.py b/gerber/tests/test_cam.py index 6296cc9..00a8285 100644 --- a/gerber/tests/test_cam.py +++ b/gerber/tests/test_cam.py @@ -4,7 +4,7 @@ # Author: Hamilton Kibbe from ..cam import CamFile, FileSettings -from tests import * +from .tests import * def test_filesettings_defaults(): diff --git a/gerber/tests/test_common.py b/gerber/tests/test_common.py index bf9760a..76e3991 100644 --- a/gerber/tests/test_common.py +++ b/gerber/tests/test_common.py @@ -5,7 +5,7 @@ from ..common import read from ..excellon import ExcellonFile from ..rs274x import GerberFile -from tests import * +from .tests import * import os diff --git a/gerber/tests/test_primitives.py b/gerber/tests/test_primitives.py index cada6d4..dab0225 100644 --- a/gerber/tests/test_primitives.py +++ b/gerber/tests/test_primitives.py @@ -3,7 +3,7 @@ # Author: Hamilton Kibbe from ..primitives import * -from tests import * +from .tests import * def test_primitive_implementation_warning(): diff --git a/gerber/tests/test_rs274x.py b/gerber/tests/test_rs274x.py index 27f6f49..5185fa1 100644 --- a/gerber/tests/test_rs274x.py +++ b/gerber/tests/test_rs274x.py @@ -5,7 +5,7 @@ import os from ..rs274x import read, GerberFile -from tests import * +from .tests import * TOP_COPPER_FILE = os.path.join(os.path.dirname(__file__), diff --git a/setup.py b/setup.py index 02b9df6..d0e2bfc 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ METADATA = { 'license': "Apache", 'keywords': "gerber tools", 'url': "http://github.com/curtacircuitos/gerber-tools", - 'packages': ['gerber'], + 'packages': ['gerber', 'gerber.render'], 'long_description': read('README.md'), 'classifiers':[ "Development Status :: 3 - Alpha", -- cgit From e6fa61c82b41473e5d6b37846b2ee372a5dc417f Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Wed, 18 Feb 2015 15:54:36 +0100 Subject: Fixing more relative import statements --- gerber/common.py | 6 +++--- gerber/render/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gerber/common.py b/gerber/common.py index 83e3cb0..78da2cd 100644 --- a/gerber/common.py +++ b/gerber/common.py @@ -30,9 +30,9 @@ def read(filename): CncFile object representing the file, either GerberFile or ExcellonFile. Returns None if file is not an Excellon or Gerber file. """ - import rs274x - import excellon - from utils import detect_file_format + from . import rs274x + from . import excellon + from .utils import detect_file_format fmt = detect_file_format(filename) if fmt == 'rs274x': return rs274x.read(filename) diff --git a/gerber/render/__init__.py b/gerber/render/__init__.py index b4af4ad..1e60792 100644 --- a/gerber/render/__init__.py +++ b/gerber/render/__init__.py @@ -24,5 +24,5 @@ SVG is the only supported format. """ -from svgwrite_backend import GerberSvgContext -from cairo_backend import GerberCairoContext +from .svgwrite_backend import GerberSvgContext +from .cairo_backend import GerberCairoContext -- cgit From ed7d9ceb349f405ca40f43835a5fd6fc1beed98b Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Wed, 18 Feb 2015 15:57:49 +0100 Subject: accidentially changed import order in 7ace94b --- gerber/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerber/__main__.py b/gerber/__main__.py index 599c161..a792182 100644 --- a/gerber/__main__.py +++ b/gerber/__main__.py @@ -16,9 +16,9 @@ # the License. if __name__ == '__main__': - import sys from gerber.common import read from gerber.render import GerberSvgContext + import sys if len(sys.argv) < 2: print >> sys.stderr, "Usage: python -m gerber ..." -- cgit