# HG changeset patch # User casties # Date 1349108249 -7200 # Node ID ab58edfc07077dc10f4a28fc002c0f78bb3352ac # Parent 1cb439acd1e1eb64bb39263955567344db446a96 more parameters and more comments. diff -r 1cb439acd1e1 -r ab58edfc0707 MetaData.py --- a/MetaData.py Tue Sep 25 15:57:35 2012 +0200 +++ b/MetaData.py Mon Oct 01 18:17:29 2012 +0200 @@ -158,7 +158,7 @@ @param dom: dom of metadata @param normalizeNames: normalize tag names @param all: put contents of tags with the same name in list value - @param recurse: number of recursions. 0=just children + @param recursive: number of recursions. 0=just children @param allText: get text content of all subelements @returns: dict with attributes (key=@attr) and child elements (key=tag) """ diff -r 1cb439acd1e1 -r ab58edfc0707 MetaDataFolder.py --- a/MetaDataFolder.py Tue Sep 25 15:57:35 2012 +0200 +++ b/MetaDataFolder.py Mon Oct 01 18:17:29 2012 +0200 @@ -93,7 +93,16 @@ return obj def getXmlPathData(self, xmlpath, path=None, dom=None, recursive=0, all=False, allText=False): - """returns contents of element at xmlpath as dict""" + """returns contents of element at xmlpath as dict. + + @param xmlpath: xml path to selected elements + @param path: file or url path to metadata file + @param dom: dom of metadata + @param all: put contents of tags with the same name in list value + @param recursive: number of recursions. 0=just children + @param allText: get text content of all subelements + @returns: dict with attributes (key=@attr) and child elements (key=tag) + """ logging.error("getXmlPathData(%s)"%xmlpath) mdObj = self.getXmlPathObj(xmlpath) if mdObj is not None: @@ -103,7 +112,17 @@ return None def getXmlPathFormatted(self, xmlpath, template, path=None, dom=None, data=None, allFields=False, recursive=0, all=False, allText=False): - """returns contents of element at xmlpath as dict""" + """returns contents of element at xmlpath as dict + + @param xmlpath: xml path to selected elements + @param template: name of template for data + @param path: file or url path to metadata file + @param dom: dom of metadata + @param all: put contents of tags with the same name in list value + @param recursive: number of recursions. 0=just children + @param allText: get text content of all subelements + @returns: dict with attributes (key=@attr) and child elements (key=tag) + """ logging.error("getXmlPathFormatted(xmlpath=%s, template=%s)"%(xmlpath,template)) mdObj = self.getXmlPathObj(xmlpath) if mdObj is not None: @@ -133,9 +152,9 @@ """returns contents of resource tag as dict""" return self.getXmlPathData('resource', path=path, dom=dom) - def getTexttoolData(self, path=None, dom=None): + def getTexttoolData(self, path=None, dom=None, recursive=0, all=False): """returns contents of texttool tag as dict""" - return self.getXmlPathData('resource/meta/texttool', path=path, dom=dom) + return self.getXmlPathData('resource/meta/texttool', path=path, dom=dom, recursive=recursive, all=all) def getAccessData(self, path=None, dom=None): """returns contents of access tag as dict"""