X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/7e74f1754d15f96bd33bae06b855c48c87db2498..63f5e85cdbd05ac9a00a6dab60548c226981fb62:/utils.py 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