当前位置: 首页>>代码示例>>Python>>正文


Python Utils.uncanonstr方法代码示例

本文整理汇总了Python中Mailman.Utils.uncanonstr方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.uncanonstr方法的具体用法?Python Utils.uncanonstr怎么用?Python Utils.uncanonstr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mailman.Utils的用法示例。


在下文中一共展示了Utils.uncanonstr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: escape

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
    def escape(self, value):
        # transforms accents into html entities (é)
        # TODO: find out which language is current (here: assumes iso-8859-1)
        value = Utils.uncanonstr(value)

        # add slashes before " and '
        return MySQLdb.escape_string(value)
开发者ID:johnwbyrd,项目名称:vanilla-mailman,代码行数:9,代码来源:MysqlMemberships.py

示例2: html_quote

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def html_quote(s, lang=None):
    repls = ( ('&', '&'),
              ("<", '&lt;'),
              (">", '&gt;'),
              ('"', '&quot;'))
    for thing, repl in repls:
        s = s.replace(thing, repl)
    return Utils.uncanonstr(s, lang)
开发者ID:EdLeafe,项目名称:mailman_config,代码行数:10,代码来源:HyperArch.py

示例3: html_quote

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def html_quote(s, lang=None):
    """Exchange symbols used in Python for appropriate html code"""
    repls = ( ('&', '&amp;'),
              ("<", '&lt;'),
              (">", '&gt;'),
              ('"', '&quot;'))
    for thing, repl in repls:
        s = s.replace(thing, repl)
    return Utils.uncanonstr(s, lang)
开发者ID:jdk2588,项目名称:systers-gsoc10-membership,代码行数:11,代码来源:HyperArch.py

示例4: show_pending_unsubs

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def show_pending_unsubs(mlist, form):
    # Add the pending unsubscription request section
    lang = mlist.preferred_language
    pendingunsubs = mlist.GetUnsubscriptionIds()
    if not pendingunsubs:
        return 0
    table = Table(border=2)
    table.AddRow([Center(Bold(_('User address/name'))),
                  Center(Bold(_('Your decision'))),
                  Center(Bold(_('Reason for refusal')))
                  ])
    # Alphabetical order by email address
    byaddrs = {}
    for id in pendingunsubs:
        addr = mlist.GetRecord(id)
        byaddrs.setdefault(addr, []).append(id)
    addrs = byaddrs.keys()
    addrs.sort()
    num = 0
    for addr, ids in byaddrs.items():
        # Eliminate duplicates
        for id in ids[1:]:
            mlist.HandleRequest(id, mm_cfg.DISCARD)
        id = ids[0]
        addr = mlist.GetRecord(id)
        try:
            fullname = Utils.uncanonstr(mlist.getMemberName(addr), lang)
        except Errors.NotAMemberError:
            # They must have been unsubscribed elsewhere, so we can just
            # discard this record.
            mlist.HandleRequest(id, mm_cfg.DISCARD)
            continue
        num += 1
        # While the address may be a unicode, it must be ascii
        paddr = addr.encode('us-ascii', 'replace')
        table.AddRow(['%s<br><em>%s</em>' % (paddr, Utils.websafe(fullname)),
                      RadioButtonArray(id, (_('Defer'),
                                            _('Approve'),
                                            _('Reject'),
                                            _('Discard')),
                                       values=(mm_cfg.DEFER,
                                               mm_cfg.UNSUBSCRIBE,
                                               mm_cfg.REJECT,
                                               mm_cfg.DISCARD),
                                       checked=0),
                      TextBox('comment-%d' % id, size=45)
                      ])
    if num > 0:
        form.AddItem('<hr>')
        form.AddItem(Center(Header(2, _('Unsubscription Requests'))))
        form.AddItem(table)
    return num
开发者ID:atsuoishimoto,项目名称:mailman-2.1-ja,代码行数:54,代码来源:admindb.py

示例5: set_options

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def set_options(userdesc, perms, mlist, opts, vals):
    for (k, v) in vals.iteritems():
        if k not in opts:
            continue
        if k == 'default_member_moderation':
            for member in mlist.getMembers():
                mlist.setMemberOption(member, mm_cfg.Moderate, int(v))
        t = type(mlist.__dict__[k])
        if   t is bool: mlist.__dict__[k] = bool(v)
        elif t is int:  mlist.__dict__[k] = int(v)
        elif t is str:  mlist.__dict__[k] = Utils.uncanonstr(v, 'fr')
        else:           mlist.__dict__[k] = v
    return 1
