1. grasbauer
  2. tryton-sphinx
Issue #1 new

UndefinedError: 'subnavigation' is undefined

Udo Spallek
created an issue

{{{

!python

make html sphinx-build -b html -d _build/doctrees . _build/html Running Sphinx v1.1.3 loading pickled environment... done building [html]: targets for 2 source files that are out of date updating environment: 0 added, 0 changed, 0 removed looking for now-outdated files... none found preparing documents... done writing output... [ 50%] index
Exception occurred: File "/home/uspallek/fab_venv/workon/trytonsphinx/local/lib/python2.7/site-packages/jinja2/sandbox.py", line 323, in getattr value = getattr(obj, attribute) UndefinedError: 'subnavigation' is undefined The full traceback has been saved in /tmp/sphinx-err-iOnt2w.log, if you want to report the issue to the developers. Please also report this if it was a user error, so that a better error message can be provided next time. Either send bugs to the mailing list at http://groups.google.com/group/sphinx-dev/, or report them in the tracker at http://bitbucket.org/birkenfeld/sphinx/issues/. Thanks! make: *** [html] Error 1 }}}

Comments (4)

  1. Udo Spallek reporter
    sphinx-build -b tryton  . _build/html
    Running Sphinx v1.1.3
    loading pickled environment... done
    building [tryton]: targets for 2 source files that are out of date
    updating environment: 0 added, 0 changed, 0 removed
    looking for now-outdated files... none found
    preparing documents... 
    Exception occurred:
      File "/home/uspallek/fab_venv/project/trytonsphinx/tryton-sphinx/sphinxext/mainnavigation.py", line 35, in prepare_writing
        doctree = self.env.get_toc_for(toc_name)
    TypeError: get_toc_for() takes exactly 3 arguments (2 given)
    The full traceback has been saved in /tmp/sphinx-err-KoHRTV.log, if you want to report the issue to the developers.
    Please also report this if it was a user error, so that a better error message can be provided next time.
    Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
    or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
    
  2. Udo Spallek reporter
    diff --git a/sphinxext/mainnavigation.py b/sphinxext/mainnavigation.py
    --- a/sphinxext/mainnavigation.py
    +++ b/sphinxext/mainnavigation.py
    @@ -27,16 +27,16 @@ class TrytonBuilder(StandaloneHTMLBuilde
                   if not rec(n):
                      return n
                   elif rec(n) != n:
                      n = recursive_hell(rec(n))  
                   return n
            
            for docname in docnames:
               toc_name = recursive_hell(docname) or docname
    -          doctree = self.env.get_toc_for(toc_name) 
    +          doctree = self.env.get_toc_for(toc_name, self) 
               for toctreenode in doctree.traverse(addnodes.toctree):
                  toc = self.env.resolve_toctree(docname, self, toctreenode) 
                  local_toc[docname]=self.render_partial(toc)['fragment']
            self.globalcontext['subnavigation'] = local_toc
     
     def setup(app):
        app.add_builder(TrytonBuilder)
    
    
  3. Log in to comment