summaryrefslogtreecommitdiffstats
path: root/share/extensions/webslicer_create_group.py
diff options
context:
space:
mode:
authorAurelio A. Heckert (a) <auriumgmaildotcom>2010-03-29 21:42:38 +0000
committerAurelio A. Heckert (a) <auriumgmaildotcom>2010-03-29 21:42:38 +0000
commitfe83fef83df5cdee64b4da900197cb3c9e1b9a6e (patch)
treefb34c23a6cbee1bdf40663b07cfd0a808c60c339 /share/extensions/webslicer_create_group.py
parentRemove remnants of rather pointless MMX optimizations, and fix (diff)
downloadinkscape-fe83fef83df5cdee64b4da900197cb3c9e1b9a6e.tar.gz
inkscape-fe83fef83df5cdee64b4da900197cb3c9e1b9a6e.zip
webslicer: preparing to export
(bzr r9256)
Diffstat (limited to 'share/extensions/webslicer_create_group.py')
-rw-r--r--share/extensions/webslicer_create_group.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/share/extensions/webslicer_create_group.py b/share/extensions/webslicer_create_group.py
index aadfded38..666649bfb 100644
--- a/share/extensions/webslicer_create_group.py
+++ b/share/extensions/webslicer_create_group.py
@@ -17,21 +17,16 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
+from webslicer_effect import *
import inkex
import gettext
_ = gettext.gettext
-def is_empty(val):
- if val is None:
- return True
- else:
- return len(str(val)) == 0
-
-class WebSlicer_CreateGroup(inkex.Effect):
+class WebSlicer_CreateGroup(WebSlicer_Effect):
def __init__(self):
- inkex.Effect.__init__(self)
+ WebSlicer_Effect.__init__(self)
self.OptionParser.add_option("--html-id",
action="store", type="string",
dest="html_id",
@@ -51,12 +46,8 @@ class WebSlicer_CreateGroup(inkex.Effect):
def get_base_elements(self):
- layerArr = self.document.xpath(
- '//*[@id="webslicer-layer" and @inkscape:groupmode="layer"]',
- namespaces=inkex.NSS)
- if len(layerArr) > 0:
- self.layer = layerArr[0]
- else:
+ self.layer = self.get_slicer_layer()
+ if is_empty(self.layer):
inkex.errormsg(_('You must to create and select some "Slicer rectangles" before try to group.'))
exit(3)
self.layer_descendants = self.get_descendants_in_array(self.layer)