summaryrefslogtreecommitdiff
path: root/addons/plugin_thunderbird/static/thunderbird_plugin/makefile
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2012-01-18 11:45:05 +0100
committerVo Minh Thu <vmt@openerp.com>2012-01-18 11:45:05 +0100
commit14acff6cc493e75e53e38cf12a8619dbe7e76716 (patch)
tree941fe218bcaac16d3573c840b65ce236e41943d5 /addons/plugin_thunderbird/static/thunderbird_plugin/makefile
parent7e18a0c31d526e6bf42ed08ebd8a34aa3ca22a76 (diff)
parent0ed4377cf84eb9f9c8176781daf3811a2e968c7a (diff)
[MERGE] use an import hook instead of appending to sys.path.
This replaces sys.path mutation with an import hook. It removes the clash between our own 'resource' addons and the standard Python resource module. It provides a transition between our current practice and a cleaner 'openerp.addons' namespace. The import hook makes it possible to either 'import openerp.addons.hr' or 'import hr' in the addons (ie. both paths are set in sys.modules). When trying to import an already existing (non-openerp) Python module (e.g. resource), it will indeed load the Python module and print a warning (to invite you to use openerp.addons.resource if this is the one you want). Unfortunately, the import hook doesn't support self-referential imports. E.g. hr.wizard.xxx can't use 'import hr.yyy' or 'from hr import yyy'. Python will fail to load hr with cryptic error messages or even a segmentation fault. Beginning with this patch, 'import openerp.addons.xxx' is the way to go, 'import xxx' is deprecated. Once 'import xxx' support can be removed, we will probably support pkgutil or setuptool namespaces. bzr revid: vmt@openerp.com-20120118104505-tns626ga47dwl7it
Diffstat (limited to 'addons/plugin_thunderbird/static/thunderbird_plugin/makefile')
0 files changed, 0 insertions, 0 deletions