本文整理汇总了Python中mailpile.Mailpile.contact_list方法的典型用法代码示例。如果您正苦于以下问题:Python Mailpile.contact_list方法的具体用法?Python Mailpile.contact_list怎么用?Python Mailpile.contact_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mailpile.Mailpile
的用法示例。
在下文中一共展示了Mailpile.contact_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: assert
# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import contact_list [as 别名]
mp.set('prefs/openpgp_header = encrypt')
# Set up dummy conctact importer fortesting, disable Gravatar
mp.set('prefs/vcard/importers/demo/0/name = Mr. Rogers')
mp.set('prefs/vcard/importers/gravatar/0/active = false')
mp.set('prefs/vcard/importers/gpg/0/active = false')
# Make sure that actually worked
assert(not mp._config.prefs.vcard.importers.gpg[0].active)
assert(not mp._config.prefs.vcard.importers.gravatar[0].active)
# Do we have a Mr. Rogers contact?
mp.rescan('vcards')
assert(mp.contact('[email protected]'
).result['contact']['fn'] == u'Mr. Rogers')
assert(len(mp.contact_list('rogers').result['contacts']) == 1)
# Add the mailboxes, scan them
for mailbox in ('tests.mbx', 'Maildir'):
mp.add(os.path.join(mailpile_test, mailbox))
mp.rescan()
# Save and load the index, just for kicks
messages = len(mp._config.index.INDEX)
assert(messages > 5)
mp._config.index.save(mp._session)
mp._session.ui.reset_marks()
mp._config.index.load(mp._session)
mp._session.ui.reset_marks()
assert(len(mp._config.index.INDEX) == messages)
示例2: len
# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import contact_list [as 别名]
mp.set("profiles/0/route = |%s -i %%(rcpt)s" % mailpile_send)
mp.set("sys/debug = sendmail log compose")
# Set up dummy conctact importer fortesting, disable Gravatar
mp.set("prefs/vcard/importers/demo/0/name = Mr. Rogers")
mp.set("prefs/vcard/importers/gravatar/0/active = false")
mp.set("prefs/vcard/importers/gpg/0/active = false")
# Make sure that actually worked
assert not mp._config.prefs.vcard.importers.gpg[0].active
assert not mp._config.prefs.vcard.importers.gravatar[0].active
# Do we have a Mr. Rogers contact?
mp.rescan("vcards")
assert mp.contact("[email protected]").result["contact"]["fn"] == u"Mr. Rogers"
assert len(mp.contact_list("rogers").result["contacts"]) == 1
# Add the mailboxes, scan them
for mailbox in ("tests.mbx", "Maildir"):
mp.add(os.path.join(mailpile_test, mailbox))
mp.rescan()
# Save and load the index, just for kicks
messages = len(mp._config.index.INDEX)
assert messages > 5
mp._config.index.save(mp._session)
mp._session.ui.reset_marks()
mp._config.index.load(mp._session)
mp._session.ui.reset_marks()
assert len(mp._config.index.INDEX) == messages