UndefinedError: 'subnavigation' is undefined

Udo Spallek avatarUdo Spallek created an issue
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
    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
    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.