本文整理汇总了Python中mailpile.Mailpile.order方法的典型用法代码示例。如果您正苦于以下问题:Python Mailpile.order方法的具体用法?Python Mailpile.order怎么用?Python Mailpile.order使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mailpile.Mailpile
的用法示例。
在下文中一共展示了Mailpile.order方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: in
# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import order [as 别名]
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')
for search in (['from:wow'],
['agirorn'],
['subject:emerging'],
['from:twitter', 'brennan'],
['dates:2013-09-17', 'feministinn'],
['att:jpg', 'fimmtudaginn'],
['subject:Moderation', 'kde-isl']):
say('Searching for: %s' % search)
results = mp.search(*search)
assert(len(results.result) == 1)
assert(results.result[0]['count'] == 1)
say("Tests passed, woot!")
except:
say("Tests FAILED!")
示例2: len
# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import order [as 别名]
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
# 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("rev-date")
for search in (
FROM_BRE,
["agirorn"],
["subject:emerging"],
["from:twitter", "brennan"],
["dates:2013-09-17", "feministinn"],
["mailbox:tests.mbx"] + FROM_BRE,
["att:jpg", "fimmtudaginn"],
["subject:Moderation", "kde-isl"],
["from:bjarni", "subject:testing", "subject:encryption", "should", "encrypted", "message"],
["from:bjarni", "subject:inline", "subject:encryption"],
["from:bjarni", "subject:signatures"],
["from:brennan", "subject:signed"],
["from:brennan", "subject:encrypted", "testing", "purposes", "only"],
):