From 4ba3cd708561870a731d9634d9cdd5c18579cac7 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 22 Feb 2019 22:07:15 -0500 Subject: refactor add_commands() out into commands module --- lib/extensions/object_commands.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/extensions/object_commands.py') diff --git a/lib/extensions/object_commands.py b/lib/extensions/object_commands.py index 47fb361d..d33ab2ba 100644 --- a/lib/extensions/object_commands.py +++ b/lib/extensions/object_commands.py @@ -1,8 +1,8 @@ import inkex -from .commands import CommandsExtension -from ..commands import OBJECT_COMMANDS +from ..commands import OBJECT_COMMANDS, add_commands from ..i18n import _ +from .commands import CommandsExtension class ObjectCommands(CommandsExtension): @@ -24,14 +24,11 @@ class ObjectCommands(CommandsExtension): inkex.errormsg(_("Please choose one or more commands to attach.")) return - for command in commands: - self.ensure_symbol(command) - # Each object (node) in the SVG may correspond to multiple Elements of different # types (e.g. stroke + fill). We only want to process each one once. seen_nodes = set() for element in self.elements: if element.node not in seen_nodes: - self.add_commands(element, commands) + add_commands(element, commands) seen_nodes.add(element.node) -- cgit v1.2.3