summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-06-30 14:16:56 -0400
committerLex Neva <github.com@lexneva.name>2018-07-12 20:13:34 -0400
commit61983b615b202bb95c21d7a5021af3373615e839 (patch)
tree51c1774b6cf4d16c8f025bac66e52f29eaa6d852 /lib
parent422e770eadd1805601861632845b3e63c66c5acc (diff)
add has_command()
Diffstat (limited to 'lib')
-rw-r--r--lib/elements/element.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py
index 3c31f1b0..f0b7ea6f 100644
--- a/lib/elements/element.py
+++ b/lib/elements/element.py
@@ -215,6 +215,10 @@ class EmbroideryElement(object):
return [c for c in self.commands if c.command == command]
@cache
+ def has_command(self, command):
+ return len(self.get_commands(command)) > 0
+
+ @cache
def get_command(self, command):
commands = self.get_commands(command)