5
This subpackage provides encapsulations and entry points for the application
8
* the ``session`` module features the supporting objects for "OpenERP scripts"
9
and the dedicated python interpreter.
10
* the ``start_openerp`` and ``test_openerp`` modules are the entry points for
11
the main startup scripts.
13
This architecture is meant in particular to provide stability and uniformity
14
accross OpenERP major versions, so that the recipe can be leveraged by
15
automated deploymnent tools and continuous integration systems.
18
_imported_addons = set()
21
def already_imported(module_name):
22
"""Convenience to help some OpenERP modules to avoid been imported twice.
24
Each call of this function returns a boolean indicated whether the
25
specified module was already in the ``imported_addons`` registry and add it
28
Thus caller code is expected to import the module right away if the
29
return value was False.
31
name = module_name.rsplit('.', 1)[-1]
32
if name in _imported_addons:
34
_imported_addons.add(name)
38
def clear_import_registry():
39
_imported_addons.clear()