libhtml: add indent=None option and reference in docstring to wiki page

svn: r12648
This commit is contained in:
Gerald Britton
2009-06-10 14:14:11 +00:00
parent e4de221227
commit 75a7e04c4b

View File

@ -245,7 +245,7 @@ class Html(list):
@type indent: boolean @type indent: boolean
@param indent: True ==> indent this object with respect to its parent @param indent: True ==> indent this object with respect to its parent
False ==> do not indent this object False ==> do not indent this object
Defauls to False Defaults to False
@type inline: boolean @type inline: boolean
@param inline: True ==> instructs the write() method to output this @param inline: True ==> instructs the write() method to output this
object and any child objects as a single string object and any child objects as a single string
@ -264,6 +264,9 @@ class Html(list):
attributes attributes
@rtype: object reference @rtype: object reference
@return: reference to the newly-created Html instance @return: reference to the newly-created Html instance
For full usage of the Html class with examples, please see the wiki
page at: http://www.gramps-project.org/wiki/index.php?title=Libhtml
""" """
super(Html, self).__init__([]) # instantiate object super(Html, self).__init__([]) # instantiate object
attr, indent, close, inline = '', True, True, False attr, indent, close, inline = '', True, True, False
@ -398,7 +401,9 @@ class Html(list):
@type tabs: string @type tabs: string
@oaram tabs: starting indentation @oaram tabs: starting indentation
""" """
if self.indent: if self.indent is None:
tabs = ''
elif self.indent:
tabs += indent tabs += indent
if self.inline: # if inline, write all list and if self.inline: # if inline, write all list and
method('%s%s' % (tabs, self)) # nested list elements method('%s%s' % (tabs, self)) # nested list elements