开发者ID:Ekleog,项目名称:platal,代码行数:15,代码来源:lists.rpc.py

示例6: show_pending_subs

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def show_pending_subs(mlist, form):
    # Add the subscription request section
    pendingsubs = mlist.GetSubscriptionIds()
    if not pendingsubs:
        return 0
    form.AddItem('<hr>')
    form.AddItem(Center(Header(2, _('Subscription Requests'))))
    table = Table(border=2)
    table.AddRow([Center(Bold(_('Address/name'))),
                  Center(Bold(_('Your decision'))),
                  Center(Bold(_('Reason for refusal')))
                  ])
    # Alphabetical order by email address
    byaddrs = {}
    for id in pendingsubs:
        addr = mlist.GetRecord(id)[1]
        byaddrs.setdefault(addr, []).append(id)
    addrs = byaddrs.items()
    addrs.sort()
    num = 0
    for addr, ids in addrs:
        # Eliminate duplicates
        for id in ids[1:]:
            mlist.HandleRequest(id, mm_cfg.DISCARD)
        id = ids[0]
        time, addr, fullname, passwd, digest, lang = mlist.GetRecord(id)
        fullname = Utils.uncanonstr(fullname, mlist.preferred_language)
        radio = RadioButtonArray(id, (_('Defer'),
                                      _('Approve'),
                                      _('Reject'),
                                      _('Discard')),
                                 values=(mm_cfg.DEFER,
                                         mm_cfg.SUBSCRIBE,
                                         mm_cfg.REJECT,
                                         mm_cfg.DISCARD),
                                 checked=0).Format()
        if addr not in mlist.ban_list:
            radio += ('<br>' + '<label>' +
                     CheckBox('ban-%d' % id, 1).Format() +
                     '&nbsp;' + _('Permanently ban from this list') +
                     '</label>')
        # While the address may be a unicode, it must be ascii
        paddr = addr.encode('us-ascii', 'replace')
        table.AddRow(['%s<br><em>%s</em>' % (paddr, Utils.websafe(fullname)),
                      radio,
                      TextBox('comment-%d' % id, size=40)
                      ])
        num += 1
    if num > 0:
        form.AddItem(table)
    return num
开发者ID:jurov,项目名称:gnu-mailman,代码行数:53,代码来源:admindb.py

示例7: quick_maketext

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def quick_maketext(templatefile, dict=None, lang=None, mlist=None):
    """Create an output using a template"""
    # Used by various html output functions such as as_html, html_TOC and write_index_entry
    if mlist is None:
        listname = ''
    else:
        listname = mlist._internal_name
    if lang is None:
        if mlist is None:
            lang = mm_cfg.DEFAULT_SERVER_LANGUAGE
        else:
            lang = mlist.preferred_language
    cachekey = (templatefile, lang, listname)
    filepath =  _templatefilepathcache.get(cachekey)
    if filepath:
        template = _templatecache.get(filepath)
    if filepath is None or template is None:
        # Use the basic maketext, with defaults to get the raw template
        template, filepath = Utils.findtext(templatefile, lang=lang,
                                            raw=True, mlist=mlist)
        _templatefilepathcache[cachekey] = filepath
        _templatecache[filepath] = template
    # Copied from Utils.maketext()
    text = template
    if dict is not None:
        try:
            sdict = SafeDict(dict)
            try:
                text = sdict.interpolate(template)
            except UnicodeError:
                # Try again after coercing the template to unicode
                utemplate = unicode(template,
                                    Utils.GetCharSet(lang),
                                    'replace')
                text = sdict.interpolate(utemplate)
        except (TypeError, ValueError):
            # The template is really screwed up
            pass
    # Make sure the text is in the given character set, or html-ify any bogus
    # characters.
    return Utils.uncanonstr(text, lang)
开发者ID:jdk2588,项目名称:systers-gsoc10-membership,代码行数:43,代码来源:HyperArch.py

