Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit d4dcc67

Browse files
committed
merging in layer import fix
2 parents 958662b + 53b52e8 commit d4dcc67

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- [diff_stix.py](scripts/diff_stix.py) now supports an `--unchanged` argument which adds a section listing objects which did _not_ change between releases.
44
## Fixes
55
- [diff_stix.py](scripts/diff_stix.py) should no longer crash when exporting layers but with only one domain specified.
6+
- Fixed a bug in the layer library where layers could be imported improperly in specific contexts.
67

78
# v1.8.1 - 3 March 2021
89
## Fixes

layers/exporters/svg_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def build(height, width, label, config, variant='text', t1text=None, t2text=None
260260
upper = G(tx=0, ty=2.1)
261261
internal.append(upper)
262262
if t1text is not None:
263-
bu = t2text is not None and t2text is not ""
263+
bu = t2text != None and t2text != ""
264264
theight = (height-5)
265265
if bu:
266266
theight = theight / 2

layers/exporters/to_svg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from ..core import Layer
88
from ..exporters.svg_templates import SvgTemplates
99

10+
from layers.core import Layer as topLayer # alternative import for typechecking
11+
1012
class NoLayer(Exception):
1113
pass
1214

@@ -405,7 +407,7 @@ def to_svg(self, layer, filepath='example.svg'):
405407
:return: (meta) svg file at the targeted output location
406408
"""
407409
if layer is not None:
408-
if not isinstance(layer, Layer):
410+
if not isinstance(layer, Layer) and not isinstance(layer, topLayer):
409411
raise TypeError
410412

411413
if layer is None:

0 commit comments

Comments
 (0)