E&S CVS Commit: PEAK - Added 'whenImported(modulename,hookFunc)' API. This should be useful for

pje at eby-sarna.com pje at eby-sarna.com
Wed Apr 16 18:11:00 EDT 2003


Module Name:	PEAK
Committed By:	pje
Date:		Wed Apr 16 22:10:31 UTC 2003

Modified Files:
	PEAK/src/peak/config: modules.py
	PEAK/src/peak/util: imports.py

Log Message:
Added 'whenImported(modulename,hookFunc)' API.  This should be useful for
setting up lazily-activated initializers for third-party packages such as
Zope, Twisted, and the Python 'logging' package.  Meanwhile, it helped
clean up the kludgy "reloader" mechanism I had in there to make
'declareModule()' work.  'declareModule()' now just sets up a hook via the
'whenImported' mechanism to work its magic, instead of using a custom
reloader.  Custom reloaders for lazy modules are now in fact disallowed;
the new mechanism is more flexible and usable by multiple callers.  Errors
are also now more standardized: 'AlreadyRead' is used whenever the issue
is that something has already been read/imported.


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/config/modules.py.diff?r1=1.13&r2=1.14
http://cvs.eby-sarna.com/PEAK/src/peak/util/imports.py.diff?r1=1.7&r2=1.8

To generate a diff of this commit:
cvs rdiff -r1.13 -r1.14 PEAK/src/peak/config/modules.py
cvs rdiff -r1.7 -r1.8 PEAK/src/peak/util/imports.py

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