E&S CVS Commit: PEAK - Added a '__main__.*' namespace, which is loaded from the __main__ (startup)

pje at eby-sarna.com pje at eby-sarna.com
Tue Nov 5 20:46:00 EST 2002


Module Name:	PEAK
Committed By:	pje
Date:		Wed Nov  6 01:45:12 UTC 2002

Modified Files:
	PEAK/src/peak: peak.ini

Log Message:
Added a '__main__.*' namespace, which is loaded from the __main__ (startup)
module, and which has automatic fallback to the 'environ.*' namespace for
anything not defined in the __main__ module.  We now load a file specified
by __main__.PEAK_CONFIG, which means that a script can simply specify
PEAK_CONFIG as a global variable, and override the environment.  Combined
with the other changes, this means that you could do something like this:

PEAK_CONFIG = config.fileNearModule('myLocalModule','config.ini')

And that .ini file could then contain something like this:

[Load settings from]
file = config.getProperty('environ.PEAK_CONFIG',default=None)

To also load in the PEAK_CONFIG specified by the environment, if any.

I think this is now flexible enough for anybody, especially since I was
able to make this latest change without editing anything but peak.ini! :)


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/peak.ini.diff?r1=1.5&r2=1.6

To generate a diff of this commit:
cvs rdiff -r1.5 -r1.6 PEAK/src/peak/peak.ini

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list