summaryrefslogtreecommitdiff
path: root/lib/extensions/base.py
diff options
context:
space:
mode:
authorKaalleen <reni@allenka.de>2021-06-28 20:05:50 +0200
committerKaalleen <reni@allenka.de>2021-06-28 20:05:50 +0200
commitecacb9829e9c2b7050486707211f9d176aafdf75 (patch)
treef6f30f9707a9c3f603ce896b0b95dbe5c4b13dc1 /lib/extensions/base.py
parent2f54ff2a436f2774bfdc730b6e95c43f18ed81ac (diff)
pattern markers
Diffstat (limited to 'lib/extensions/base.py')
-rw-r--r--lib/extensions/base.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/extensions/base.py b/lib/extensions/base.py
index 353e433c..1c10cd4a 100644
--- a/lib/extensions/base.py
+++ b/lib/extensions/base.py
@@ -12,14 +12,14 @@ import inkex
from lxml import etree
from stringcase import snakecase
-from ..commands import group_commands, is_command, layer_commands
+from ..commands import is_command, layer_commands
from ..elements import EmbroideryElement, nodes_to_elements
from ..elements.clone import is_clone
+from ..elements.pattern import is_pattern
from ..i18n import _
from ..svg import generate_unique_id
from ..svg.tags import (CONNECTOR_TYPE, EMBROIDERABLE_TAGS, INKSCAPE_GROUPMODE,
- INKSTITCH_ATTRIBS, NOT_EMBROIDERABLE_TAGS,
- SVG_DEFS_TAG, SVG_GROUP_TAG)
+ NOT_EMBROIDERABLE_TAGS, SVG_DEFS_TAG, SVG_GROUP_TAG)
SVG_METADATA_TAG = inkex.addNS("metadata", "svg")
@@ -171,12 +171,10 @@ class InkstitchExtension(inkex.Effect):
if selected:
if node.tag == SVG_GROUP_TAG:
pass
- elif ((node.tag in EMBROIDERABLE_TAGS or is_clone(node)) and not
- (len(list(group_commands(node, 'pattern_group'))) and not node.get(INKSTITCH_ATTRIBS['satin_column']))):
+ elif (node.tag in EMBROIDERABLE_TAGS or is_clone(node)) and not is_pattern(node):
nodes.append(node)
# add images, text and patterns for the troubleshoot extension
- elif (troubleshoot and (node.tag in NOT_EMBROIDERABLE_TAGS or
- (len(list(group_commands(node, 'pattern_group'))) and not node.get(INKSTITCH_ATTRIBS['satin_column'])))):
+ elif troubleshoot and (node.tag in NOT_EMBROIDERABLE_TAGS or is_pattern(node)):
nodes.append(node)
return nodes