本文整理汇总了Python中Mailman.Utils.strip_verbose_pattern方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.strip_verbose_pattern方法的具体用法?Python Utils.strip_verbose_pattern怎么用?Python Utils.strip_verbose_pattern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mailman.Utils
的用法示例。
在下文中一共展示了Utils.strip_verbose_pattern方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UpdateOldVars
# 需要导入模块: from Mailman import Utils [as 别名]
# 或者: from Mailman.Utils import strip_verbose_pattern [as 别名]
#.........这里部分代码省略.........
if hasattr(l, "open_subscribe"):
if l.open_subscribe:
if mm_cfg.ALLOW_OPEN_SUBSCRIBE:
l.subscribe_policy = 0
else:
l.subscribe_policy = 1
else:
l.subscribe_policy = 2 # admin approval
delattr(l, "open_subscribe")
if not hasattr(l, "administrivia"):
setattr(l, "administrivia", mm_cfg.DEFAULT_ADMINISTRIVIA)
if not hasattr(l, "admin_member_chunksize"):
setattr(l, "admin_member_chunksize",
mm_cfg.DEFAULT_ADMIN_MEMBER_CHUNKSIZE)
#
# this attribute was added then deleted, so there are a number of
# cases to take care of
#
if hasattr(l, "posters_includes_members"):
if l.posters_includes_members:
if l.posters:
l.member_posting_only = 1
else:
if l.posters:
l.member_posting_only = 0
delattr(l, "posters_includes_members")
elif l.data_version <= 10 and l.posters:
# make sure everyone gets the behavior the list used to have, but only
# for really old versions of Mailman (1.0b5 or before). Any newer
# version of Mailman should not get this attribute whacked.
l.member_posting_only = 0
#
# transfer the list data type for holding members and digest members
# to the dict data type starting file format version 11
#
if type(l.members) is ListType:
members = {}
for m in l.members:
members[m] = 1
l.members = members
if type(l.digest_members) is ListType:
dmembers = {}
for dm in l.digest_members:
dmembers[dm] = 1
l.digest_members = dmembers
#
# set admin_notify_mchanges
#
if not hasattr(l, "admin_notify_mchanges"):
setattr(l, "admin_notify_mchanges",
mm_cfg.DEFAULT_ADMIN_NOTIFY_MCHANGES)
#
# Convert the members and digest_members addresses so that the keys of
# both these are always lowercased, but if there is a case difference, the
# value contains the case preserved value
#
for k in l.members.keys():
if k.lower() <> k:
l.members[k.lower()] = Utils.LCDomain(k)
del l.members[k]
elif type(l.members[k]) == StringType and k == l.members[k].lower():
# already converted
pass
else:
l.members[k] = 0
for k in l.digest_members.keys():
if k.lower() <> k:
l.digest_members[k.lower()] = Utils.LCDomain(k)
del l.digest_members[k]
elif type(l.digest_members[k]) == StringType and \
k == l.digest_members[k].lower():
# already converted
pass
else:
l.digest_members[k] = 0
#
# Convert pre 2.2 topics regexps which were compiled in verbose mode
# to a non-verbose equivalent.
#
if stored_state['data_version'] < 106 and stored_state.has_key('topics'):
l.topics = []
for name, pattern, description, emptyflag in stored_state['topics']:
pattern = Utils.strip_verbose_pattern(pattern)
l.topics.append((name, pattern, description, emptyflag))
#
# Romanian and Russian had their character sets changed in 2.1.19
# to utf-8. If there are any strings in the old encoding, try to recode
# them.
#
if stored_state['data_version'] < 108:
if l.preferred_language == 'ro':
if Utils.GetCharSet('ro') == 'utf-8':
recode(l, 'iso-8859-2', 'utf-8')
if l.preferred_language == 'ru':
if Utils.GetCharSet('ru') == 'utf-8':
recode(l, 'koi8-r', 'utf-8')
#
# from_is_list was called author_is_list in 2.1.16rc2 (only).
PreferStored('author_is_list', 'from_is_list',
mm_cfg.DEFAULT_FROM_IS_LIST)