summaryrefslogtreecommitdiff
path: root/gerber/render
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2015-10-10 16:51:21 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2015-10-10 16:51:21 -0400
commitdd63b169f177389602e17bc6ced53bd0f1ba0de3 (patch)
tree12be6d968c97be78c3910b2c84b048211e88c7e2 /gerber/render
parentb81c9d4bf96845ced3495eb158ec3a3c9e4dce3d (diff)
downloadgerbonara-dd63b169f177389602e17bc6ced53bd0f1ba0de3.tar.gz
gerbonara-dd63b169f177389602e17bc6ced53bd0f1ba0de3.tar.bz2
gerbonara-dd63b169f177389602e17bc6ced53bd0f1ba0de3.zip
Allow files to be read from strings per #37
Adds a loads() method to the top level module which generates a GerberFile or ExcellonFile from a string
Diffstat (limited to 'gerber/render')
-rw-r--r--gerber/render/cairo_backend.py6
-rw-r--r--gerber/render/render.py1
2 files changed, 7 insertions, 0 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py
index a97e552..345f331 100644
--- a/gerber/render/cairo_backend.py
+++ b/gerber/render/cairo_backend.py
@@ -172,3 +172,9 @@ class GerberCairoContext(GerberContext):
else:
self.surface.write_to_png(filename)
+
+ def dump_svg_str(self):
+ self.surface.finish()
+ self.surface_buffer.flush()
+ return self.surface_buffer.read()
+ \ No newline at end of file
diff --git a/gerber/render/render.py b/gerber/render/render.py
index 124e743..8f49796 100644
--- a/gerber/render/render.py
+++ b/gerber/render/render.py
@@ -181,3 +181,4 @@ class GerberContext(object):
def _render_test_record(self, primitive, color):
pass
+