本文整理匯總了Python中mailpile.Mailpile.setup方法的典型用法代碼示例。如果您正苦於以下問題:Python Mailpile.setup方法的具體用法?Python Mailpile.setup怎麽用?Python Mailpile.setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mailpile.Mailpile
的用法示例。
在下文中一共展示了Mailpile.setup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Mailpile
# 需要導入模塊: from mailpile import Mailpile [as 別名]
# 或者: from mailpile.Mailpile import setup [as 別名]
from mailpile.plugins import *
from mailpile import Mailpile
##[ Black-box test script ]###################################################
try:
# First, we set up a pristine Mailpile
os.system('rm -rf %s' % mailpile_home)
mp = Mailpile(workdir=mailpile_home)
def say(stuff):
mp._session.ui.mark(stuff)
mp._session.ui.reset_marks()
# Set up initial tags and such
mp.setup()
# 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
mp._config.index.save()
mp._config.index.load()
# Rescan AGAIN, so we can test for the presence of duplicates.
mp.rescan()
# Search for things, there should be exactly one match for each.
mp.order('flat-date')