E&S CVS Commit: PEAK - PropertyName -> peak.api; Improved lazy import facility

pje at eby-sarna.com pje at eby-sarna.com
Sun Nov 10 15:08:00 EST 2002


Module Name:	PEAK
Committed By:	pje
Date:		Sun Nov 10 20:07:30 UTC 2002

Modified Files:
	PEAK: TODO.txt
	PEAK/src/peak/api: __init__.py
	PEAK/src/peak/binding: components.py
	PEAK/src/peak/config: api_impl.py config_components.py interfaces.py
	PEAK/src/peak/naming: contexts.py names.py properties.py
	PEAK/src/peak/running: api.py clusters.py logs.py
	PEAK/src/peak/storage: SQL.py
	PEAK/src/peak/util: imports.py

Log Message:
PropertyName -> peak.api; Improved lazy import facility

* naming.PropertyName is now simply PropertyName; it never really had much
  to do with naming in the first place, doesn't depend on anything else,
  and needs to be accessible in all major subpackages and in end-user API
  calls.  So now it's in-line in the peak.api module.

* Added a 'lazyModule(moduleName)' function to peak.util.imports.  This
  new "next generation" way of creating a lazily-loaded module actually
  creates an object that *will be* the real module in sys.modules, and once
  loaded will be indistinguishable from an ordinary Python module.  (Well,
  under Python 2.3 the type() will be different, but you can't have
  everything.)  I was getting really fed up of tracing into
  lazyImport.__getattr__ during debugging sessions, so I was inspired to
  come up with something that would only have code overhead when it's first
  touched.  Subclassing ModuleType, adding a __getattribute__ method, and
  clever use of the Python 'reload()' function saved the day.

* This now completes all the non-documentation items I want for 0.5a1,
  although I may "work ahead" a little on the features list, especially if
  Ty keeps pressing for SQL type maps and LDAP schemas.  ;)  (In truth, I'd
  like those and some of the other database features Real Soon Now myself.)


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/TODO.txt.diff?r1=1.25&r2=1.26
http://cvs.eby-sarna.com/PEAK/src/peak/api/__init__.py.diff?r1=1.18&r2=1.19
http://cvs.eby-sarna.com/PEAK/src/peak/binding/components.py.diff?r1=1.59&r2=1.60
http://cvs.eby-sarna.com/PEAK/src/peak/config/api_impl.py.diff?r1=1.11&r2=1.12
http://cvs.eby-sarna.com/PEAK/src/peak/config/config_components.py.diff?r1=1.25&r2=1.26
http://cvs.eby-sarna.com/PEAK/src/peak/config/interfaces.py.diff?r1=1.16&r2=1.17
http://cvs.eby-sarna.com/PEAK/src/peak/naming/contexts.py.diff?r1=1.30&r2=1.31
http://cvs.eby-sarna.com/PEAK/src/peak/naming/names.py.diff?r1=1.32&r2=1.33
http://cvs.eby-sarna.com/PEAK/src/peak/naming/properties.py.diff?r1=1.5&r2=1.6
http://cvs.eby-sarna.com/PEAK/src/peak/running/api.py.diff?r1=1.5&r2=1.6
http://cvs.eby-sarna.com/PEAK/src/peak/running/clusters.py.diff?r1=1.7&r2=1.8
http://cvs.eby-sarna.com/PEAK/src/peak/running/logs.py.diff?r1=1.2&r2=1.3
http://cvs.eby-sarna.com/PEAK/src/peak/storage/SQL.py.diff?r1=1.19&r2=1.20
http://cvs.eby-sarna.com/PEAK/src/peak/util/imports.py.diff?r1=1.1&r2=1.2

To generate a diff of this commit:
cvs rdiff -r1.25 -r1.26 PEAK/TODO.txt
cvs rdiff -r1.18 -r1.19 PEAK/src/peak/api/__init__.py
cvs rdiff -r1.59 -r1.60 PEAK/src/peak/binding/components.py
cvs rdiff -r1.11 -r1.12 PEAK/src/peak/config/api_impl.py
cvs rdiff -r1.25 -r1.26 PEAK/src/peak/config/config_components.py
cvs rdiff -r1.16 -r1.17 PEAK/src/peak/config/interfaces.py
cvs rdiff -r1.30 -r1.31 PEAK/src/peak/naming/contexts.py
cvs rdiff -r1.32 -r1.33 PEAK/src/peak/naming/names.py
cvs rdiff -r1.5 -r1.6 PEAK/src/peak/naming/properties.py
cvs rdiff -r1.5 -r1.6 PEAK/src/peak/running/api.py
cvs rdiff -r1.7 -r1.8 PEAK/src/peak/running/clusters.py
cvs rdiff -r1.2 -r1.3 PEAK/src/peak/running/logs.py
cvs rdiff -r1.19 -r1.20 PEAK/src/peak/storage/SQL.py
cvs rdiff -r1.1 -r1.2 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