[attributs, lc_ldap] unicode(x) -> x.__unicode__()
This commit is contained in:
parent
f461764825
commit
ba260bcb50
2 changed files with 3 additions and 3 deletions
|
@ -81,7 +81,7 @@ class Attr(object):
|
||||||
self.value = val
|
self.value = val
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return unicode(self).encode('utf-8')
|
return self.__unicode__().encode('utf-8')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
# XXX - Vérifier que cette méthode produit un objet parsable
|
# XXX - Vérifier que cette méthode produit un objet parsable
|
||||||
|
|
|
@ -329,9 +329,9 @@ class CransLdapObject(object):
|
||||||
|
|
||||||
def __getitem__(self, attr):
|
def __getitem__(self, attr):
|
||||||
if self.mode in [ 'w', 'rw' ]:
|
if self.mode in [ 'w', 'rw' ]:
|
||||||
return [ unicode(v) for v in self._modifs[attr] ]
|
return [ v.__unicode__() for v in self._modifs[attr] ]
|
||||||
else:
|
else:
|
||||||
return [ unicode(v) for v in self.attrs[attr] ]
|
return [ v.__unicode__() for v in self.attrs[attr] ]
|
||||||
|
|
||||||
def __setitem__(self, attr, values):
|
def __setitem__(self, attr, values):
|
||||||
if self.mode not in ['w', 'rw']:
|
if self.mode not in ['w', 'rw']:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue