Univention Bugzilla – Attachment 9243 Details for
Bug 43129
Enhance UDM Syntax for Generalized Time Syntax
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Allow toLDAP() and fromLDAP() methods in syntax classes
proposed.patch (text/plain), 3.07 KB, created by
Frank Greif
on 2017-10-10 11:54:54 CEST
(
hide
)
Description:
Allow toLDAP() and fromLDAP() methods in syntax classes
Filename:
MIME Type:
Creator:
Frank Greif
Created:
2017-10-10 11:54:54 CEST
Size:
3.07 KB
patch
obsolete
>*** __init__.py 2017-10-10 11:37:28.718544259 +0200 >--- __init__.py.bak 2017-10-06 18:06:00.000000000 +0200 >*************** >*** 735,785 **** > def _post_unmap(self, info, values): > """This method can be overwritten to define special un-map > methods that can not be done with the default mapping API""" >- univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_unmap called with info=[%s] values=[%s]' % (str(info),str(values))) >- # Allow the fromLDAP() method of the syntax class to convert >- # a raw LDAP value into UDM-specific representation >- for field in info: >- try: >- s = self.descriptions[field].syntax >- univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_unmap: field=%s syntax=%s' % (field,str(s))) >- if callable(s.fromLDAP): >- univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_unmap: This syntax has a fromLDAP() method') >- if isinstance(info[field],list): >- newval = [] >- for val in info[field]: >- newval.append(s.fromLDAP(val)) >- info[field] = newval >- else: >- info[field] = s.fromLDAP(info[field]) >- except AttributeError, e: >- pass >- except Exception, e: >- univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, 'modules/__init__.py _post_unmap: Exception "%s" "%s"' % (e.__class__.__name__,e.message)) >- > return info > > def _post_map(self, modlist, diff): > """This method can be overwritten to define special map methods > that can not be done with the default mapping API""" >! univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_map called with modlist=[%s] diff=[%s]' % (str(modlist),str(diff))) >! ml = [] >! for tuple in modlist: >! has_callback = False >! try: >! s = self.descriptions[tuple[0]].syntax >! univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_map: field=%s syntax=%s' % (tuple[0],str(s))) >! if callable(s.toLDAP): >! univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_map: This syntax has a toLDAP() method') >! has_callback = True >! except AttributeError, e: >! pass >! except Exception, e: >! univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, 'modules/__init__.py _post_map: Exception "%s" "%s"' % (e.__class__.__name__,e.message)) >! if has_callback: >! newval = s.toLDAP(tuple[2]) >! tuple = (tuple[0], tuple[1], newval) >! ml.append(tuple) >! return ml > > def _ldap_modlist(self): > self.exceptions = [] >--- 735,746 ---- > def _post_unmap(self, info, values): > """This method can be overwritten to define special un-map > methods that can not be done with the default mapping API""" > return info > > def _post_map(self, modlist, diff): > """This method can be overwritten to define special map methods > that can not be done with the default mapping API""" >! return modlist > > def _ldap_modlist(self): > self.exceptions = []
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43129
:
9243
|
9244
|
9245
|
9246
|
9722
|
9766