Commit 4cf0e90e authored by Clément Schreiner's avatar Clément Schreiner
Browse files

Partially complete the update.

parent 98210838
......@@ -42,7 +42,7 @@ import logging
import SOAPpy
from debexpo.lib import constants
from debexpo.plugins import BasePlugin
from debexpo.plugins.api import *
log = logging.getLogger(__name__)
......@@ -53,20 +53,12 @@ class ClosedbugTest(PluginResult):
Represents the result of the 'closed bugs' test.
"""
@property
def nb_closed(self):
return int(self['nb_closed'])
@property
def nb_errors(self):
return int(self['nb_errors'])
@property
def closes_wnpp(self):
return True if self['wnpp'] == 'true' else False
nb_closed = int_field('nb_closed')
nb_errors = int_field('nb_errors')
closes_wnpp = bool_field('wnpp')
def __str__(self):
if self.closes_wnpp(self):
if self.closes_wnpp:
return 'Package closes a WNPP bug'
strings = []
......@@ -85,17 +77,20 @@ class ClosedBug(PluginResult):
Represents a bug closed by the package.
"""
@property
def exists(self):
return True if self['exists'] == 'true' else False
@property
def belongs(self):
return True if self['belongs'] == 'true' else False
exists = bool_field('exists')
belongs = bool_field('exists')
number = int_field('number')
def __str__(self):
return '{number} ({severity}: {subject}'.format(
self[
if self.exists:
string = '{name} ({severity}: {subject}'.format(
name=self['name'],
severity=self.severity,
subject=self['subject'])
else:
string = 'Non-existent bug #{}'.format(self.number)
return string
class ClosedBugsPlugin(QAPlugin):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment