[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ldap-dev
Subject:    Re: Own pure Python parser for LDAPv3 schema support
From:       Michael_Ströder <michael () stroeder ! com>
Date:       2002-08-14 16:47:26
[Download RAW message or body]

Jens Vagelpohl wrote:
 >> I hoped that someone bites the bullet and uses
 >> /usr/lib/python2.2/profile.py... ;-)
 >
 > hey, i told you i don't use python2.2 yet ;)

Hah, that's obviously no excuse... ;-)

 > i am noticing that the __init__ for ObjectClass, unlike all
 > others, does not just take the full schema_element_string, it
 > also takes all attributes as separate keyword arguments. that
 > seems a little redundant.

Python 2.2.1 (#2, May  4 2002, 19:50:26)
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import ldap.schema
 >>>
str(ldap.schema.ObjectClass(oid='1.23.456.78.0',names=['myClass','myClassAlias'],must=['myRequiredAttr1','myRequiredAttr2'],may=['myAllowed1']))
 "( 1.23.456.78.0 NAME ( 'myClass' 'myClassAlias' ) STRUCTURAL MUST
( myRequiredAttr1 $ myRequiredAttr2 ) MAY myAllowed1 )"
 >>>

Also works with Python 2.1.x! ;-)

Got the message? It's meant for automated schema element creation.
A schema editor comes to mind...

 > all other classes only take the schema_element_string and
 > extract the attributes from that.

Yes, they are not complete yet.

 > well, i would probably end up doing a widget that offers both a
 > dropdown and a text input field, maybe depending on errors
 > occurring during schema discovery.

Error handling is somewhat subtle.

Ciao, Michael.



-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Python-LDAP-dev mailing list
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic