本文整理汇总了Python中pysimplesoap.client.SoapClient.mc_issue_get方法的典型用法代码示例。如果您正苦于以下问题:Python SoapClient.mc_issue_get方法的具体用法?Python SoapClient.mc_issue_get怎么用?Python SoapClient.mc_issue_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysimplesoap.client.SoapClient
的用法示例。
在下文中一共展示了SoapClient.mc_issue_get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Mantis
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import mc_issue_get [as 别名]
class Mantis(IBugtracker):
def __init__(self, *args, **kwargs):
IBugtracker.__init__(self, *args, **kwargs)
self.soap_client = SoapClient("%s/api/soap/mantisconnect.php" % self.url, namespace="http://futureware.biz/mantisconnect")
def get_tracker(self, url):
try:
match = re.match(r'(?P<url>(?P<name>[^\s/]+).*)/view\.php', url)
name = desc = match.group('name')
url = 'https://%s' % match.group('url')
# registerBugtracker(name, url, desc, 'mantis')
return Mantis(name, url, desc, 'mantis')
except:
pass
def get_bug(self, id):
url = "%s/api/rest/issues/%d" % (self.url, id)
try:
bugjson = utils.web.getUrl(url)
bug = json.loads(bugjson.decode('utf-8'))['issues'][0]
except Exception as e:
# REST API may not be enabled yet
if 'HTTP Error 404' in str(e):
return self.get_bug_old(id)
raise BugtrackerError(self.errget % (self.description, e, url))
try:
return (id, bug['project']['name'], bug['summary'], bug['severity']['name'], bug['resolution']['name'], '', url, [], [])
except Exception as e:
raise BugtrackerError(self.errparse % (self.description, e, url))
def get_bug_old(self, id): # Deprecated
url = "%s/view.php?id=%d" % (self.url, id)
try:
raw = self.soap_client.mc_issue_get(username='', password='', issue_id=id)
except Exception as e:
if 'Issue #%d not found' % id in str(e):
raise BugNotFoundError
# Often SOAP is not enabled
if '.' in self.name:
supylog.exception(self.errget % (self.description, e, url))
return
raise BugtrackerError(self.errget % (self.description, e, url))
if not hasattr(raw, 'id'):
raise BugNotFoundError
try:
return (id, str(raw.project.name), str(raw.summary), str(raw.severity.name), str(raw.resolution.name), '', url, [], [])
except Exception as e:
raise BugtrackerError(self.errparse % (self.description, e, url))
示例2: MantisBT
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import mc_issue_get [as 别名]
class MantisBT(object):
def __init__(self, username, password, url):
if not url.endswith("?wsdl"):
if url.endswith("/api/soap/mantisconnect.php"):
url += "?wdsl"
elif url.endswith("/"):
url += "api/soap/mantisconnect.php?wsdl"
else:
url += "/api/soap/mantisconnect.php?wsdl"
self.client = SoapClient(wsdl=url, trace=False)
self.username = username
self.password = password
self._status = None
self._priorities = None
self._severities = None
self._resolutions = None
self._projects = None
def comment(self, ticket, content):
if type(content) is str:
content = content.decode("utf-8")
self.client.mc_issue_note_add(
username=self.username,
password=self.password,
issue_id=int(ticket),
note={
"text": content
}
)
def issue(self, issue_id):
return self.client.mc_issue_get(
username=self.username,
password=self.password,
issue_id=int(issue_id)
)['return']
@property
def status(self):
if not self._status:
self._status = map(
lambda n: n.get("item"),
self.client.mc_enum_status(
username=self.username,
password=self.password
)['return']
)
return self._status
@property
def priorities(self):
if not self._priorities:
self._priorities = map(
lambda n: n.get("item"),
self.client.mc_enum_priorities(
username=self.username,
password=self.password
)['return']
)
return self._priorities
@property
def severities(self):
if not self._severities:
self._severities = map(
lambda n: n.get("item"),
self.client.mc_enum_severities(
username=self.username,
password=self.password
)['return']
)
return self._severities
@property
def resolutions(self):
if not self._resolutions:
self._resolutions = map(
lambda n: n.get("item"),
self.client.mc_enum_resolutions(
username=self.username,
password=self.password
)['return']
)
return self._resolutions
@property
def projects(self):
if not self._projects:
def _proj(proj):
return {
"id": int(proj["item"].id),
"name": unicode(proj["item"].name)
}
projs = self.client.mc_projects_get_user_accessible(
username=self.username,
password=self.password
)['return']
#.........这里部分代码省略.........