Sorry to follow up myself, I've finally used the execfile approach,
passing an empty dict for capturing locals and then just processing it:

new_settings = {}
execfile(self.SETTINGS_MODULE, new_settings) # returns its locals in
new_settings

# assign UPPER_CASE vars
for setting in new_settings.keys():
    setting_value = new_settings[setting] # do what you want with the
vars

It looks like a better solution than polluting the namespace and allows
to use any file as a config file withou the need to have it on
sys.path.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to