l.b.e._.Mantis(ExternalBugTracker) : class documentation

Part of lp.bugs.externalbugtracker View In Hierarchy

An ExternalBugTracker for dealing with Mantis instances.

For a list of tested Mantis instances and their behaviour when exported from, see:

https://dev.launchpad.net/Bugs/ExternalBugTrackers/Mantis
Method __init__ Undocumented
Method makeRequest See ExternalBugTracker.
Method csv_data Attempt to retrieve a CSV export from the remote server.
Method canUseCSVExports Return True if a Mantis instance supports CSV exports.
Method initializeRemoteBugDB See ExternalBugTracker.
Method getRemoteBug See ExternalBugTracker.
Method getRemoteBugBatch See ExternalBugTracker.
Method getRemoteImportance See ExternalBugTracker.
Method getRemoteStatus Undocumented
Method convertRemoteImportance See ExternalBugTracker.
Method convertRemoteStatus Undocumented
Method _csv_data See `csv_data().
Method _checkForApplicationError If Mantis does not find the bug it still returns a 200 OK
Method _findValueRightOfKey Scrape a value from a Mantis bug view page where the value
def __init__(self, baseurl):
Undocumented
def makeRequest(self, method, url, hooks=None, **kwargs):
See ExternalBugTracker.
@cachedproperty
def csv_data(self):
Attempt to retrieve a CSV export from the remote server.

If the export fails (i.e. the response is 0-length), None will be returned.

def _csv_data(self):
See `csv_data().
def canUseCSVExports(self):
Return True if a Mantis instance supports CSV exports.

If the Mantis instance cannot or does not support CSV exports, False will be returned.

def initializeRemoteBugDB(self, bug_ids):
See ExternalBugTracker.

This method is overridden so that it can take into account the fact that not all Mantis instances support CSV exports. In those cases all bugs will be imported individually, regardless of how many there are.

def getRemoteBug(self, bug_id):
See ExternalBugTracker.
def getRemoteBugBatch(self, bug_ids):
See ExternalBugTracker.
def _checkForApplicationError(self, page_soup):
If Mantis does not find the bug it still returns a 200 OK response, so we need to look into the page to figure it out.

If there is no error, None is returned.

If there is an error, a 2-tuple of (code, message) is returned, both unicode strings.

def _findValueRightOfKey(self, page_soup, key):
Scrape a value from a Mantis bug view page where the value
is displayed to the right of the key.

The Mantis bug view page uses HTML tables for both layout and
representing tabular data, often within the same table. This
method assumes that the key and value are on the same row,
adjacent to one another, with the key preceding the value:

...
<td>Key</td>
<td>Value</td>
...

This method does not compensate for colspan or rowspan.
def getRemoteImportance(self, bug_id):
See ExternalBugTracker.

This method is implemented here as a stub to ensure that existing functionality is preserved. As a result, UNKNOWN_REMOTE_IMPORTANCE will always be returned.

def getRemoteStatus(self, bug_id):
Undocumented
def convertRemoteImportance(self, remote_importance):
See ExternalBugTracker.

This method is implemented here as a stub to ensure that existing functionality is preserved. As a result, BugTaskImportance.UNKNOWN will always be returned.

def convertRemoteStatus(self, status_and_resolution):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2020-02-19 00:00:13.