X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/7e74f1754d15f96bd33bae06b855c48c87db2498..ba5dfbeadced3f2773dfee1bad46c9b86d4f4a86:/utils.py?ds=sidebyside diff --git a/utils.py b/utils.py index 470b49a..252af4e 100755 --- a/utils.py +++ b/utils.py @@ -27,6 +27,7 @@ import re from types import StringType from random import randrange from Acquisition import aq_base +from quopri import encodestring from AccessControl.PermissionRole import rolesForPermissionOn from AccessControl import ModuleSecurityInfo from AccessControl import getSecurityManager @@ -251,6 +252,11 @@ def getAdapterByInterface(ob, dotted_name, default=_marker) : else : return default +def encodeQuopriEmail(name, email) : + qpName = encodestring(name).replace('=\n', '') + return '''"=?utf-8?q?%s?=" <%s>''' % (qpName, email) + + def _sudo(func, userid=None) : """ execute func or any callable object