本文整理汇总了Python中trac.notification.NotifyEmail类的典型用法代码示例。如果您正苦于以下问题:Python NotifyEmail类的具体用法?Python NotifyEmail怎么用?Python NotifyEmail使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NotifyEmail类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: notifyTaskEvent
def notifyTaskEvent(self, task_event_list):
"""
Send task event by mail if recipients is defined in trac.ini
"""
self.env.log.debug("notifying task event...")
if self.cronconf.get_email_notifier_task_recipient() :
# prepare the data for the email content generation
mess = ""
start = True
for event in task_event_list:
if start:
mess = mess + "task[%s]" % (event.task.getId(),)
mess = mess + "\nstarted at %d h %d" % (event.time.tm_hour, event.time.tm_min)
mess = mess + "\n"
else:
mess = mess + "ended at %d h %d" % (event.time.tm_hour, event.time.tm_min)
if (event.success):
mess = mess + "\nsuccess"
else:
mess = mess + "\nFAILURE"
mess = mess + "\n\n"
start = not start
self.data.update({
"notify_body": mess,
})
NotifyEmail.notify(self, None, "task event notification")
else:
self.env.log.debug("no recipient for task event, aborting")
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:29,代码来源:listener.py
示例2: __init__
def __init__(self, env):
NotifyEmail.__init__(self, env)
self.prev_cc = []
self.ambiguous_char_width = env.config.get('notification',
'ambiguous_char_width',
'single')
self.text_widths = {}
开发者ID:zjj,项目名称:trac_hack,代码行数:7,代码来源:notification.py
示例3: notify_unreachable_milestone
def notify_unreachable_milestone(self, tickets):
"""
Send a digest mail listing all tickets still opened in the milestone
"""
self.populate_unreachable_tickets_data(tickets)
NotifyEmail.notify(self, self.milestone, "Milestone %s still has opened ticket" % self.milestone)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:7,代码来源:task.py
示例4: __init__
def __init__(self, env):
NotifyEmail.__init__(self, env)
self.prev_cc = []
ambiguous_char_width = env.config.get('notification',
'ambiguous_char_width',
'single')
self.ambiwidth = 2 if ambiguous_char_width == 'double' else 1
开发者ID:dinhkhanh,项目名称:trac,代码行数:7,代码来源:notification.py
示例5: invite
def invite(self, context, forum = None, topic = None, recipients = []):
# Store link to currently notifying forum.
self.forum = forum
self.topic = topic
# Initialize template data.
data = {}
data['forum'] = self.forum
data['topic'] = self.topic
data['prefix'] = self.config.get('notification', 'smtp_subject_prefix')
if data['prefix'] == '__default__':
data['prefix'] = self.env.project_name
self.data.update({'discussion' : data})
# Which item notify about?
if self.topic:
self.topic['link'] = self.env.abs_href.discussion('topic',
self.topic['id'])
self.template_name = 'topic-invite-body.txt'
elif self.forum:
self.forum['link'] = self.env.abs_href.discussion('forum',
self.forum['id'])
self.template_name = 'forum-invite-body.txt'
# Send e-mail to all subscribers.
self.cc_recipients = recipients
# Render subject template and send notification.
subject = (to_unicode(Chrome(self.env).render_template(context.req,
self.topic and 'topic-invite-subject.txt' or
'forum-invite-subject.txt', self.data, 'text/plain'))).strip()
NotifyEmail.notify(self, id, subject)
开发者ID:okamototk,项目名称:kanonconductor,代码行数:32,代码来源:notification.py
示例6: send
def send(self, torcpts, ccrcpts):
header = {}
# Add item specific e-mail header fields.
if self.message:
# Get this messge ID.
header['Message-ID'] = self.get_message_id(self.forum['id'],
self.topic['id'], self.message['id'])
header['X-Trac-Message-ID'] = to_unicode(self.message['id'])
header['X-Trac-Discussion-URL'] = self.message['link']
# Get replied message ID.
reply_id = self.get_message_id(self.forum['id'], self.topic['id'],
self.message['replyto'])
header['In-Reply-To'] = reply_id
header['References'] = reply_id
else:
# Get this message ID.
header['Message-ID'] = self.get_message_id(self.forum['id'],
self.topic['id'], 0)
header['X-Trac-Topic-ID'] = to_unicode(self.topic['id'])
header['X-Trac-Discussion-URL'] = self.topic['link']
# Send e-mail.
NotifyEmail.send(self, torcpts, ccrcpts, header)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:25,代码来源:notification.py
示例7: send
def send(self, to_recipients, cc_recipients):
header = {}
# Add item specific e-mail header fields.
if self.message:
# ID of the message.
header["Message-ID"] = self.get_message_email_id(self.message["id"])
header["X-Trac-Message-ID"] = to_unicode(self.message["id"])
header["X-Trac-Discussion-URL"] = self.message["link"]
# ID of replied message.
if self.message["replyto"] != -1:
reply_id = self.get_message_email_id(self.message["replyto"])
else:
reply_id = self.get_topic_email_id(self.message["topic"])
header["In-Reply-To"] = reply_id
header["References"] = reply_id
elif self.topic:
# ID of the message.
header["Message-ID"] = self.get_topic_email_id(self.topic["id"])
header["X-Trac-Topic-ID"] = to_unicode(self.topic["id"])
header["X-Trac-Discussion-URL"] = self.topic["link"]
elif self.forum:
# ID of the message.
header["Message-ID"] = self.get_forum_email_id(self.forum["id"])
header["X-Trac-Forum-ID"] = to_unicode(self.forum["id"])
header["X-Trac-Discussion-URL"] = self.forum["link"]
else:
# Should not happen.
raise TracError("DiscussionPlugin internal error.")
# Send e-mail.
self.template = Chrome(self.env).load_template(self.template_name, method="text")
self.env.log.debug("to_recipients: %s cc_recipients: %s" % (to_recipients, cc_recipients))
NotifyEmail.send(self, to_recipients, cc_recipients, header)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:35,代码来源:notification.py
示例8: notify
def notify(self, build):
self.build = build
self.data.update(self.template_data())
subject = '[%s Build] %s [%s] %s' % (self.readable_states[build.status],
self.env.project_name,
self.build.rev,
self.build.config)
NotifyEmail.notify(self, self.build.id, subject)
开发者ID:lkraav,项目名称:trachacks,代码行数:8,代码来源:notify.py
示例9: __init__
def __init__(self, env, subject=None, data=None):
NotifyEmail.__init__(self, env)
self.to = []
self.cc = []
self.from_email = env.config.get("notification", "smtp_from")
self.subject = subject or ""
# If string given, place it into body variable, otherwise use dict or empty dict
self.data = {"body": data} if isinstance(data, basestring) else data or {}
开发者ID:nagyistoce,项目名称:trac-multiproject,代码行数:8,代码来源:email.py
示例10: notify_opened_ticket
def notify_opened_ticket(self, owner, tickets):
"""
Send a digest mail to ticket owner
about ticket still opened
"""
self.populate_unreachable_tickets_data(tickets)
NotifyEmail.notify(self, owner, "Milestone %s still has opened ticket" % self.milestone)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:8,代码来源:task.py
示例11: __init__
def __init__(self, env):
NotifyEmail.__init__(self, env)
self.from_name = self.config.get('fullblog-notification', 'from_name')
self.from_email = self.config.get('fullblog-notification', 'from_email')
self.reply_to_email = self.config.get('fullblog-notification', 'reply_to_email') or self.from_email
self.notification_actions = self.config.getlist('fullblog-notification',
'notification_actions')
self.no_notification_categories = self.config.getlist('fullblog-notification',
'no_notification_categories')
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:9,代码来源:notification.py
示例12: __init__
def __init__(self, env, recipient, body, link):
NotifyEmail.__init__(self, env)
self.recipient = recipient
self.data = {
'body': body,
'link': link,
'project_name': env.project_name,
'project_url': env.project_url or self.env.abs_href(),
}
开发者ID:centaurustech,项目名称:bountyfunding,代码行数:9,代码来源:bountyfunding.py
示例13: notify
def notify(self, username, subject):
# save the username for use in `get_smtp_address`
self._username = username
old_public_cc = self.config.getbool('notification', 'use_public_cc')
# override public cc option so that the user's email is included in the To: field
self.config.set('notification', 'use_public_cc', 'true')
try:
NotifyEmail.notify(self, username, subject)
finally:
self.config.set('notification', 'use_public_cc', old_public_cc)
开发者ID:okamototk,项目名称:kanonconductor,代码行数:10,代码来源:notification.py
示例14: notify
def notify(self, username, password):
# save the username for use in `get_smtp_address`
self._username = username
self.hdf['account.username'] = username
self.hdf['account.password'] = password
self.hdf['login.link'] = self.env.abs_href.login()
projname = self.config.get('project', 'name')
subject = '[%s] Trac password reset for user: %s' % (projname, username)
NotifyEmail.notify(self, username, subject)
开发者ID:lkraav,项目名称:trachacks,代码行数:11,代码来源:web_ui.py
示例15: __init__
def __init__(self, env, data, template_name=None):
NotifyEmail.__init__(self, env)
locale_dir = pkg_resources.resource_filename(__name__, 'locale')
add_domain(self.env.path, locale_dir)
if template_name:
self.template_name = template_name
self._data = data
if self._data and self._data['user_data']:
# self._locale_string = self._data['user_data']['language'] # not used at the moment
self._email_adr = self._data['user_data']['email']
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:11,代码来源:XMailEMailModule.py
示例16: send
def send(self, torcpts, ccrcpts):
dest = self.reporter or 'anonymous'
hdrs = {}
hdrs['Message-ID'] = self.get_message_id(dest, self.modtime)
hdrs['X-Trac-Ticket-ID'] = str(self.ticket.id)
hdrs['X-Trac-Ticket-URL'] = self.ticket['link']
if not self.newticket:
msgid = self.get_message_id(dest)
hdrs['In-Reply-To'] = msgid
hdrs['References'] = msgid
NotifyEmail.send(self, torcpts, ccrcpts, hdrs)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:11,代码来源:notification.py
示例17: notify
def notify(self, build_info):
self.build_info = build_info
self.data = self.build_info
subject = '[%s Build] %s [%s] %s' % (self.build_info.status,
self.env.project_name,
self.build_info.changeset,
self.build_info.config)
stream = self.template.generate(**self.data)
body = stream.render('text')
self.env.log.debug('notification: %s' % body )
NotifyEmail.notify(self, self.build_info.id, subject)
开发者ID:blaxter,项目名称:Bitten,代码行数:11,代码来源:notify.py
示例18: send
def send(self, torcpts, ccrcpts):
dest = self.reporter or "anonymous"
hdrs = {}
hdrs["Message-ID"] = self.get_message_id(dest, self.modtime)
hdrs["X-Trac-Ticket-ID"] = str(self.ticket.id)
hdrs["X-Trac-Ticket-URL"] = self.data["ticket"]["link"]
if not self.newticket:
msgid = self.get_message_id(dest)
hdrs["In-Reply-To"] = msgid
hdrs["References"] = msgid
NotifyEmail.send(self, torcpts, ccrcpts, hdrs)
开发者ID:wiraqutra,项目名称:photrackjp,代码行数:11,代码来源:notification.py
示例19: notify
def notify(self, to, key):
addr = self.get_smtp_address(to)
if addr is None:
raise TracError('Invalid email address %s'%to)
self.hdf['to'] = addr
self.hdf['key'] = key
subject = 'TracBL API key for %s'%addr
NotifyEmail.notify(self, addr, subject)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:12,代码来源:model.py
示例20: __init__
def __init__(self, env, project, message, authname):
NotifyEmail.__init__(self, env)
self.from_email = env.config.get('notification', 'smtp_from')
add_auth_url = project.get_url() + "admin/general/permissions"
self.project = project
self.env = env
self.data = {'project_name': project.project_name,
'message': message,
'authname': authname,
'add_auth_url': add_auth_url}
开发者ID:alvabai,项目名称:trac-multiproject,代码行数:12,代码来源:api.py
注:本文中的trac.notification.NotifyEmail类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论