Re: Python 3.x progress

Robin Becker <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
We always had a sort of local rl config, but it wasn't exactly documented. 
Inside rl_config there is code that does this

....
x='....value'
....


#### Normally don't need to edit below here ####
try:
	from local_rl_config import *
except:
	pass

.....

this allows fully overriding any of the x set in the start of rl_config, but not 
modifications thereof.

Is this not enough? If not how should we separate the settings from the code 
that resets re-registers etc etc.

One can imagine schemes like (pseudo code)

#rl_config.py

try:
     import local_rl_settings
except:
     import rl_settings
     _settings = get_settings_from(rl_settings)
else:
     import rl_settings
     _settings = get_settings_from(rl_settings)
     _settings.update(get_settings_from(local_rl_settings))

for k,v in _settings.items():
     globals()[k] = v

......
reset code etc etc

that would allow local_rl_settings to import rl_settings and modify values and 
keeps the defaults separate from the code. How one implements get_settings_from 
etc is to be discussed.
-- 
Robin Becker
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.