Bugtracker: Update Mantis tracker.
* Add JSON. * Deprecate SOAP.
This commit is contained in:
@ -24,7 +24,7 @@ import supybot.world as world
|
||||
|
||||
from imp import reload
|
||||
|
||||
__version__ = "3.1.0"
|
||||
__version__ = "3.2.0"
|
||||
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@tuxgarage.com")
|
||||
__contributors__ = {
|
||||
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'],
|
||||
|
@ -947,6 +947,21 @@ class Mantis(IBugtracker):
|
||||
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_proxy.mc_issue_get('', '', id)
|
||||
|
Reference in New Issue
Block a user