本文整理汇总了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()
示例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()
示例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()
示例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
示例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])
示例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):
示例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()
示例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()