#96 hthtml writer "has no attribute 'initial_header_level'"

add-ons (4)

When I try to use the hthtml writer I get the following traceback:

Traceback (most recent call last):
File "ht.py", line 4, in <module>
publish_cmdline(writer_name='hthtml', description=description)
File "/usr/lib/python2.5/site-packages/docutils/core.py", line 335, in publish_cmdline
config_section=config_section, enable_exit_status=enable_exit_status)
File "/usr/lib/python2.5/site-packages/docutils/core.py", line 206, in publish
output = self.writer.write(self.document, self.destination)
File "/usr/lib/python2.5/site-packages/docutils/writers/__init__.py", line 78, in write
File "/usr/lib/python2.5/site-packages/docutils/writers/hthtml.py", line 77, in translate
visitor = self.translator_class(self.document)
File "/usr/lib/python2.5/site-packages/docutils/writers/hthtml.py", line 96, in __init__
HTMLTranslator.__init__(self, document)
File "/usr/lib/python2.5/site-packages/docutils/writers/html4css1/__init__.py", line 251, in __init__
self.initial_header_level = int(settings.initial_header_level)
AttributeError: Values instance has no attribute 'initial_header_level'

I have the following simple wrapper:

#!/usr/bin/env python
from docutils.core import publish_cmdline
description = ('Generates .ht from .txt')
publish_cmdline(writer_name='hthtml', description=description)

I am using the following:

$ python -V
Python 2.5.1

$ python ht.py -V
ht.py (Docutils 0.4.1 [repository])

I tried adding the initial_header_level to HTTranslator.__init__, but then I simply had a new traceback about the stylesheet. I then commented out the stylesheet code in HTTranslator.__init__ and received a new traceback about cloak_email_addresses (AttributeError: Values instance has no attribute 'cloak_email_addresses'). At that point, I figured if I did any more I might end up rewriting the thing. I don't want to do that as I realise there's a chance I might simply be using it incorrectly.


  • engelbert gruber

    Logged In: YES
    Originator: NO

    and why cant you use


  • Günter Milde

    Günter Milde - 2009-09-03
    • labels: --> add-ons
  • Günter Milde

    Günter Milde - 2009-09-07
    • priority: 5 --> 3
    • milestone: --> sandbox
  • Günter Milde

    Günter Milde - 2009-09-11
    • priority: 3 --> 2
  • engelbert gruber

    • assigned_to: nobody --> grubert
  • engelbert gruber

    no longer reproducableh

  • engelbert gruber

    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks