Autodoc 'sa_engine' problem

zabsko avatarzabsko created an issue

While using autodoc extension I get this:

/home/zaba/zosia/zosia/public/docs/test.rst:17: (WARNING/2) autodoc can't import/find module 'controllers.obiekty', it reported error: "'NoneType' object has no attribute 'sa_engine'", please check your spelling and sys.path

In I have: sys.path.append(os.path.abspath('../../'))

Changing this value doesn't help at all.

Comments (4)

  1. zabsko

    It looks like a pydoc problem:

    zaba@SRW001:/zosia/zosia/controllers$ pydoc modules

    Please wait a moment while I gather a list of all available modules...

    Traceback (most recent call last): File "/usr/bin/pydoc", line 5, in <module> pydoc.cli() File "/usr/lib/python2.5/", line 2225, in cli File "/usr/lib/python2.5/", line 1683, in help elif request == 'modules': self.listmodules() File "/usr/lib/python2.5/", line 1804, in listmodules ModuleScanner().run(callback) File "/usr/lib/python2.5/", line 1855, in run for importer, modname, ispkg in pkgutil.walk_packages(): File "/usr/lib/python2.5/", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "/usr/lib/python2.5/", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "/usr/lib/python2.5/", line 110, in walk_packages import(name) File "/home/zaba/zosia/zosia/lib/raportlib/", line 5, in <module> from stat_zesp_uproszczony import * File "/home/zaba/zosia/zosia/lib/raportlib/", line 6, in <module> from zosia.lib.rapfl import draw_pie, draw_bar3d_statzespupr File "/home/zaba/zosia/zosia/lib/", line 4, in <module> from zosia.lib.base import * File "/home/zaba/zosia/zosia/lib/", line 14, in <module> import zosia.model as model File "/home/zaba/zosia/zosia/model/", line 15, in <module> bind=config['pylons.g'].sa_engine)) AttributeError: 'NoneType' object has no attribute 'sa_engine'

  2. zabsko

    Problems seems to be resolved by changing:

    Session = scoped_session(sessionmaker(autoflush=True, transactional=True, bind=econfig['pylons.g'].sa_engine))


    engine = config['pylons.g'].sa_engine if config['pylons.g'] else None

    Session = scoped_session(sessionmaker(autoflush=True, transactional=True, bind=engine))

  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
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.