Re: LDAP/LDIF Parsing

2007-02-05 Thread Michael Ströder
Bruno Desthuilliers wrote: > > If you know which attributes are supposed to be multivalued in your > specific application, then it's time to write a more serious, > application-specific wrapper. ldap.schema can be used to find that out. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/

Re: LDAP/LDIF Parsing

2007-02-03 Thread Bruno Desthuilliers
Hallvard B Furuseth a écrit : > Bruno Desthuilliers writes: > >>Hallvard B Furuseth a écrit : >> else: # all LDAP attribs are multivalued by default, # even when the schema says they are monovalued if len(data) == 1: return data[0]

Re: LDAP/LDIF Parsing

2007-02-02 Thread Hallvard B Furuseth
Bruno Desthuilliers writes: >Hallvard B Furuseth a écrit : >>> else: >>># all LDAP attribs are multivalued by default, >>># even when the schema says they are monovalued >>>if len(data) == 1: >>> return data[0] >>>else: >>> return data[:] >>

Re: LDAP/LDIF Parsing

2007-02-02 Thread Michael Ströder
Cruelemort wrote: > I was wondering the best way to do this? I have installed and used the > python-ldap libraries and these allow me to access and search the > server, but the searches always return a horrible nesting of lists, > tuples and dictionaries, below is an example of returning just one >

Re: LDAP/LDIF Parsing

2007-02-02 Thread Bruno Desthuilliers
Hallvard B Furuseth a écrit : > Bruno Desthuilliers writes: >> class LdapObject(object): >>(...) >>def __getattr__(self, name): >> try: >>data = self._record[name] >> except KeyError: >>raise AttributeError( >> "object %s has no attribute %s" % (self, name

Re: LDAP/LDIF Parsing

2007-02-02 Thread Hallvard B Furuseth
Bruno Desthuilliers writes: > class LdapObject(object): >(...) >def __getattr__(self, name): > try: >data = self._record[name] > except KeyError: >raise AttributeError( > "object %s has no attribute %s" % (self, name) > ) Note that LDAP attribute

Re: LDAP/LDIF Parsing

2007-02-02 Thread Cruelemort
On Feb 1, 11:08 pm, "aspineux" <[EMAIL PROTECTED]> wrote: > The tree hierarchy is defined by the DN of each object, the types of > the object is specified by its objectClass. > Just collect all items (or do it dynamically by tunning the scope and > the base of your search request) > > On 1 fév, 18:

Re: LDAP/LDIF Parsing

2007-02-01 Thread aspineux
The tree hierarchy is defined by the DN of each object, the types of the object is specified by its objectClass. Just collect all items (or do it dynamically by tunning the scope and the base of your search request) On 1 fév, 18:22, "Cruelemort" <[EMAIL PROTECTED]> wrote: > All, > > I am hoping

Re: LDAP/LDIF Parsing

2007-02-01 Thread Bruno Desthuilliers
Cruelemort a écrit : > All, > > I am hoping someone would be able to help me with a problem. I have an > LDAP server running on a linux box, this LDAP server contains a > telephone list in various groupings, the ldif file of which is - > (snip) > > I am creating a python client program that will

Re: LDAP/LDIF Parsing

2007-02-01 Thread Diez B. Roggisch
> > I was wondering the best way to do this? I have installed and used the > python-ldap libraries and these allow me to access and search the > server, but the searches always return a horrible nesting of lists, > tuples and dictionaries, below is an example of returning just one > record - > >

LDAP/LDIF Parsing

2007-02-01 Thread Cruelemort
All, I am hoping someone would be able to help me with a problem. I have an LDAP server running on a linux box, this LDAP server contains a telephone list in various groupings, the ldif file of which is - dn: dc=example,dc=com objectClass: top objectClass: dcObject objectClass: organization dc: e