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
8694e84d
Commit
8694e84d
authored
Feb 15, 2012
by
Nicolas Dandrimont
🤔
Browse files
Modify the remaining plugins for completeness
parent
ce544f12
Changes
3
Hide whitespace changes
Inline
Side-by-side
debexpo/plugins/notuploader.py
View file @
8694e84d
...
@@ -43,6 +43,8 @@ from debexpo.lib import constants
...
@@ -43,6 +43,8 @@ from debexpo.lib import constants
from
debexpo.model
import
meta
from
debexpo.model
import
meta
from
debexpo.model.packages
import
Package
from
debexpo.model.packages
import
Package
from
pylons
import
config
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
class
NotUploaderPlugin
(
BasePlugin
):
class
NotUploaderPlugin
(
BasePlugin
):
...
@@ -53,7 +55,7 @@ class NotUploaderPlugin(BasePlugin):
...
@@ -53,7 +55,7 @@ class NotUploaderPlugin(BasePlugin):
make sure it was uploaded by the same uploader.
make sure it was uploaded by the same uploader.
"""
"""
packagename
=
self
.
changes
[
'Source'
]
packagename
=
self
.
changes
[
'Source'
]
log
.
debug
(
'Checking whether
the
%s is in the archive already'
%
packagename
)
log
.
debug
(
'Checking whether %s is in the archive already'
%
packagename
)
package
=
meta
.
session
.
query
(
Package
).
filter_by
(
name
=
packagename
).
first
()
package
=
meta
.
session
.
query
(
Package
).
filter_by
(
name
=
packagename
).
first
()
...
@@ -68,10 +70,8 @@ class NotUploaderPlugin(BasePlugin):
...
@@ -68,10 +70,8 @@ class NotUploaderPlugin(BasePlugin):
# This isn't even worth setting an outcome.
# This isn't even worth setting an outcome.
else
:
else
:
log
.
error
(
'Package does not belong to uploader'
)
log
.
error
(
'Package does not belong to uploader'
)
self
.
failed
(
'package-does-not-belong-to-user'
,
None
,
constants
.
PLUGIN_SEVERITY_CRITICAL
)
self
.
failed
(
'This package was previously uploaded to %s by another user'
%
config
[
"debexpo.sitename"
],
None
,
constants
.
PLUGIN_SEVERITY_CRITICAL
)
plugin
=
NotUploaderPlugin
plugin
=
NotUploaderPlugin
outcomes
=
{
'package-does-not-belong-to-user'
:
'The uploaded package already has a version in the archive, which was uploaded by a different user'
}
debexpo/plugins/removepackage.py
View file @
8694e84d
...
@@ -84,5 +84,3 @@ class RemovePackagePlugin(BasePlugin):
...
@@ -84,5 +84,3 @@ class RemovePackagePlugin(BasePlugin):
meta
.
session
.
commit
()
meta
.
session
.
commit
()
plugin
=
RemovePackagePlugin
plugin
=
RemovePackagePlugin
outcomes
=
{}
debexpo/plugins/ubuntuversion.py
View file @
8694e84d
...
@@ -55,10 +55,6 @@ class UbuntuVersionPlugin(BasePlugin):
...
@@ -55,10 +55,6 @@ class UbuntuVersionPlugin(BasePlugin):
# This isn't even worth setting an outcome.
# This isn't even worth setting an outcome.
else
:
else
:
log
.
error
(
'Package has ubuntu in the version'
)
log
.
error
(
'Package has ubuntu in the version'
)
self
.
failed
(
'package
-
has
-
ubuntu
-
version'
,
None
,
constants
.
PLUGIN_SEVERITY_CRITICAL
)
self
.
failed
(
'
The uploaded
package
has
"
ubuntu
" in the
version'
,
None
,
constants
.
PLUGIN_SEVERITY_CRITICAL
)
plugin
=
UbuntuVersionPlugin
plugin
=
UbuntuVersionPlugin
outcomes
=
{
'package-has-ubuntu-version'
:
'The uploaded package has "ubuntu" in the version'
}
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