示例8: FormatUsers

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
 def FormatUsers(self, digest, lang=None, list_hidden=False):
     if lang is None:
         lang = self.preferred_language
     conceal_sub = mm_cfg.ConcealSubscription
     people = []
     if digest:
         members = self.getDigestMemberKeys()
     else:
         members = self.getRegularMemberKeys()
     for m in members:
         if list_hidden or not self.getMemberOption(m, conceal_sub):
             people.append(m)
     num_concealed = len(members) - len(people)
     if num_concealed == 1:
         concealed = _('<em>(1 private member not shown)</em>')
     elif num_concealed > 1:
        concealed = _(
            '<em>(%(num_concealed)d private members not shown)</em>')
     else:
         concealed = ''
     items = []
     people.sort()
     obscure = self.obscure_addresses
     for person in people:
         id = Utils.ObscureEmail(person)
         url = self.GetOptionsURL(person, obscure=obscure)
         if obscure:
             showing = Utils.ObscureEmail(person, for_text=1)
         else:
             showing = person
         realname = Utils.uncanonstr(self.getMemberName(person), lang)
         if realname and mm_cfg.ROSTER_DISPLAY_REALNAME:
             showing += " (%s)" % Utils.websafe(realname)
         got = Link(url, showing)
         if self.getDeliveryStatus(person) <> MemberAdaptor.ENABLED:
             got = Italic('(', got, ')')
         items.append(got)
     # Just return the .Format() so this works until I finish
     # converting everything to htmlformat...
     return concealed + UnorderedList(*tuple(items)).Format()
开发者ID:fumiyas,项目名称:mailman-ja-utf8-debian,代码行数:42,代码来源:HTMLFormatter.py

示例9: set_options

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def set_options(vhost,listname,opts,vals):
    try:
        mlist = MailList.MailList(vhost+'-'+listname)
    except:
        return 0
    try:
        for (k,v) in vals.iteritems():
            if k not in opts:
                continue
            if k == 'default_member_moderation':
                for member in mlist.getMembers():
                    mlist.setMemberOption(member, mm_cfg.Moderate, int(v))
            t = type(mlist.__dict__[k])
            if   t is bool: mlist.__dict__[k] = bool(v)
            elif t is int:  mlist.__dict__[k] = int(v)
            elif t is str:  mlist.__dict__[k] = Utils.uncanonstr(v,'fr')
            else:           mlist.__dict__[k] = v
        mlist.Save()
        mlist.Unlock()
        return 1
    except:
        mlist.Unlock()
        raise
        return 0
开发者ID:Ekleog,项目名称:platal,代码行数:26,代码来源:to_mailman.py

示例10: getValue

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
 def getValue(self, mlist, kind, varname, params):
     if varname <> 'subject_prefix':
         return None
     # The subject_prefix may be Unicode
     return Utils.uncanonstr(mlist.subject_prefix, mlist.preferred_language)
开发者ID:bdraco,项目名称:mailman,代码行数:7,代码来源:General.py

示例11: CGIescape

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def CGIescape(arg, lang=None):
    if isinstance(arg, types.UnicodeType):
        s = Utils.websafe(arg)
    else:
        s = Utils.websafe(str(arg))
    return Utils.uncanonstr(s.replace('"', '&quot;'), lang)
开发者ID:EdLeafe,项目名称:mailman_config,代码行数:8,代码来源:HyperArch.py

示例12: SafeDict

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
        try:
            sdict = SafeDict(dict)
            try:
                text = sdict.interpolate(template)
            except UnicodeError:
                # Try again after coercing the template to unicode
                utemplate = unicode(template,
                                    Utils.GetCharSet(lang),
                                    'replace')
                text = sdict.interpolate(utemplate)
        except (TypeError, ValueError), e:
            # The template is really screwed up
            syslog('error', 'broken template: %s\n%s', filepath, e)
    # Make sure the text is in the given character set, or html-ify any bogus
    # characters.
    return Utils.uncanonstr(text, lang)



# Note: I'm overriding most, if not all of the pipermail Article class
#       here -ddm
# The Article class encapsulates a single posting.  The attributes are:
#
#  sequence : Sequence number, unique for each article in a set of archives
#  subject  : Subject
#  datestr  : The posting date, in human-readable format
#  date     : The posting date, in purely numeric format
#  fromdate : The posting date, in `unixfrom' format
#  headers  : Any other headers of interest
#  author   : The author's name (and possibly organization)
#  email    : The author's e-mail address
开发者ID:fumiyas,项目名称:mailman-ja-utf8-debian,代码行数:33,代码来源:HyperArch.py

