本文整理汇总了Python中trac.ticket.Ticket.values['estimatedhours']方法的典型用法代码示例。如果您正苦于以下问题:Python Ticket.values['estimatedhours']方法的具体用法?Python Ticket.values['estimatedhours']怎么用?Python Ticket.values['estimatedhours']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.ticket.Ticket
的用法示例。
在下文中一共展示了Ticket.values['estimatedhours']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_ticket_for_lineitem
# 需要导入模块: from trac.ticket import Ticket [as 别名]
# 或者: from trac.ticket.Ticket import values['estimatedhours'] [as 别名]
def create_ticket_for_lineitem (self, req, id, addMesage, lineitem, summary=None):
#skip line items that have a ticket
if re.search('/ticket/\d+', lineitem.description): return
compname = 'Estimate-'+str(id)
if summary: compname = summary
ensure_component(self.env, compname, req.authname)
t = Ticket(self.env)
# try to split on a newline or space that is less than 80 chars into the string
idx = lineitem.description.find('\n', 0, 80)
if idx < 0: idx = lineitem.description.find(' ', 45, 80)
if idx < 0: idx = 45
summary = lineitem.description[:idx]
desc = lineitem.description
desc += "\n\nFrom [/Estimate?id=%s Created From Estimate %s]" % \
(lineitem.estimate_id,lineitem.estimate_id)
t.values['summary'] = summary
t.values['description'] = desc
t.values['status'] = 'new'
t.values['reporter'] = req.authname
t.values['component'] = compname
t.values['estimatedhours'] = avg(lineitem.low, lineitem.high)
t.insert()
lineitem.description+="\n\nCreated as /ticket/%s" % (t.id, )
return t