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


Python TicketNotifyEmail.get_recipients方法代码示例

本文整理汇总了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)
开发者ID:michela,项目名称:TracShot,代码行数:35,代码来源:sms.py

示例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)
开发者ID:michela,项目名称:TracShot,代码行数:16,代码来源:sms.py

示例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)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:20,代码来源:teams.py


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