changeset 31:ab58edfc0707

more parameters and more comments.
author casties
date Mon, 01 Oct 2012 18:17:29 +0200
parents 1cb439acd1e1
children a0a147409f67
files MetaData.py MetaDataFolder.py
diffstat 2 files changed, 24 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)
         """
--- 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"""