_narval/checkers/__init__.py
author David Douard <david.douard@logilab.fr>
Wed, 14 May 2014 23:10:57 +0200
changeset 1521 2f7557eabc54
parent 1515 2a12802efe66
permissions -rw-r--r--
[pkg] prepare 3.0.0 - ensure MANIFEST.in is correct - add entry in the debian/changelog

# make it work in 'dev' mode: look for checkers in known cubes

try:
    import narvalbot
except:
    from cubes.narval import narvalbot
    import sys
    sys.modules['narvalbot'] = narvalbot

if narvalbot.MODE == 'dev':
    # we are running from sources, cubicweb *should* be available,
    # let's use it as starting point to look for cubes in which there
    # is a _narval directory
    import os, os.path as osp
    from cubicweb import CW_SOFTWARE_ROOT
    cubesdir = osp.join(CW_SOFTWARE_ROOT, '..', 'cubes')
    for cube in os.listdir(cubesdir):
        pluginsdir = osp.abspath(osp.join(cubesdir, cube, '_narval', 'checkers'))
        if osp.isdir(pluginsdir):
            __path__.append(pluginsdir)