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


Python Mailpile.view方法代码示例

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


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

示例1: in

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import view [as 别名]
    mp.order('flat-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']):
        say('Searching for: %s' % search)
        results = mp.search(*search)
        assert(results.result['count'] == 1)

    # Make sure we are decoding weird headers correctly
    result_bre = mp.search(*FROM_BRE).result['messages'][0]
    result_bre = mp.view('=%s' % result_bre['mid']).result['messages'][0]
    say('Checking encoding: %s' % result_bre['from'])
    assert('=C3' not in result_bre['from'])
    say('Checking encoding: %s' % result_bre['message']['headers']['To'])
    assert('utf' not in result_bre['message']['headers']['To'])

    # Create a message...
    new_mid = mp.message_compose().result['messages'][0]['mid']
    assert(mp.search('tag:drafts').result['count'] == 0)
    assert(mp.search('tag:blank').result['count'] == 1)
    assert(mp.search('tag:sent').result['count'] == 0)
    assert(not os.path.exists(mailpile_sent))

    # Edit the message (moves from Blank to Draft, not findable in index)
    msg_data = {
      'from': [MY_FROM],
开发者ID:arttarawork,项目名称:Mailpile-1,代码行数:33,代码来源:mailpile-test.py

示例2: say

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import view [as 别名]
                    'tag:mp_sig-unknown', 'tag:mp_enc-decrypted'],
                   ):
        say('Searching for: %s' % search)
        results = mp.search(*search)
        assert(results.result['stats']['count'] == 1)

    say('Checking size of inbox')
    mp.order('flat-date')
    assert(mp.search('tag:inbox').result['stats']['count'] == 14)

    say('FIXME: Make sure message signatures verified')

    # Make sure we are decoding weird headers correctly
    search_bre = mp.search(*FROM_BRE).result
    result_bre = search_bre['data']['metadata'][search_bre['thread_ids'][0]]
    view_bre = mp.view('=%s' % result_bre['mid']).result
    metadata_bre = view_bre['data']['metadata'][view_bre['thread_ids'][0]]
    message_bre = view_bre['data']['messages'][view_bre['thread_ids'][0]]
    from_bre = search_bre['data']['addresses'][metadata_bre['from_aid']]
    say('Checking encoding: %s' % from_bre)
    assert('=C3' not in from_bre['fn'])
    assert('=C3' not in from_bre['address'])
    for key, val in message_bre['header_list']:
        if key.lower() not in ('from', 'to', 'cc'):
            continue
        say('Checking encoding: %s: %s' % (key, val))
        assert('utf' not in val)

    # Create a message...
    new_mid = mp.message_compose().result['thread_ids'][0]
    assert(mp.search('tag:drafts').result['stats']['count'] == 0)
开发者ID:crameth,项目名称:Mailpile,代码行数:33,代码来源:mailpile-test.py

示例3: say

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import view [as 别名]
        ["from:brennan", "subject:encrypted", "testing", "purposes", "only"],
    ):
        say("Searching for: %s" % search)
        results = mp.search(*search)
        assert results.result["stats"]["count"] == 1

    say("Checking size of inbox")
    mp.order("flat-date")
    assert mp.search("tag:inbox").result["stats"]["count"] == 13

    say("FIXME: Make sure message signatures verified")

    # Make sure we are decoding weird headers correctly
    search_bre = mp.search(*FROM_BRE).result
    result_bre = search_bre["data"]["metadata"][search_bre["thread_ids"][0]]
    view_bre = mp.view("=%s" % result_bre["mid"]).result
    metadata_bre = view_bre["data"]["metadata"][view_bre["thread_ids"][0]]
    message_bre = view_bre["data"]["messages"][view_bre["thread_ids"][0]]
    from_bre = search_bre["data"]["addresses"][metadata_bre["from_aid"]]
    say("Checking encoding: %s" % from_bre)
    assert "=C3" not in from_bre["fn"]
    assert "=C3" not in from_bre["address"]
    for key, val in message_bre["header_list"]:
        if key.lower() not in ("from", "to", "cc"):
            continue
        say("Checking encoding: %s: %s" % (key, val))
        assert "utf" not in val

    # Create a message...
    new_mid = mp.message_compose().result["thread_ids"][0]
    assert mp.search("tag:drafts").result["stats"]["count"] == 0
开发者ID:vinchu,项目名称:Mailpile,代码行数:33,代码来源:mailpile-test.py


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