本文整理汇总了Python中suds.client.Client.mc_issue_update方法的典型用法代码示例。如果您正苦于以下问题:Python Client.mc_issue_update方法的具体用法?Python Client.mc_issue_update怎么用?Python Client.mc_issue_update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类suds.client.Client
的用法示例。
在下文中一共展示了Client.mc_issue_update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MantisSoap
# 需要导入模块: from suds.client import Client [as 别名]
# 或者: from suds.client.Client import mc_issue_update [as 别名]
#.........这里部分代码省略.........
boolean
False if no id found
"""
match = re.search('^\(tb\:(\d+)[,\)]', str)
if match:
return match.group(1)
return False
def getTaskNotesTeamboxIds(self, mantis_id):
""" return all the teambox ids for the notes """
data = self.getTask(mantis_id)
l = []
for i2, aComment in enumerate( data['notes'] ):
teambox_id = self.extractTeamboxIdFromNote(aComment['text'])
if teambox_id:
l.append( int(teambox_id) )
return l
def getTaskNotes(self, mantis_id):
data = self.getTask(mantis_id)
l = []
a = []
if not 'notes' in data:
return (l, a)
for i2, aComment in enumerate( data['notes'] ):
teambox_id = self.extractTeamboxIdFromNote(aComment['text'])
if teambox_id:
l.append( int(teambox_id) )
else:
a.append(aComment)
return (l, a)
def getTaskNoteByTbId(self, mantis_id, tb_id):
return self._helper_find_by_id( mantis_id, False, tb_id)
def getTaskNoteByNoteId(self, mantis_id, note_id):
return self._helper_find_by_id( mantis_id, note_id, False)
def _helper_find_by_id(self, mantis_id, note_id, tb_id):
data = self.getTask(mantis_id)
if not 'notes' in data:
return False
by_note_id = ( note_id != False )
if not by_note_id:
tb_id = str(tb_id)
for i2, aComment in enumerate( data['notes'] ):
if by_note_id:
if str( aComment['id'] ) == note_id:
return aComment
else:
teambox_id = self.extractTeamboxIdFromNote(aComment['text'])
if teambox_id and teambox_id == tb_id:
return aComment
return False
def getTask(self, mantis_id):
if self.cached_mantis_obj and self.cached_mantis_obj['id'] == mantis_id:
return self.cached_mantis_obj
else:
self.cached_mantis_obj = self.server.mc_issue_get( self.username, self.password, mantis_id )
return self.cached_mantis_obj
def addNoteToTask(self, task_id, note):
data = { 'text': note }
self.server.mc_issue_note_add( self.username, self.password, task_id, data )
def createTask(self, task):
newid = self.server.mc_issue_add(username=self.username, password=self.password, issue=task)
print "Success: issue %s created" % newid
return newid
def updateTask(self, issue_id, task):
self.server.mc_issue_update(username=self.username, password=self.password, issueId=issue_id, issue=task)
self.cached_mantis_obj = False
def extractUserInfoFromNote(self, note):
rep = note['reporter']
if 'real_name' in rep:
return rep['real_name']
return rep['name']
def isSolved(self, issue_id):
#80 = resolved
task = self.getTask(issue_id)
return task['status']['id'] == 80
def setStatusToNew(self, issue_id):
#10 = new
task = self.getTask(issue_id)
task['status']['id'] = 10
self.updateTask(issue_id, task)