[python-ldap] python-ldap improvements: attribute conversion
flo at chaoflow.net
Thu Apr 21 22:58:21 CEST 2011
Dear Vitaliy, dear Michael,
@Vitaliy: just found your mail on python-ldap "LDAP attribute syntaxes to python
data types conversion" from November , which sadly received no answer,
but triggered my memory.
@Michael: you write in the todo to check the mailing list archives with
respect to unicode and attribute values - I was unable to find
something, it would be great if you could provide pointers.
I imported python-ldap to github  because I prefer it and intend to
work (maybe with Vitaliy?) on patches. I do not intend to create a fork
of python-ldap on pypi, highly value your work on python-ldap and want
to help. Apart from attribute conversion, I am interest in more
sophisticated reconnect management, which was also mentioned recently on
the mailing list. I also work on bda.ldap/node.ext.ldap and would rather
see corresponding functionality implemented properly in python-ldap or
some dedicated addon, instead of every higher level ldap library
reinventing the same cornered wheel.
For me it looks like the attribute conversions could be handled by
subclassing and overwriting _ldap_call , in pseudo-code:
def _ldap_call(self, func, *args, **kwargs):
args = deep_utf8_copy(args)
kwargs = deep_utf8_copy(kwargs)
res = super(...)...
if not self.convmap:
return check_for_things_to_convert(res, self.convmap)
or more selectively in the affected methods.
Attribute conversion maps could be generated from automatically parsing
an ldap's schemas (if supported) or be provided by the user.
There are more details to be taken care of, Vitaliy gave this already
some thought in code contributed to higher level libraries. But before
putting more effort in here, I'd like to know whether we are fully of
track, or whether the general approach would be suitable for inclusion
Florian Friesdorf <flo at chaoflow.net>
GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 835 bytes
Desc: not available
More information about the python-ldap