本文整理汇总了Python中trac.ticket.notification.TicketNotifyEmail.get_recipients方法的典型用法代码示例。如果您正苦于以下问题:Python TicketNotifyEmail.get_recipients方法的具体用法?Python TicketNotifyEmail.get_recipients怎么用?Python TicketNotifyEmail.get_recipients使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.ticket.notification.TicketNotifyEmail
的用法示例。
在下文中一共展示了TicketNotifyEmail.get_recipients方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ticket_changed
# 需要导入模块: from trac.ticket.notification import TicketNotifyEmail [as 别名]
# 或者: from trac.ticket.notification.TicketNotifyEmail import get_recipients [as 别名]
def ticket_changed(self,ticket,comment,author,old_values):
self.env.log.debug("ticket_change - TicketNotifySMS: %s" % author)
# Q) why does debug work on DEBUG setting but not INFO?
db = self.env.get_db_cnx()
cursor = db.cursor()
sql = "select field, newvalue from ticket_change where ticket = %s ORDER BY time DESC LIMIT 1" % ticket.id
cursor.execute(sql)
data = cursor.fetchall()
msg = ''
for row in data:
# TODO check alerts aren't needed on other fields
if row[0] == 'comment':
patt = re.compile('{{{(.+)}}}')
mobj = patt.match(row[1])
self.env.log.debug('comment value: ' + row[1])
body = ''
try:
body = mobj.group(0)
except AttributeError:
self.env.log.debug('no brackets')
body = row[1]
msg = "Re: shot %s - %s" % (ticket.values['summary'], body )
# ticket.id if necessary
tne = TicketNotifyEmail(self.env)
peeps = tne.get_recipients(ticket.id)
list = {}
for person in peeps:
for p in person:
list[p] = 1
for k in list.keys():
self.env.log.debug("recepient: %s" % k)
if k != None:
self.sms(k, str(ticket.time_changed), ticket.values['summary'], msg)
示例2: ticket_created
# 需要导入模块: from trac.ticket.notification import TicketNotifyEmail [as 别名]
# 或者: from trac.ticket.notification.TicketNotifyEmail import get_recipients [as 别名]
def ticket_created(self, ticket):
self.env.log.debug("ticket_created - TicketNotifySMS")
# Q) why does debug work on DEBUG setting but not INFO?
msg = "New render #%s (%s) uploaded" % (ticket.id, ticket.values['summary'])
tne = TicketNotifyEmail(self.env)
peeps = tne.get_recipients(ticket.id)
list = {}
for person in peeps:
for p in person:
list[p] = 1
for k in list.keys():
self.env.log.debug("recepient: %s" % k)
if k != None:
self.sms(k, str(ticket.time_changed), ticket.values['summary'], msg)
示例3: get_recipients
# 需要导入模块: from trac.ticket.notification import TicketNotifyEmail [as 别名]
# 或者: from trac.ticket.notification.TicketNotifyEmail import get_recipients [as 别名]
def get_recipients(self, tktid):
(torcpts, ccrcpts) = TicketNotifyEmail.get_recipients(self, tktid)
newtolist = []
newcclist = []
for notify in self.team_torcpts:
if notify not in torcpts and notify not in ccrcpts:
newtolist.append(notify)
for notify in self.team_ccrcpts:
if notify not in torcpts and notify not in ccrcpts:
newcclist.append(notify)
self.env.log.debug("Default To: %s" % (torcpts))
self.env.log.debug("Changed To: %s" % (newtolist))
self.env.log.debug("Default CC: %s" % (ccrcpts))
self.env.log.debug("Changed CC: %s" % (newcclist))
return (newtolist, newcclist)