Commit adc18892 authored by Arnaud Fontaine's avatar Arnaud Fontaine

A Dynamic Module may create modules as well, thus set the new module

name relative to the dynamic module name


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43885 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ffd19add
......@@ -21,6 +21,11 @@ class DynamicModule(ModuleType):
if isinstance(obj, type):
# if it's a class we want to set __module__
obj.__module__ = self.__name__
elif isinstance(obj, ModuleType):
# if it's a module we want to set the name according to the
# module it's being added to
obj.__name__ = "%s.%s" % (self.__name__, name)
setattr(self, name, obj)
return obj
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment