about recursive load

alex23 wuwei23 at gmail.com
Fri Oct 31 02:58:18 EDT 2008


On Fri, Oct 31, 2008 at 3:50 PM, Abah Joseph <joefazee at gmail.com>
wrote:
> what will module_name looks like?. i mean the new loaded
> module. i am very new to this also. thank you.

I'm not sure if I'm following what you want... I thought you were
asking for a way to load modules containing configuration information
into a single object, in order to be able to refer to them all through
one instance:

> settings.load_config("project.test.app")
> settings.load_config("project.test.*")
> settings.load_config("project.test")
> settings.load_config("*")
>
> this allows me to load them as:
>
> settings.project.CONFIG_PARAMETER_1      # project configuration
> settings.project.test.CONFIG_PARAMETER_1 # sub project

Is that correct?

If so, in my example 'module_name' will be arguments like
"project.test.app", which the load_config module imports and then
injects into its attribute dictionary, to allow for dot notation
lookups...

If you're after something different, could you try explaining it
another way?

(You should also reply to the group/mailing list rather than to me
personally, it increases the potential sources of help...)



More information about the Python-list mailing list