當前位置: 首頁>>代碼示例>>Python>>正文


Python mailpile.Mailpile類代碼示例

本文整理匯總了Python中mailpile.Mailpile的典型用法代碼示例。如果您正苦於以下問題:Python Mailpile類的具體用法?Python Mailpile怎麽用?Python Mailpile使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Mailpile類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Mailpile

# Set up some paths
mailpile_root = os.path.join(os.path.dirname(__file__), '..')
mailpile_test = os.path.join(mailpile_root, 'testing')
mailpile_home = os.path.join(mailpile_test, 'tmp')

# Add the root to our import path, import API and standard plugins
sys.path.append(mailpile_root)
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()
開發者ID:raulelrey86,項目名稱:Mailpile,代碼行數:31,代碼來源:mailpile-test.py

示例2: Mailpile

from mailpile import Mailpile


##[ Black-box test script ]###################################################

FROM_BRE = [u'from:r\xfanar', u'from:bjarni']
ICELANDIC = u'r\xfanar'
IS_CHARS = (u'\xe1\xe9\xed\xf3\xfa\xfd\xfe\xe6\xf6\xf0\xc1\xc9\xcd\xd3'
            u'\xda\xdd\xde\xc6\xd6\xd0')
MY_FROM = '[email protected]'
MY_NAME = 'Mailpile Team'
MY_KEYID = '0x7848252F'

# First, we set up a pristine Mailpile
os.system('rm -rf %s' % mailpile_home)
mp = Mailpile(workdir=mailpile_home)
cfg = config = mp._session.config
ui = mp._session.ui

if '-v' not in sys.argv:
    from mailpile.ui import SilentInteraction
    mp._session.ui = SilentInteraction(config)

cfg.plugins.load('demos', process_manifest=True)
cfg.plugins.load('hacks', process_manifest=True)
cfg.plugins.load('smtp_server', process_manifest=True)


def contents(fn):
    return open(fn, 'r').read()
開發者ID:paulfurley,項目名稱:Mailpile,代碼行數:30,代碼來源:mailpile-test.py

示例3: Mailpile

from mailpile import Mailpile


##[ Black-box test script ]###################################################

FROM_BRE = [u'from:r\xfanar', u'from:bjarni']
ICELANDIC = u'r\xfanar'
IS_CHARS = (u'\xe1\xe9\xed\xf3\xfa\xfd\xfe\xe6\xf6\xf0\xc1\xc9\xcd\xd3'
            u'\xda\xdd\xde\xc6\xd6\xd0')
MY_FROM = '[email protected]'
MY_NAME = 'Mailpile Team'
MY_KEYID = '0x7848252F'

# First, we set up a pristine Mailpile
os.system('rm -rf %s' % mailpile_home)
mp = Mailpile(workdir=mailpile_home)
cfg = config = mp._session.config
ui = mp._session.ui

if '-v' not in sys.argv:
    from mailpile.ui import SilentInteraction
    mp._session.ui = SilentInteraction(config)

cfg.plugins.load('demos', process_manifest=True)
cfg.plugins.load('hacks', process_manifest=True)
cfg.plugins.load('experiments', process_manifest=True)
cfg.plugins.load('smtp_server', process_manifest=True)


def contents(fn):
    return open(fn, 'r').read()
開發者ID:DoubleMalt,項目名稱:Mailpile,代碼行數:31,代碼來源:mailpile-test.py

示例4: Mailpile

mailpile_sent = os.path.join(mailpile_home, 'sent.mbx')

# Add the root to our import path, import API and standard plugins
sys.path.append(mailpile_root)
from mailpile.plugins import *
from mailpile import Mailpile


##[ Black-box test script ]###################################################

FROM_BRE = [u'from:r\xfanar', u'from:bjarni']
MY_FROM = '[email protected]'
try:
    # First, we set up a pristine Mailpile
    os.system('rm -rf %s' % mailpile_home)
    mp = Mailpile(workdir=mailpile_home)

    def contents(fn):
        return open(fn, 'r').read()

    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
開發者ID:arttarawork,項目名稱:Mailpile-1,代碼行數:31,代碼來源:mailpile-test.py

