E&S CVS Commit: PEAK - Extensible cursor formatter support

tsarna at eby-sarna.com tsarna at eby-sarna.com
Thu Dec 25 10:47:00 EST 2003

Module Name:	PEAK
Committed By:	tsarna
Date:		Thu Dec 25 15:46:41 UTC 2003

Modified Files:
	PEAK/src/peak: peak.ini
	PEAK/src/peak/storage: connections.py interfaces.py
Added Files:
	PEAK/src/peak/storage: cursor_formatters.py

Log Message:
Extensible cursor formatter support

Make the various cursor output formats defined by n2 generally
available, and make it possible to configure new ones.

It is now possible to call getFormatter(NAME, ...) on a cursor and get
an CursorFormatter (factory looked up in peak.cursor.formatters.NAME)
that is bound to it.  As they are very common, "header", "footer" (both
bool), and "delim" are available as keyword properties on all formatters
(and may be passed to getFormatter). They may be ignored by some
formatters. Other keyword args may be passed if you know the named
formatter accepts them, or you can set properties on the formatter that
it may bind to.

The resulting formatter may be called, passing a file-like object, to
format the cursor's data to the file.

For example, to export a subtree of LDAP in a LDIF file:

ldapcon = root.lookupComponent('ldap://...')
curs = ldapcon('o=fooblycorp', ldap.SCOPE_SUBTREE)

To view diffs of this commit, you can use the following URL(s):

To generate a diff of this commit:
cvs rdiff -r1.105 -r1.106 PEAK/src/peak/peak.ini
cvs rdiff -r1.22 -r1.23 PEAK/src/peak/storage/connections.py
cvs rdiff -r0 -r1.1 PEAK/src/peak/storage/cursor_formatters.py
cvs rdiff -r1.34 -r1.35 PEAK/src/peak/storage/interfaces.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