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
|
|
|
|
|
2021-07-25 05:24:34 +00:00
|
|
|
from ..commands import LAYER_COMMANDS, add_layer_commands
|
2018-08-17 02:50:34 +00:00
|
|
|
from ..i18n import _
|
2018-11-15 01:23:06 +00:00
|
|
|
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
|
|
|
|
|
2021-07-25 05:24:34 +00:00
|
|
|
add_layer_commands(self.svg.get_current_layer(), commands)
|