示例5: Mailpile

os.environ['GNUPGHOME'] = mailpile_gpgh

# Add the root to our import path, import API and demo plugins
sys.path.append(mailpile_root)
import mailpile.plugins.demos
from mailpile import Mailpile


##[ Black-box test script ]###################################################

FROM_BRE = [u'from:r\xfanar', u'from:bjarni']
MY_FROM = '[email protected]'

# First, we set up a pristine Mailpile
os.system('rm -rf %s' % mailpile_home)
mp = Mailpile(workdir=mailpile_home)
cfg = config = mp._session.config


def contents(fn):
    return open(fn, 'r').read()


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])

開發者ID:crameth,項目名稱:Mailpile,代碼行數:29,代碼來源:mailpile-test.py

示例6: Mailpile

from mailpile.mail_source.local import LocalMailSource
from mailpile import Mailpile


##[ Black-box test script ]###################################################

FROM_BRE = [u"from:r\xfanar", u"from:bjarni"]
ICELANDIC = u"r\xfanar"
IS_CHARS = u"\xe1\xe9\xed\xf3\xfa\xfd\xfe\xe6\xf6\xf0\xc1\xc9\xcd\xd3" u"\xda\xdd\xde\xc6\xd6\xd0"
MY_FROM = "[email protected]"
MY_NAME = "Mailpile Team"
MY_KEYID = "0x7848252F"

# First, we set up a pristine Mailpile
os.system("rm -rf %s" % mailpile_home)
mp = Mailpile(workdir=mailpile_home)
cfg = config = mp._session.config
ui = mp._session.ui

if "-v" not in sys.argv:
    from mailpile.ui import SilentInteraction

    mp._session.ui = SilentInteraction(config)

cfg.plugins.load("demos", process_manifest=True)
cfg.plugins.load("hacks", process_manifest=True)
cfg.plugins.load("experiments", process_manifest=True)
cfg.plugins.load("smtp_server", process_manifest=True)


def contents(fn):
開發者ID:cybercameron,項目名稱:Mailpile,代碼行數:31,代碼來源:mailpile-test.py

示例7: Mailpile

mailpile_test = os.path.join(mailpile_root, 'testing')
mailpile_home = os.path.join(mailpile_test, 'tmp')

# Add the root to our import path, import API and standard plugins
sys.path.append(mailpile_root)
from mailpile.plugins import *
from mailpile import Mailpile


##[ Black-box test script ]###################################################

FROM_BRE = [u'from:r\xfanar', u'from:bjarni']
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()
開發者ID:Biobeyoung,項目名稱:Mailpile,代碼行數:31,代碼來源:mailpile-test.py

示例8: Mailpile

from mailpile import Mailpile


##[ Black-box test script ]###################################################

FROM_BRE = [u'from:r\xfanar', u'from:bjarni']
ICELANDIC = u'r\xfanar'
IS_CHARS = (u'\xe1\xe9\xed\xf3\xfa\xfd\xfe\xe6\xf6\xf0\xc1\xc9\xcd\xd3'
            u'\xda\xdd\xde\xc6\xd6\xd0')
MY_FROM = '[email protected]'
MY_NAME = 'Mailpile Team'
MY_KEYID = '0x7848252F'

# First, we set up a pristine Mailpile
os.system('rm -rf {0!s}'.format(mailpile_home))
mp = Mailpile(workdir=mailpile_home)
cfg = config = mp._session.config
ui = mp._session.ui

if '-v' not in sys.argv:
    from mailpile.ui import SilentInteraction
    mp._session.ui = SilentInteraction(config)

cfg.plugins.load('demos', process_manifest=True)
cfg.plugins.load('hacks', process_manifest=True)
cfg.plugins.load('experiments', process_manifest=True)
cfg.plugins.load('smtp_server', process_manifest=True)


def contents(fn):
    return open(fn, 'r').read()
開發者ID:runt18,項目名稱:Mailpile,代碼行數:31,代碼來源:mailpile-test.py


注:本文中的mailpile.Mailpile類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。