[Twisted-Python] ldaptor feedback
Clark C. Evans
cce at clarkevans.com
Tue Jul 1 23:27:44 EDT 2003
Howdy. Thank you for your initial help with ldaptor; it looks like
I'll be spending alot of time on LDAP in the next few months.
1. I would like to see ldap in twisted proper, it is really a
core protocol (like imap, etc.). From what I heared there are
two arguments against, size and licensing.
As for size, I think that LDAP is so important that it really
belongs in twisted. It is at the same level as IMAP. I do not
want to have to go to an external module, hence LDAP is in-scope
so the size argument does not matter to me.
As for licensing, I understand your concerns. However, it is very
important for enforcement of copyright and for the ability to 'fix'
the license that a single entity have the ability to license the
and enforce the work as needed. Long term I'd like to see Glyph
form some sort of non-profit to hold the copyrights, or at the
very least present a 'will' of sorts describing what happens to
the copyrights in the event that he is incapacitated or gets
hit by a MAC truck. For now, I'm not too worried about this.
As for Glyph selling the software and making a profit... well,
as a bunch of individual packages this just is not an option at
all, so better someone than no one. But seriously, I trust that
Glyph will spread the wealth to those who have really contributed
to Twisted, perhaps by simply paying for Flights and Hotels for
Python/Twisted conference if he ever makes bank with the copyright.
In reality though, I think that this is a moot point; the most
important point is the ability to fix the copyright and pursue
violators... without copyright powers this is too hard.
So, Glyph approving, would you consider contributing ldaptor
2. Your package hierarchy needs help... lots of help.
Let's start with this example...
from ldaptor.protocols.ldap.ldapsyntax import LDAPJournalOperation_Replace
Arg! First, ldaptor has one protocol... ldap. So "protocols.ldap" is
quite redundant. Second, ldapsyntax is describing a ldap proxy
object with the ability to journal its changes and save. It has
nothing to do with "syntax" let alone "ldapsyntax", how about
'object' or 'proxy'?. Third, I count 3 occurances of LDAP... Uncle!
Fourth, the class name is *huge* and using prefixes this way sucks,
JournalOperations should be in a file called 'journal'. In short,
what I'd want to see...
from ldaptor import ldap
op = ldap.journal.Replace()
The 'low-level' pureber and pureldap are really not protocol
items so much as they are parsers/emitters. You could stuff
these, as well as the filter, ldif, and schema all into
another part of ldaptor, ldaptor.parse.ldif, etc.
Anyway, for ldaptor to be understandable it really needs a
refactor like this. Just look at your commands as to how
ugly the packaging is. Good packaging and naming takes quite
a bit of effort and thought.
3. I can help convert your public interfaces to use Deferreds, and I
can rewrite your examples to use flow (so that they are more
readable). In particular, I was playing with a flow version
of your ldap client and it makes things quite clean; to use
the client you have a generator which yield ldap commands...
If I'm to help, I'll need commit access and you can't be
completely opposed to me restructuring/commenting things as
I move along. If you need an example of my work, see flow.py
Anyway, I'm curious how open you are to these items. Adding this to
Twisted (with alot of work) is probably a good bargin; you get more
eyes helping your project along, documentation, etc.
More information about the Twisted-Python