You can subscribe to this list here.
2000 |
Jan
|
Feb
(34) |
Mar
(9) |
Apr
|
May
(2) |
Jun
(14) |
Jul
(67) |
Aug
(34) |
Sep
(5) |
Oct
(20) |
Nov
(22) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(15) |
Feb
(16) |
Mar
(20) |
Apr
(13) |
May
(72) |
Jun
(42) |
Jul
(41) |
Aug
(11) |
Sep
(19) |
Oct
(67) |
Nov
(59) |
Dec
(57) |
2002 |
Jan
(74) |
Feb
(69) |
Mar
(34) |
Apr
(55) |
May
(47) |
Jun
(74) |
Jul
(116) |
Aug
(68) |
Sep
(25) |
Oct
(42) |
Nov
(28) |
Dec
(52) |
2003 |
Jan
(19) |
Feb
(18) |
Mar
(35) |
Apr
(49) |
May
(73) |
Jun
(39) |
Jul
(26) |
Aug
(59) |
Sep
(33) |
Oct
(56) |
Nov
(69) |
Dec
(137) |
2004 |
Jan
(276) |
Feb
(15) |
Mar
(18) |
Apr
(27) |
May
(25) |
Jun
(7) |
Jul
(13) |
Aug
(2) |
Sep
(2) |
Oct
(10) |
Nov
(27) |
Dec
(28) |
2005 |
Jan
(22) |
Feb
(25) |
Mar
(41) |
Apr
(17) |
May
(36) |
Jun
(13) |
Jul
(22) |
Aug
(12) |
Sep
(23) |
Oct
(6) |
Nov
(4) |
Dec
|
2006 |
Jan
(11) |
Feb
(3) |
Mar
(5) |
Apr
(22) |
May
(1) |
Jun
(10) |
Jul
(19) |
Aug
(7) |
Sep
(25) |
Oct
(23) |
Nov
(5) |
Dec
(27) |
2007 |
Jan
(25) |
Feb
(17) |
Mar
(44) |
Apr
(8) |
May
(33) |
Jun
(31) |
Jul
(42) |
Aug
(16) |
Sep
(12) |
Oct
(16) |
Nov
(23) |
Dec
(73) |
2008 |
Jan
(26) |
Feb
(6) |
Mar
(46) |
Apr
(17) |
May
(1) |
Jun
(44) |
Jul
(9) |
Aug
(34) |
Sep
(20) |
Oct
(2) |
Nov
(4) |
Dec
(16) |
2009 |
Jan
(14) |
Feb
(3) |
Mar
(45) |
Apr
(52) |
May
(34) |
Jun
(32) |
Jul
(24) |
Aug
(52) |
Sep
(22) |
Oct
(23) |
Nov
(19) |
Dec
(10) |
2010 |
Jan
(10) |
Feb
(13) |
Mar
(22) |
Apr
(9) |
May
(1) |
Jun
(1) |
Jul
(8) |
Aug
(9) |
Sep
(10) |
Oct
(1) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
|
Feb
(18) |
Mar
(39) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael S. <mi...@st...> - 2009-06-02 12:44:31
|
Marc Balmer wrote: > take a look at RFC 1779. A semicolon could be used as an > alternate delimiter and it shuld be possible to enclose strings > in quotes, i.e. like this: RFC 1779 was part of LDAPv2 standard which has been obsoleted for quite a while now. Today RFC 4514 is relevant for LDAPv3-based DSAs which does not allow semicolon as delimiter. Ciao, Michael. |
From: Marc B. <ma...@ms...> - 2009-06-02 11:47:56
|
Am 02.06.2009 um 13:13 schrieb Christoph Holtermann: > Hello ! > > Thanks for your reply and that of Marc Balmer. > But I still wonder if it is allowed by LDAP or LDIF- > Specification to have a comma in dn. I also tried it > with "" and Base64, some of which > openldap accepted. take a look at RFC 1779. A semicolon could be used as an alternate delimiter and it shuld be possible to enclose strings in quotes, i.e. like this: dn="Balmer, Marc",ou=research,dc=msys,dc=ch But I did not test if OpenLDAP "eats" this... ;) - Marc Balmer > > C. Holtermann > > Yves Dorfsman schrieb: >> >> Christoph Holtermann wrote: >> >> >>> I am working on a filter that makes Thunderbirds LDIF-Output >>> importable to OpenLDAP. It works quite fine except for names >>> that include ",". OpenLDAP dislikes the output that is produced >>> like : >>> >>> dn: cn=Lehmann\, Veronika,dc=Adressbuch,dc=christoph >>> >> >> Escaping characters is used by some LDAP servers, not all of them, >> but is >> not conform to LDIF. >> >> > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the > latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get_______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev |
From: Christoph H. <c.h...@gm...> - 2009-06-02 11:46:49
|
Hi ! >> >> Thanks for your reply and that of Marc Balmer. >> But I still wonder if it is allowed by LDAP or LDIF- >> Specification to have a comma in dn. I also tried it >> with "" and Base64, some of which >> openldap accepted. > > take a look at RFC 1779. A semicolon could be used as an > alternate delimiter and it shuld be possible to enclose strings > in quotes, i.e. like this: > > dn="Balmer, Marc",ou=research,dc=msys,dc=ch > > But I did not test if OpenLDAP "eats" this... ;) > > - Marc Balmer > I just fed it with dn: cn="Lehmann, Veronika",dc=Adressbuch,dc=christoph objectclass: top objectclass: person objectclass: inetOrgPerson objectclass: mozillaAbPersonAlpha sn: Lehmann cn: Lehmann, Veronika it works fine. But the Output of OpenLDAP, when I ldapsearch it is : > ldapsearch -x "(cn=*lehmann*)" # extended LDIF # # LDAPv3 # base <dc=christoph> (default) with scope subtree # filter: (cn=*lehmann*) # requesting: ALL # # Lehmann\2C Veronika, Adressbuch.christoph dn: cn=Lehmann\2C Veronika,dc=Adressbuch,dc=christoph objectClass: top objectClass: person objectClass: inetOrgPerson objectClass: mozillaAbPersonAlpha sn: Lehmann cn: Lehmann, Veronika And what I saw was : escape-codes. And I just have been told, that it's not LDIF-conform ;-) probably they don't know ? So my goal now is to make my filter put entrys which contain commas in "". Does anyone know how to make Python-ldap do so ? C. Holtermann |
From: Christoph H. <c.h...@gm...> - 2009-06-02 11:16:25
|
Hello ! Thanks for your reply and that of Marc Balmer. But I still wonder if it is allowed by LDAP or LDIF- Specification to have a comma in dn. I also tried it with "" and Base64, some of which openldap accepted. C. Holtermann Yves Dorfsman schrieb: > Christoph Holtermann wrote: > > >> I am working on a filter that makes Thunderbirds LDIF-Output >> importable to OpenLDAP. It works quite fine except for names >> that include ",". OpenLDAP dislikes the output that is produced >> like : >> >> dn: cn=Lehmann\, Veronika,dc=Adressbuch,dc=christoph >> > > Escaping characters is used by some LDAP servers, not all of them, but is > not conform to LDIF. > > |
From: Mike L. <mi...@mo...> - 2009-06-01 16:01:53
|
Michael Ströder wrote: > Mike Lovell wrote: > >> Michael Ströder wrote: >> >>> I guess you're using python-ldap built against OpenLDAP 2.3 client libs. >>> With OpenLDAP 2.4 connection-specific TLS options should be supported. >>> >>> >>> >> I am using a machine with Ubuntu 9.04 which has the 2.4 OpenLDAP >> libraries. >> > > Please post the exact OpenLDAP version. > > Ciao, Michael. > hopefully this is enough info for you. mike@thor:~/Desktop$ dpkg -l python-ldap libldap* ii libldap-2.4-2 2.4.15-1ubuntu OpenLDAP libraries ii python-ldap 2.3.5-1ubuntu1 An LDAP interface module for Python mike@thor:~/Desktop$ ldd /usr/lib/python2.6/dist-packages/_ldap.so linux-vdso.so.1 => (0x00007fff5b1ff000) libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0x00007f8252b90000) liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0x00007f8252981000) libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00007f8252766000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f825254a000) libc.so.6 => /lib/libc.so.6 (0x00007f82521d8000) libdl.so.2 => /lib/libdl.so.2 (0x00007f8251fd3000) libresolv.so.2 => /lib/libresolv.so.2 (0x00007f8251dbb000) libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0x00007f8251b0e000) libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0x00007f82518fc000) libz.so.1 => /lib/libz.so.1 (0x00007f82516e4000) libgcrypt.so.11 => /lib/libgcrypt.so.11 (0x00007f825147d000) /lib64/ld-linux-x86-64.so.2 (0x00007f8253005000) libgpg-error.so.0 => /lib/libgpg-error.so.0 (0x00007f8251279000) |
From: Yves D. <yv...@zi...> - 2009-06-01 14:46:37
|
Christoph Holtermann wrote: > I am working on a filter that makes Thunderbirds LDIF-Output > importable to OpenLDAP. It works quite fine except for names > that include ",". OpenLDAP dislikes the output that is produced > like : > > dn: cn=Lehmann\, Veronika,dc=Adressbuch,dc=christoph Escaping characters is used by some LDAP servers, not all of them, but is not conform to LDIF. -- Yves. http://www.sollers.ca/ |
From: Christoph H. <c.h...@gm...> - 2009-06-01 12:51:58
|
Hello ! I am working on a filter that makes Thunderbirds LDIF-Output importable to OpenLDAP. It works quite fine except for names that include ",". OpenLDAP dislikes the output that is produced like : dn: cn=Lehmann\, Veronika,dc=Adressbuch,dc=christoph cn: Lehmann\, Veronika givenName: Lehmann, mail: inf...@un... objectClass: top objectClass: person objectClass: inetOrgPerson objectClass: mozillaAbPersonAlpha sn: Veronika I found out that an encoding like "\2C" is accepted, like : dn: cn=Lehmann\2C Veronika,dc=Adressbuch,dc=christoph cn: Lehmann, Veronika givenName: Lehmann, mail: inf...@un... objectClass: top objectClass: person objectClass: inetOrgPerson objectClass: mozillaAbPersonAlpha sn: Veronika Thunderbird exported the entry like this : dn: cn="Lehmann, Veronika",mail=inf...@un... objectclass: top objectclass: person objectclass: organizationalPerson objectclass: inetOrgPerson objectclass: mozillaAbPersonAlpha givenName: Lehmann, sn: Veronika cn: "Lehmann, Veronika" mail: inf...@un... modifytimestamp: 0Z This is about one of the last things that I have to change by hand. Maybe someone can help me with this encoding problem. The code that is about that problem looks like : basedn='dc=Adressbuch,dc=christoph' def fix_dn(self, dn): try: self.head=ldap.dn.explode_dn(dn)[0] for i in range(len(dn_warning)): if self.head.find(dn_warning[i])>-1: print "dn :",self.head, "contains '",dn_warning[i],"' - change manually !" return self.head + ',' + basedn except: if dn==None: print "No dn specified" return None regards, C. Holtermann |
From: Michael S. <mi...@st...> - 2009-05-28 22:03:53
|
Mike Lovell wrote: > Michael Ströder wrote: >> I guess you're using python-ldap built against OpenLDAP 2.3 client libs. >> With OpenLDAP 2.4 connection-specific TLS options should be supported. >> >> > I am using a machine with Ubuntu 9.04 which has the 2.4 OpenLDAP > libraries. Please post the exact OpenLDAP version. Ciao, Michael. |
From: Mike L. <mi...@mo...> - 2009-05-28 20:22:20
|
Michael Ströder wrote: > I guess you're using python-ldap built against OpenLDAP 2.3 client libs. > With OpenLDAP 2.4 connection-specific TLS options should be supported. > > I am using a machine with Ubuntu 9.04 which has the 2.4 OpenLDAP libraries. I double checked the package dependencies and did ldd on the _ldap.so file and both show it was compiled against the 2.4 libraries. I am using python-ldap 2.3.5. I don't know if a newer version is needed for this. But I am planning on several Debian Etch machines which were built against older OpenLDAP libraries so I should still plan for this behavior. Thanks for the help. mike |
From: Michael S. <mi...@st...> - 2009-05-28 20:04:11
|
Mike Lovell wrote: > First off, hello everyone. > I am working on some software that uses python-ldap that is trying to > connect to an ldaps server. If I do this sequence > > import ldap > ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, '/path/to/cert') > conn = ldap.initialize('ldaps://server') > conn.simple_bind_s('uid', 'pass') > > things work fine. But if I do it like this > > import ldap > conn = ldap.initialize('ldaps://server') > conn.set_option(ldap.OPT_X_TLS_CACERTFILE, '/path/to/cert') > conn.simple_bind_s('uid', 'pass') > > then I get an error saying that it can't contact the server. I am > guessing it just can't verify the server's ssl certificate and just > saying it can't contact the server. I guess you're using python-ldap built against OpenLDAP 2.3 client libs. With OpenLDAP 2.4 connection-specific TLS options should be supported. > Is this expected behavior? Is this a restriction of the underlying > openldap client libraries? Yupp. Version-specific. Ciao, Michael. |
From: Mike L. <mi...@mo...> - 2009-05-28 19:55:44
|
First off, hello everyone. I am working on some software that uses python-ldap that is trying to connect to an ldaps server. If I do this sequence import ldap ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, '/path/to/cert') conn = ldap.initialize('ldaps://server') conn.simple_bind_s('uid', 'pass') things work fine. But if I do it like this import ldap conn = ldap.initialize('ldaps://server') conn.set_option(ldap.OPT_X_TLS_CACERTFILE, '/path/to/cert') conn.simple_bind_s('uid', 'pass') then I get an error saying that it can't contact the server. I am guessing it just can't verify the server's ssl certificate and just saying it can't contact the server. But it appears that if I set the option on the ldap module it works but setting the option on the individual connection doesn't. Is this expected behavior? Is this a restriction of the underlying openldap client libraries? Or a bug that could use some attention? I am wanting to get it so that the options are on the connections so that I could do multiple connections with different options. Thanks for any help in advance. mike |
From: Michael S. <mi...@st...> - 2009-05-16 13:59:51
|
Guruprasad wrote: > Hi, > 2009/5/16 Michael Ströder <mi...@st...>: >> Guruprasad wrote: >>> 2009/5/16 Michael Ströder <mi...@st...>: >>>> Guruprasad wrote: >>>>> Hi, >>>>> I tried generating a LDIF file from a dictionary using 'ldif' module >>>>> as illustrated in http://www.python-ldap.org/doc/html/ldif.html. But >>>>> at the end of the LDIF data, I get a newline and a 'None', whereas >>>>> there is no such thing in the result shown in that example. How to get >>>>> rid of those unwanted characters. I am using Python-LDAP 2.3.5-1 on >>>>> Debian Lenny. >>>> Could you please post your code (in a short form) demonstrating the >>>> issue? Note that there is a new-line after each entry record. But was >>>> 'None' is in your case is not clear to me. >>>> >>> Basically what I am trying to do with this code is that, I manipulate >>> the result returned by ldapsearch to remove some attributes and >>> generate a LDIF output for the modified entry. >>> >>> <code> >>> res_type, result_data=l.result(res_id,0) >>> if (result_data==[]): >>> break >>> dn=result_data[0][0] >>> resd=result_data[0][1] >>> resd["objectClass"].remove("inetLocalMailRecipient") >>> resd["objectClass"].remove("organizationalPerson") >>> resd["objectClass"].remove("inetOrgPerson") >>> resd["objectClass"].remove("posixAccount") >>> lw=ldif.LDIFWriter(sys.stdout) >>> guru=lw.unparse(dn,resd) >>> print guru >>> </code> >> Your code looks like processing of LDAP search results (because of the >> res_type). I'd recommend to look at the actual data in dictionary resd. >> Also note that the identiation seems wrong. This could be because of >> cut&paste to your MUA from the editor with different tab-interpretation. >> But make sure identiation is correct in the real code. > > The indentation is correct in the real code. The dictionary 'resd' has > the values returned by the ldapsearch and there is no 'None' anywhere > in it. I think your interpretation of the output is wrong. Method LDIFWrite.unparse() outputs the LDIF to the file object (in your case sys.stdout). If you print the result of method unparse() that's obviously None. Ciao, Michael. |
From: Guruprasad <lgp...@gm...> - 2009-05-16 13:14:04
|
Hi, 2009/5/16 Michael Ströder <mi...@st...>: > Guruprasad wrote: >> 2009/5/16 Michael Ströder <mi...@st...>: >>> Guruprasad wrote: >>>> Hi, >>>> I tried generating a LDIF file from a dictionary using 'ldif' module >>>> as illustrated in http://www.python-ldap.org/doc/html/ldif.html. But >>>> at the end of the LDIF data, I get a newline and a 'None', whereas >>>> there is no such thing in the result shown in that example. How to get >>>> rid of those unwanted characters. I am using Python-LDAP 2.3.5-1 on >>>> Debian Lenny. >>> Could you please post your code (in a short form) demonstrating the >>> issue? Note that there is a new-line after each entry record. But was >>> 'None' is in your case is not clear to me. >>> >> >> Basically what I am trying to do with this code is that, I manipulate >> the result returned by ldapsearch to remove some attributes and >> generate a LDIF output for the modified entry. >> >> <code> >> res_type, result_data=l.result(res_id,0) >> if (result_data==[]): >> break >> dn=result_data[0][0] >> resd=result_data[0][1] >> resd["objectClass"].remove("inetLocalMailRecipient") >> resd["objectClass"].remove("organizationalPerson") >> resd["objectClass"].remove("inetOrgPerson") >> resd["objectClass"].remove("posixAccount") >> lw=ldif.LDIFWriter(sys.stdout) >> guru=lw.unparse(dn,resd) >> print guru >> </code> > > Your code looks like processing of LDAP search results (because of the > res_type). I'd recommend to look at the actual data in dictionary resd. > Also note that the identiation seems wrong. This could be because of > cut&paste to your MUA from the editor with different tab-interpretation. > But make sure identiation is correct in the real code. > > Ciao, Michael. > The indentation is correct in the real code. The dictionary 'resd' has the values returned by the ldapsearch and there is no 'None' anywhere in it. Thank you. Regards, Guruprasad. |
From: Michael S. <mi...@st...> - 2009-05-16 12:59:29
|
Guruprasad wrote: > My ldapsearch query returns only one record. I have written such a filter. Sorry, my crystal ball is a bit blurry. I can't help without really knowing what you're trying to achieve. Ciao, Michael. |
From: Michael S. <mi...@st...> - 2009-05-16 12:58:24
|
Guruprasad wrote: > 2009/5/16 Michael Ströder <mi...@st...>: >> Guruprasad wrote: >>> Hi, >>> I tried generating a LDIF file from a dictionary using 'ldif' module >>> as illustrated in http://www.python-ldap.org/doc/html/ldif.html. But >>> at the end of the LDIF data, I get a newline and a 'None', whereas >>> there is no such thing in the result shown in that example. How to get >>> rid of those unwanted characters. I am using Python-LDAP 2.3.5-1 on >>> Debian Lenny. >> Could you please post your code (in a short form) demonstrating the >> issue? Note that there is a new-line after each entry record. But was >> 'None' is in your case is not clear to me. >> > > Basically what I am trying to do with this code is that, I manipulate > the result returned by ldapsearch to remove some attributes and > generate a LDIF output for the modified entry. > > <code> > res_type, result_data=l.result(res_id,0) > if (result_data==[]): > break > dn=result_data[0][0] > resd=result_data[0][1] > resd["objectClass"].remove("inetLocalMailRecipient") > resd["objectClass"].remove("organizationalPerson") > resd["objectClass"].remove("inetOrgPerson") > resd["objectClass"].remove("posixAccount") > lw=ldif.LDIFWriter(sys.stdout) > guru=lw.unparse(dn,resd) > print guru > </code> Your code looks like processing of LDAP search results (because of the res_type). I'd recommend to look at the actual data in dictionary resd. Also note that the identiation seems wrong. This could be because of cut&paste to your MUA from the editor with different tab-interpretation. But make sure identiation is correct in the real code. Ciao, Michael. |
From: Guruprasad <lgp...@gm...> - 2009-05-16 12:51:41
|
2009/5/16 Guruprasad <lgp...@gm...>: > Hi, > > 2009/5/16 Michael Ströder <mi...@st...>: > <code> > res_type, result_data=l.result(res_id,0) > if (result_data==[]): > break > dn=result_data[0][0] > resd=result_data[0][1] > resd["objectClass"].remove("inetLocalMailRecipient") > resd["objectClass"].remove("organizationalPerson") > resd["objectClass"].remove("inetOrgPerson") > resd["objectClass"].remove("posixAccount") > lw=ldif.LDIFWriter(sys.stdout) > guru=lw.unparse(dn,resd) > print guru > </code> > > Is it some issue or am I making some mistakes with general usage of Python? > > Thank you. > > Regards, > L.Guruprasad > My ldapsearch query returns only one record. I have written such a filter. Regards, Guruprasad |
From: Guruprasad <lgp...@gm...> - 2009-05-16 12:47:33
|
Hi, 2009/5/16 Michael Ströder <mi...@st...>: > Guruprasad wrote: >> Hi, >> I tried generating a LDIF file from a dictionary using 'ldif' module >> as illustrated in http://www.python-ldap.org/doc/html/ldif.html. But >> at the end of the LDIF data, I get a newline and a 'None', whereas >> there is no such thing in the result shown in that example. How to get >> rid of those unwanted characters. I am using Python-LDAP 2.3.5-1 on >> Debian Lenny. > > Could you please post your code (in a short form) demonstrating the > issue? Note that there is a new-line after each entry record. But was > 'None' is in your case is not clear to me. > Basically what I am trying to do with this code is that, I manipulate the result returned by ldapsearch to remove some attributes and generate a LDIF output for the modified entry. <code> res_type, result_data=l.result(res_id,0) if (result_data==[]): break dn=result_data[0][0] resd=result_data[0][1] resd["objectClass"].remove("inetLocalMailRecipient") resd["objectClass"].remove("organizationalPerson") resd["objectClass"].remove("inetOrgPerson") resd["objectClass"].remove("posixAccount") lw=ldif.LDIFWriter(sys.stdout) guru=lw.unparse(dn,resd) print guru </code> Is it some issue or am I making some mistakes with general usage of Python? Thank you. Regards, L.Guruprasad |
From: Michael S. <mi...@st...> - 2009-05-16 12:41:53
|
Guruprasad wrote: > Hi, > I tried generating a LDIF file from a dictionary using 'ldif' module > as illustrated in http://www.python-ldap.org/doc/html/ldif.html. But > at the end of the LDIF data, I get a newline and a 'None', whereas > there is no such thing in the result shown in that example. How to get > rid of those unwanted characters. I am using Python-LDAP 2.3.5-1 on > Debian Lenny. Could you please post your code (in a short form) demonstrating the issue? Note that there is a new-line after each entry record. But was 'None' is in your case is not clear to me. Ciao, Michael. |
From: Guruprasad <lgp...@gm...> - 2009-05-16 12:29:41
|
Hi, I tried generating a LDIF file from a dictionary using 'ldif' module as illustrated in http://www.python-ldap.org/doc/html/ldif.html. But at the end of the LDIF data, I get a newline and a 'None', whereas there is no such thing in the result shown in that example. How to get rid of those unwanted characters. I am using Python-LDAP 2.3.5-1 on Debian Lenny. Thank you. Regards, Guruprasad. |
From: Zhang H. <zhb...@gm...> - 2009-05-15 14:08:11
|
Michael Ströder wrote: > mycmp=lambda x,y: cmp(x[0].lower(), y[0].lower()) > alist.sort(mycmp) I found this and solved too. Big thanks :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://code.google.com/p/iredmail/ |
From: Michael S. <mi...@st...> - 2009-05-15 13:02:55
|
Zhang Huangbin wrote: > >>> cmp=lambda x,y: cmp(x[0].lower(), y[0].lower()) > > >>> alist.sort(cmp) Ouch! One should probably not mask the standard function name cmp. So try this: mycmp=lambda x,y: cmp(x[0].lower(), y[0].lower()) alist.sort(mycmp) Ciao, Michael. |
From: Zhang H. <zhb...@gm...> - 2009-05-15 12:45:15
|
Michael Ströder wrote: > > Sorry, there's a typo in there: > > cmp=lambda x,y: cmp(x[0].lower(), y[0}.lower()) > ^ > Should be ] I found that before, but got the same error: >>> alist [('mail=postmaster@a.cn,o=domainAdmins,dc=iredmail,dc=org', {'mail': ['postmaster@a.cn'], 'accountStatus': ['active'], 'enabledService': ['awstats'], 'domainGlobalAdmin': ['yes']}), ('mail=www@a.cn,o=domainAdmins,dc=iredmail,dc=org', {'mail': ['www@a.cn'], 'accountStatus': ['active'], 'domainGlobalAdmin': ['yes']}), ('mail=www5@a.cn,o=domainAdmins,dc=iredmail,dc=org', {'mail': ['www5@a.cn'], 'accountStatus': ['active'], 'domainGlobalAdmin': ['no']}), ('mail=www3@a.cn,o=domainAdmins,dc=iredmail,dc=org', {'mail': ['www3@a.cn'], 'accountStatus': ['active'], 'domainGlobalAdmin': ['no']})] >>> cmp=lambda x,y: cmp(x[0].lower(), y[0].lower()) >>> alist.sort(cmp) Traceback (most recent call last): File "<stdin>", line 1, in ? File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> ...... SKIP MANY LINES HERE ...... File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> File "<stdin>", line 1, in <lambda> RuntimeError: maximum recursion depth exceeded -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://code.google.com/p/iredmail/ |
From: Michael S. <mi...@st...> - 2009-05-15 08:56:58
|
Zhang Huangbin wrote: > Michael Ströder wrote: >> Compare function for case-insensitive comparison of the DN: >> >> cmp=lambda x,y: cmp(x[0].lower(), y[0}.lower()) > > I tried this compare function, but got this err msg: Sorry, there's a typo in there: cmp=lambda x,y: cmp(x[0].lower(), y[0}.lower()) ^ Should be ] Ciao, Michael. |
From: Zhang H. <zhb...@gm...> - 2009-05-15 03:04:44
|
Michael Ströder wrote: > > Compare function for case-insensitive comparison of the DN: > > cmp=lambda x,y: cmp(x[0].lower(), y[0}.lower()) > > Thanks Michael. :) I tried this compare function, but got this err msg: ---- RuntimeError: maximum recursion depth exceeded ---- The result contains less than 10 records. -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://code.google.com/p/iredmail/ |
From: Russell J. <ra...@cs...> - 2009-05-14 19:10:57
|
Michael Ströder wrote: > Zhang Huangbin wrote: >> Michael Ströder wrote: >> Tring to learn ldap programing from web2ldap now. Thanks for your great >> program. :) > > Bear in mind that I started learning Python when the first code was > written almost 11 years ago. So I have to admit that many parts are > really ugly code and not really good programming examples. Every programmer I've ever talked to always thinks their own code sucks. -- Russell A. Jackson <ra...@cs...> Network Analyst California State University, Bakersfield With a gentleman I try to be a gentleman and a half, and with a fraud I try to be a fraud and a half. -- Otto von Bismarck |