inkstitch/lib/extensions/layer_commands.py

24 wiersze
654 B
Python
Czysty Zwykły widok Historia

2021-03-12 04:17:19 +00:00
# Authors: see git history
#
# Copyright (c) 2010 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
2018-08-17 02:50:34 +00:00
import inkex
from ..commands import LAYER_COMMANDS, add_layer_commands
2018-08-17 02:50:34 +00:00
from ..i18n import _
from .commands import CommandsExtension
2018-08-17 02:50:34 +00:00
class LayerCommands(CommandsExtension):
2018-08-18 03:02:27 +00:00
COMMANDS = LAYER_COMMANDS
2018-08-17 02:50:34 +00:00
def effect(self):
commands = [command for command in self.COMMANDS if getattr(self.options, command)]
if not commands:
inkex.errormsg(_("Please choose one or more commands to add."))
return
add_layer_commands(self.svg.get_current_layer(), commands)