SASL (part 3)

Michael Ströder michael at stroeder.com
Thu Mar 28 18:46:30 CET 2002


Hans Aschauer wrote:
 > On Wednesday, 27. March 2002 15:42, Michael Ströder wrote:
 >
 > Could someone please give me a hand with the distutil
 > stuff?

It's far less struggle to add a module to a DistUtils package than you
believe. Have a look at ext_modules and py_modules list in setup.py to get
the idea. I will happily extend setup.py.

 >>Make sure to place it in a different sub-module - at least the Python
 >>interface part for it.
 >
 > At the moment, I have no plans for an high-level python interface. What
 > I plan to do (and have paritally done) is a simple wrapper for the C
 > functions in ldap_schema (i.e. str2objectclass and friends).

You can provide very primitive C wrapper functions in module _ldap and leave
the Python parts up to me (applies to SASL and schema). I will start with
the SASL stuff this weekend and check in what I believe the Python parts
should look like.

 > Is it ok to just plug these wrappers into function.c?

Please go for a separate C source schema.c. The C code is already kludgy
enough. Maybe take template.c as a start.

 > Probably it would be necessary to plug this into the
 > Lib/ldap/functions.py mechanism, right?

I'd suggest to write a new Python wrapper class in a separate module
ldap.schema (Lib/ldap/schema.py). The class methods could also contain some
sanitizing (say Pythonizing ;-) which is more convenient to implement in
Python itself.

  > I am not really sure if the
  > underlying C functions are thread safe...

  From my knowledge about OpenLDAP I'm almost sure they're not. That's what
the module-wide thread lock is for.

Ciao, Michael.






More information about the python-ldap mailing list