if (do_name() != 'Home') : ?>
endif ?>
Posted by Tom De Smedt on Oct 04, 2010
include("util/comment.php"); ?>
I'll get this and your other suggestions integrated.
Send me an e-mail with the changes so I don't forget.
SVG - parse_as_dict
Posted by Stu on Sep 23, 2010parse_as_dict is a feature by Architetto Francesco Fantoni for the svg library, it lets you get a dict of the shapes in an svg, looked up by their ids.
This lets you use them as libraries of shapes.
Heres the original mail explaining the functionality:
http://www.mail-archive.com/shoebot-devel@lists.tinkerhouse.net/msg00418.html
As we don't want to see fragmentation among the libraries it would be good if this could make it upstream back into shoebot.
Patch:
@@ -69,6 +70,18 @@
return paths
+def parse_as_dict(svg, cached=False, _copy=True):
+ paths_dict = {}
+ noid = 0
+ paths = parse(svg)
+ for p in paths:
+ if p.id:
+ paths_dict[p.id] = p
+ else:
+ noid += 1
+ paths_dict["no_id_"+str(noid)] = p
+ return paths_dict
+
def get_attribute(element, attribute, default=0):
""" Returns XML element's attribute, or default if none.