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


Python Mailpile.set方法代码示例

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


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

示例1: do_setup

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import set [as 别名]
    do_setup()
    if '-n' not in sys.argv:
        test_vcards()
        test_load_save_rescan()
        test_message_data()
        test_html()
        test_composition()
        test_smtp()
        if '-v' not in sys.argv:
            sys.stderr.write("\nTests passed, woot!\n")
        else:
            say("Tests passed, woot!")
except:
    sys.stderr.write("\nTests FAILED!\n")
    print
    traceback.print_exc()


##[ Interactive mode ]########################################################

if '-i' in sys.argv:
    mp.set('prefs/vcard/importers/gravatar/0/active = true')
    mp.set('prefs/vcard/importers/gpg/0/active = true')
    mp._session.ui = ui
    print '%s' % mp.help_splash()
    mp.Interact()


##[ Cleanup ]#################################################################
os.system('rm -rf %s' % mailpile_home)
开发者ID:DoubleMalt,项目名称:Mailpile,代码行数:32,代码来源:mailpile-test.py

示例2: grepv

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import set [as 别名]
def grepv(w, fn):
    return '\n'.join([l for l in open(fn, 'r').readlines() if w not in l])


def say(stuff):
    mp._session.ui.mark(stuff)
    mp._session.ui.reset_marks()


try:
    # Set up initial tags and such
    mp.setup()

    # Configure our fake mail sending setup
    mp.set('profiles/0/email = %s' % MY_FROM)
    mp.set('profiles/0/name = Test Account')
    mp.set('profiles/0/route = |%s -i %%(rcpt)s' % mailpile_send)
    mp.set('sys/debug = sendmail log compose')
    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?
开发者ID:crameth,项目名称:Mailpile,代码行数:32,代码来源:mailpile-test.py

示例3: grep

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import set [as 别名]
    def grep(w, fn):
        return '\n'.join([l for l in open(fn, 'r').readlines() if w in l])

    def grepv(w, fn):
        return '\n'.join([l for l in open(fn, 'r').readlines() if w not in l])

    def say(stuff):
        mp._session.ui.mark(stuff)
        mp._session.ui.reset_marks()

    # Set up initial tags and such
    mp.setup()

    # Configure our fake mail sending setup
    mp.set('my_from: %s = Test Account' % MY_FROM)
    mp.set('my_sendmail: %s = |%s -i %%(rcpt)s' % (MY_FROM, mailpile_send))
    mp.set('debug = sendmail log compose')

    # 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()
开发者ID:arttarawork,项目名称:Mailpile-1,代码行数:31,代码来源:mailpile-test.py

示例4: grepv

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import set [as 别名]
def grepv(w, fn):
    return "\n".join([l for l in open(fn, "r").readlines() if w not in l])


def say(stuff):
    mp._session.ui.mark(stuff)
    mp._session.ui.reset_marks()


try:
    # Set up initial tags and such
    mp.setup()

    # Configure our fake mail sending setup
    mp.set("profiles/0/email = %s" % MY_FROM)
    mp.set("profiles/0/name = Test Account")
    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")
开发者ID:vinchu,项目名称:Mailpile,代码行数:32,代码来源:mailpile-test.py

示例5: grep

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import set [as 别名]
def grep(w, fn):
    return '\n'.join([l for l in open(fn, 'r').readlines() if w in l])

def grepv(w, fn):
    return '\n'.join([l for l in open(fn, 'r').readlines() if w not in l])

def say(stuff):
    mp._session.ui.mark(stuff)
    mp._session.ui.reset_marks()

try:
    # Set up initial tags and such
    mp.setup()

    # Configure our fake mail sending setup
    mp.set('profiles/0/email = %s' % MY_FROM)
    mp.set('profiles/0/name = Test Account')
    mp.set('profiles/0/route = |%s -i %%(rcpt)s' % mailpile_send)
    mp.set('sys/debug = sendmail log compose')

    # 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()
开发者ID:calpaterson,项目名称:Mailpile,代码行数:33,代码来源:mailpile-test.py

示例6: grep

# 需要导入模块: from mailpile import Mailpile [as 别名]
# 或者: from mailpile.Mailpile import set [as 别名]
def grep(w, fn):
    return '\n'.join([l for l in open(fn, 'r').readlines() if w in l])

def grepv(w, fn):
    return '\n'.join([l for l in open(fn, 'r').readlines() if w not in l])

def say(stuff):
    mp._session.ui.mark(stuff)
    mp._session.ui.reset_marks()

try:
    # Set up initial tags and such
    mp.setup()

    # Configure our fake mail sending setup
    mp.set('profiles/0/email = %s' % MY_FROM)
    mp.set('profiles/0/name = Test Account')
    mp.set('profiles/0/route = |%s -i %%(rcpt)s' % mailpile_send)
    mp.set('sys/debug = sendmail log compose')
    mp.set('prefs/vcard/importers/demo/0/name = Mr. Rogers')

    # 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.
开发者ID:RuuPiE,项目名称:Mailpile,代码行数:33,代码来源:mailpile-test.py


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