Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
1484b9fc
Commit
1484b9fc
authored
Aug 16, 2012
by
Clément Schreiner
Browse files
Add a ``get_bugs`` method to ClosedbugsTest.
Returns a dictionary (package -> <ClosedBug instance>).
parent
a6c45fd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/plugins/closedbugs.py
View file @
1484b9fc
...
...
@@ -43,6 +43,7 @@ import SOAPpy
from
debexpo.lib
import
constants
from
debexpo.plugins.api
import
*
from
debexpo.model
import
meta
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -57,6 +58,15 @@ class ClosedbugTest(PluginResult):
nb_errors
=
int_field
(
'nb_errors'
)
closes_wnpp
=
bool_field
(
'wnpp'
)
def
get_bugs
(
self
):
q
=
meta
.
session
.
query
(
ClosedBug
)
q
=
q
.
filter_by
(
package_version_id
=
self
.
package_version
.
id
)
# exists = True)
d
=
{}
for
bug
in
q
.
all
():
d
.
setdefault
(
bug
.
package
,
list
()).
append
(
bug
)
return
d
def
__str__
(
self
):
if
self
.
closes_wnpp
:
return
'Package closes a WNPP bug'
...
...
@@ -82,6 +92,9 @@ class ClosedBug(PluginResult):
number
=
int_field
(
'number'
)
is_error
=
bool_field
(
'is_error'
)
@
property
def
package
(
self
):
return
self
[
'package'
]
def
__str__
(
self
):
if
self
.
exists
:
string
=
'{name} ({severity}: {subject}'
.
format
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment