[pyar] [ot] extensión en python para inkscpe

SAn gringotumadre en gmail.com
Mar Nov 27 21:09:27 ART 2012


2012/11/27 Eduardo Sandulli <eduardosandulli en gmail.com>:
> { g.attrib["id"] : g.attrib[label_attr] for g in
> self.xml.xpath("svg:g[@inkscape:groupmode='layer']", namespaces=inkex.NSS)
> if "id" in g.attrib and label_attr in g.attrib }

Proba con esto:

self.layer_labels = dict((g.attrib["id"], g.attrib[label_attr]) for g
in self.xml.xpath("svg:g[@inkscape:groupmode='layer']",
namespaces=inkex.NSS) if "id" in g.attrib and label_attr in g.attrib)

Ya te habrás dado cuenta como es el patrón, simplemente reemplazar {
X: Y for etcetera } por dict((X, Y) for etcetera )

Los demás que sean iguales con esto podrás resolverlo vos mismo ;)



More information about the pyar mailing list