diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2021-03-22 17:06:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-22 17:06:48 +0100 |
| commit | 183b2451fd6515f72c709a40b4e5ab5735427823 (patch) | |
| tree | 175c7d18392632a34cb25165ac1fb03470fb8cf5 /lib/elements/element.py | |
| parent | 8c4288431644f590e127a85d1f23171fb9b2cc95 (diff) | |
update font tools etc (#1086)
* update font tools
* fix tie error
* ignore duplicated commands
Diffstat (limited to 'lib/elements/element.py')
| -rw-r--r-- | lib/elements/element.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py index 2d77a5d4..3468673a 100644 --- a/lib/elements/element.py +++ b/lib/elements/element.py @@ -84,11 +84,12 @@ class EmbroideryElement(object): self.replace_legacy_param(attrib) legacy_attribs = True # convert legacy tie setting - legacy_tie = self.get_boolean_param('ties', None) - if legacy_tie is False: - self.set_param('ties', 3) - elif legacy_tie is True: + legacy_tie = self.get_param('ties', None) + if legacy_tie == "True": self.set_param('ties', 0) + elif legacy_tie == "False": + self.set_param('ties', 3) + # defaut setting for fill_underlay has changed if legacy_attribs and not self.get_param('fill_underlay', ""): self.set_param('fill_underlay', False) @@ -319,11 +320,8 @@ class EmbroideryElement(object): def get_command(self, command): commands = self.get_commands(command) - if len(commands) == 1: + if commands: return commands[0] - elif len(commands) > 1: - raise ValueError(_("%(id)s has more than one command of type '%(command)s' linked to it") % - dict(id=self.node.get('id'), command=command)) else: return None |