示例13: options_page

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def options_page(mlist, doc, user, cpuser, userlang, message=''):
    # The bulk of the document will come from the options.html template, which
    # includes it's own html armor (head tags, etc.).  Suppress the head that
    # Document() derived pages get automatically.
    doc.suppress_head = 1

    if mlist.obscure_addresses:
        presentable_user = Utils.ObscureEmail(user, for_text=1)
        if cpuser is not None:
            cpuser = Utils.ObscureEmail(cpuser, for_text=1)
    else:
        presentable_user = user

    fullname = Utils.uncanonstr(mlist.getMemberName(user), userlang)
    if fullname:
        presentable_user += ', %s' % Utils.websafe(fullname)

    # Do replacements
    replacements = mlist.GetStandardReplacements(userlang)
    replacements['<mm-results>'] = Bold(FontSize('+1', message)).Format()
    replacements['<mm-digest-radio-button>'] = mlist.FormatOptionButton(
        mm_cfg.Digests, 1, user)
    replacements['<mm-undigest-radio-button>'] = mlist.FormatOptionButton(
        mm_cfg.Digests, 0, user)
    replacements['<mm-plain-digests-button>'] = mlist.FormatOptionButton(
        mm_cfg.DisableMime, 1, user)
    replacements['<mm-mime-digests-button>'] = mlist.FormatOptionButton(
        mm_cfg.DisableMime, 0, user)
    replacements['<mm-global-mime-button>'] = (
        CheckBox('mime-globally', 1, checked=0).Format())
    replacements['<mm-delivery-enable-button>'] = mlist.FormatOptionButton(
        mm_cfg.DisableDelivery, 0, user)
    replacements['<mm-delivery-disable-button>'] = mlist.FormatOptionButton(
        mm_cfg.DisableDelivery, 1, user)
    replacements['<mm-disabled-notice>'] = mlist.FormatDisabledNotice(user)
    replacements['<mm-dont-ack-posts-button>'] = mlist.FormatOptionButton(
        mm_cfg.AcknowledgePosts, 0, user)
    replacements['<mm-ack-posts-button>'] = mlist.FormatOptionButton(
        mm_cfg.AcknowledgePosts, 1, user)
    replacements['<mm-receive-own-mail-button>'] = mlist.FormatOptionButton(
        mm_cfg.DontReceiveOwnPosts, 0, user)
    replacements['<mm-dont-receive-own-mail-button>'] = (
        mlist.FormatOptionButton(mm_cfg.DontReceiveOwnPosts, 1, user))
    replacements['<mm-dont-get-password-reminder-button>'] = (
        mlist.FormatOptionButton(mm_cfg.SuppressPasswordReminder, 1, user))
    replacements['<mm-get-password-reminder-button>'] = (
        mlist.FormatOptionButton(mm_cfg.SuppressPasswordReminder, 0, user))
    replacements['<mm-public-subscription-button>'] = (
        mlist.FormatOptionButton(mm_cfg.ConcealSubscription, 0, user))
    replacements['<mm-hide-subscription-button>'] = mlist.FormatOptionButton(
        mm_cfg.ConcealSubscription, 1, user)
    replacements['<mm-dont-receive-duplicates-button>'] = (
        mlist.FormatOptionButton(mm_cfg.DontReceiveDuplicates, 1, user))
    replacements['<mm-receive-duplicates-button>'] = (
        mlist.FormatOptionButton(mm_cfg.DontReceiveDuplicates, 0, user))
    replacements['<mm-unsubscribe-button>'] = (
        mlist.FormatButton('unsub', _('Unsubscribe')) + '<br>' +
        CheckBox('unsubconfirm', 1, checked=0).Format() +
        _('<em>Yes, I really want to unsubscribe</em>'))
    replacements['<mm-new-pass-box>'] = mlist.FormatSecureBox('newpw')
    replacements['<mm-confirm-pass-box>'] = mlist.FormatSecureBox('confpw')
    replacements['<mm-change-pass-button>'] = (
        mlist.FormatButton('changepw', _("Change My Password")))
    replacements['<mm-other-subscriptions-submit>'] = (
        mlist.FormatButton('othersubs',
                           _('List my other subscriptions')))
    replacements['<mm-form-start>'] = (
        mlist.FormatFormStart('options', user))
    replacements['<mm-user>'] = user
    replacements['<mm-presentable-user>'] = presentable_user
    replacements['<mm-email-my-pw>'] = mlist.FormatButton(
        'emailpw', (_('Email My Password To Me')))
    replacements['<mm-umbrella-notice>'] = (
        mlist.FormatUmbrellaNotice(user, _("password")))
    replacements['<mm-logout-button>'] = (
        mlist.FormatButton('logout', _('Log out')))
    replacements['<mm-options-submit-button>'] = mlist.FormatButton(
        'options-submit', _('Submit My Changes'))
    replacements['<mm-global-pw-changes-button>'] = (
        CheckBox('pw-globally', 1, checked=0).Format())
    replacements['<mm-global-deliver-button>'] = (
        CheckBox('deliver-globally', 1, checked=0).Format())
    replacements['<mm-global-remind-button>'] = (
        CheckBox('remind-globally', 1, checked=0).Format())
    replacements['<mm-global-nodupes-button>'] = (
        CheckBox('nodupes-globally', 1, checked=0).Format())

    days = int(mm_cfg.PENDING_REQUEST_LIFE / mm_cfg.days(1))
    if days > 1:
        units = _('days')
    else:
        units = _('day')
    replacements['<mm-pending-days>'] = _('%(days)d %(units)s')

    replacements['<mm-new-address-box>'] = mlist.FormatBox('new-address')
    replacements['<mm-confirm-address-box>'] = mlist.FormatBox(
        'confirm-address')
    replacements['<mm-change-address-button>'] = mlist.FormatButton(
        'change-of-address', _('Change My Address and Name'))
    replacements['<mm-global-change-of-address>'] = CheckBox(
#.........这里部分代码省略.........
开发者ID:jurov,项目名称:gnu-mailman,代码行数:103,代码来源:options.py

示例14: options_page

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
def options_page(mlist, doc, user, cpuser, userlang, message=""):
    # The bulk of the document will come from the options.html template, which
    # includes it's own html armor (head tags, etc.).  Suppress the head that
    # Document() derived pages get automatically.
    doc.suppress_head = 1

    if mlist.obscure_addresses:
        presentable_user = Utils.ObscureEmail(user, for_text=1)
        if cpuser is not None:
            cpuser = Utils.ObscureEmail(cpuser, for_text=1)
    else:
        presentable_user = user

    fullname = Utils.uncanonstr(mlist.getMemberName(user), userlang)
    if fullname:
        presentable_user += ", %s" % Utils.websafe(fullname)

    # Do replacements
    replacements = mlist.GetStandardReplacements(userlang)
    replacements["<mm-results>"] = Bold(FontSize("+1", message)).Format()
    replacements["<mm-digest-radio-button>"] = mlist.FormatOptionButton(mm_cfg.Digests, 1, user)
    replacements["<mm-undigest-radio-button>"] = mlist.FormatOptionButton(mm_cfg.Digests, 0, user)
    replacements["<mm-plain-digests-button>"] = mlist.FormatOptionButton(mm_cfg.DisableMime, 1, user)
    replacements["<mm-mime-digests-button>"] = mlist.FormatOptionButton(mm_cfg.DisableMime, 0, user)
    replacements["<mm-global-mime-button>"] = CheckBox("mime-globally", 1, checked=0).Format()
    replacements["<mm-delivery-enable-button>"] = mlist.FormatOptionButton(mm_cfg.DisableDelivery, 0, user)
    replacements["<mm-delivery-disable-button>"] = mlist.FormatOptionButton(mm_cfg.DisableDelivery, 1, user)
    replacements["<mm-disabled-notice>"] = mlist.FormatDisabledNotice(user)
    replacements["<mm-dont-ack-posts-button>"] = mlist.FormatOptionButton(mm_cfg.AcknowledgePosts, 0, user)
    replacements["<mm-ack-posts-button>"] = mlist.FormatOptionButton(mm_cfg.AcknowledgePosts, 1, user)
    replacements["<mm-receive-own-mail-button>"] = mlist.FormatOptionButton(mm_cfg.DontReceiveOwnPosts, 0, user)
    replacements["<mm-dont-receive-own-mail-button>"] = mlist.FormatOptionButton(mm_cfg.DontReceiveOwnPosts, 1, user)
    replacements["<mm-dont-get-password-reminder-button>"] = mlist.FormatOptionButton(
        mm_cfg.SuppressPasswordReminder, 1, user
    )
    replacements["<mm-get-password-reminder-button>"] = mlist.FormatOptionButton(
        mm_cfg.SuppressPasswordReminder, 0, user
    )
    replacements["<mm-public-subscription-button>"] = mlist.FormatOptionButton(mm_cfg.ConcealSubscription, 0, user)
    replacements["<mm-hide-subscription-button>"] = mlist.FormatOptionButton(mm_cfg.ConcealSubscription, 1, user)
    replacements["<mm-dont-receive-duplicates-button>"] = mlist.FormatOptionButton(
        mm_cfg.DontReceiveDuplicates, 1, user
    )
    replacements["<mm-receive-duplicates-button>"] = mlist.FormatOptionButton(mm_cfg.DontReceiveDuplicates, 0, user)
    replacements["<mm-unsubscribe-button>"] = (
        mlist.FormatButton("unsub", _("Unsubscribe"))
        + "<br>"
        + CheckBox("unsubconfirm", 1, checked=0).Format()
        + _("<em>Yes, I really want to unsubscribe</em>")
    )
    replacements["<mm-new-pass-box>"] = mlist.FormatSecureBox("newpw")
    replacements["<mm-confirm-pass-box>"] = mlist.FormatSecureBox("confpw")
    replacements["<mm-change-pass-button>"] = mlist.FormatButton("changepw", _("Change My Password"))
    replacements["<mm-other-subscriptions-submit>"] = mlist.FormatButton("othersubs", _("List my other subscriptions"))
    replacements["<mm-form-start>"] = mlist.FormatFormStart("options", user)
    replacements["<mm-user>"] = user
    replacements["<mm-presentable-user>"] = presentable_user
    replacements["<mm-email-my-pw>"] = mlist.FormatButton("emailpw", (_("Email My Password To Me")))
    replacements["<mm-umbrella-notice>"] = mlist.FormatUmbrellaNotice(user, _("password"))
    replacements["<mm-logout-button>"] = mlist.FormatButton("logout", _("Log out"))
    replacements["<mm-options-submit-button>"] = mlist.FormatButton("options-submit", _("Submit My Changes"))
    replacements["<mm-global-pw-changes-button>"] = CheckBox("pw-globally", 1, checked=0).Format()
    replacements["<mm-global-deliver-button>"] = CheckBox("deliver-globally", 1, checked=0).Format()
    replacements["<mm-global-remind-button>"] = CheckBox("remind-globally", 1, checked=0).Format()
    replacements["<mm-global-nodupes-button>"] = CheckBox("nodupes-globally", 1, checked=0).Format()

    days = int(mm_cfg.PENDING_REQUEST_LIFE / mm_cfg.days(1))
    if days > 1:
        units = _("days")
    else:
        units = _("day")
    replacements["<mm-pending-days>"] = _("%(days)d %(units)s")

    replacements["<mm-new-address-box>"] = mlist.FormatBox("new-address")
    replacements["<mm-confirm-address-box>"] = mlist.FormatBox("confirm-address")
    replacements["<mm-change-address-button>"] = mlist.FormatButton(
        "change-of-address", _("Change My Address and Name")
    )
    replacements["<mm-global-change-of-address>"] = CheckBox("changeaddr-globally", 1, checked=0).Format()
    replacements["<mm-fullname-box>"] = mlist.FormatBox("fullname", value=fullname)

    # Create the topics radios.  BAW: what if the list admin deletes a topic,
    # but the user still wants to get that topic message?
    usertopics = mlist.getMemberTopics(user)
    if mlist.topics:
        table = Table(border="0")
        for name, pattern, description, emptyflag in mlist.topics:
            if emptyflag:
                continue
            quotedname = urllib.quote_plus(name)
            details = Link(mlist.GetScriptURL("options") + "/%s/?VARHELP=%s" % (user, quotedname), " (Details)")
            if name in usertopics:
                checked = 1
            else:
                checked = 0
            table.AddRow([CheckBox("usertopic", quotedname, checked=checked), name + details.Format()])
        topicsfield = table.Format()
    else:
        topicsfield = _("<em>No topics defined</em>")
    replacements["<mm-topics>"] = topicsfield
#.........这里部分代码省略.........
开发者ID:KWMSources,项目名称:mailman_config,代码行数:103,代码来源:options.py

示例15: escape

# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import uncanonstr [as 别名]
    def escape(self, value):
        # transforms accents into html entities (&#233;)
        # TODO: find out which language is current (here: assumes iso-8859-1)
        value = Utils.uncanonstr(value)

        return value
开发者ID:Codendi,项目名称:mailman-codendi-ff,代码行数:8,代码来源:ExternalConnector.py


注:本文中的Mailman.Utils.uncanonstr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。