diff options
author | Qau Lau <qaulau@hotmail.com> | 2016-04-08 20:02:04 +0800 |
---|---|---|
committer | Qau Lau <qaulau@hotmail.com> | 2016-04-08 20:02:04 +0800 |
commit | 199a0f3d3c5d4dbbc4ac6e8d1b4548523e44f00f (patch) | |
tree | e8f7e39328b9337de8f0b0badd2efbfafb5e0ae2 /gerber/render/cairo_backend.py | |
parent | 2eac1e427ca3264cb6dc36e0712020c1ca73fa9c (diff) | |
download | gerbonara-199a0f3d3c5d4dbbc4ac6e8d1b4548523e44f00f.tar.gz gerbonara-199a0f3d3c5d4dbbc4ac6e8d1b4548523e44f00f.tar.bz2 gerbonara-199a0f3d3c5d4dbbc4ac6e8d1b4548523e44f00f.zip |
Update cairo_backend.py
If cairo module import error use cairocffi
Diffstat (limited to 'gerber/render/cairo_backend.py')
-rw-r--r-- | gerber/render/cairo_backend.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py index d895e5c..1d168ca 100644 --- a/gerber/render/cairo_backend.py +++ b/gerber/render/cairo_backend.py @@ -17,7 +17,10 @@ from .render import GerberContext
-import cairo
+try:
+ import cairo
+except ImportError:
+ import cairocffi as cairo
from operator import mul
import math
@@ -233,4 +236,4 @@ class GerberCairoContext(GerberContext): self.surface.finish()
self.surface_buffer.flush()
return self.surface_buffer.read()
-
\ No newline at end of file +
|