def __init__(self, markup='xhtml', **options): Context.__init__(self) if markup == 'html': self.xml = False elif markup in ('xhtml', 'xml'): self.xml = True else: raise TypeError("Unknown markup type %r" % markup) self._tags = defaultdict(list) self._frames[-1].update(_default_options) self.push() self.update(options)
def __init__(self, markup='xhtml', **options): Context.__init__(self) if markup == 'html': self.xml = False elif markup in ('xhtml', 'xml'): self.xml = True else: raise TypeError("Unknown markup type %r" % markup) self._tags = defaultdict(list) self._frames[-1].update(_default_options) self.push() self.update(options)
def __init__(self, markup='xhtml', **settings): """Create a generator. Accepts any :ref:`markupsettings`, as well as the following: :param markup: tag output style: 'xml', 'xhtml' or 'html' :param ordered_attributes: if True (default), output markup attributes in a predictable order. Useful for tests and generally a little more pleasant to read. """ Context.__init__(self) if markup == 'html': self.xml = False elif markup in ('xhtml', 'xml'): self.xml = True else: raise TypeError("Unknown markup type %r" % markup) self._tags = defaultdict(list) self._frames[-1].update(_default_settings) self.push() self.update(settings)
def __init__(self, markup='xhtml', **settings): """Create a generator. Accepts any :ref:`markupsettings`, as well as the following: :param markup: tag output style: 'xml', 'xhtml' or 'html' :param ordered_attributes: if True (default), output markup attributes in a predictable order. Useful for tests and generally a little more pleasant to read. """ Context.__init__(self) if markup == 'html': self.xml = False elif markup in ('xhtml', 'xml'): self.xml = True else: raise TypeError("Unknown markup type %r" % markup) self._tags = defaultdict(list) self._frames[-1].update(_default_settings) self.push() self.update(settings)