details: http://www.bx.psu.edu/hg/galaxy/rev/023ea1a1d38a changeset: 2795:023ea1a1d38a user: Kanwei Li <kanwei@gmail.com> date: Tue Sep 29 13:20:48 2009 -0400 description: Allow XML includes. Fixes #131 1 file(s) affected in this change: lib/galaxy/util/__init__.py diffs (42 lines): diff -r 30a175ace572 -r 023ea1a1d38a lib/galaxy/util/__init__.py --- a/lib/galaxy/util/__init__.py Tue Sep 29 12:17:57 2009 -0400 +++ b/lib/galaxy/util/__init__.py Tue Sep 29 13:20:48 2009 -0400 @@ -23,7 +23,7 @@ from galaxy.util.docutils_ext.htmlfrag import Writer as HTMLFragWriter pkg_resources.require( 'elementtree' ) -from elementtree import ElementTree +from elementtree import ElementTree, ElementInclude pkg_resources.require( "wchartype" ) import wchartype @@ -87,7 +87,7 @@ def unique_id(KEY_SIZE=128): """ - Genenerates a unique ids + Generates an unique id >>> ids = [ unique_id() for i in range(1000) ] >>> len(set(ids)) @@ -97,8 +97,10 @@ return md5(id).hexdigest() def parse_xml(fname): - """Returns an parsed xml tree""" + """Returns a parsed xml tree""" tree = ElementTree.parse(fname) + root = tree.getroot() + ElementInclude.include(root) return tree def xml_to_string(elem): @@ -152,7 +154,7 @@ class Params: """ Stores and 'sanitizes' parameters. Alphanumeric characters and the - non-alpahnumeric ones that are deemed safe are let to pass through (see L{valid_chars}). + non-alphanumeric ones that are deemed safe are let to pass through (see L{valid_chars}). Some non-safe characters are escaped to safe forms for example C{>} becomes C{__lt__} (see L{mapped_chars}). All other characters are replaced with C{X}.