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
b3513fe4
Commit
b3513fe4
authored
Jul 08, 2012
by
Clément Schreiner
Browse files
Keep up with API changes (+ trivial renaming to more meaningful name).
parent
cc1044b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/plugins/s
emantic
.py
→
debexpo/plugins/s
imilar
.py
View file @
b3513fe4
# -*- coding: utf-8 -*-
#
# s
emantic.py — semantic
plugin
# s
imilar.py — similar packages
plugin
#
# This file is part of debexpo - https://alioth.debian.org/projects/debexpo/
#
...
...
@@ -29,7 +29,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
"""
Holds the s
emantic
plugin.
Holds the s
imilar packages
plugin.
"""
__author__
=
'Clément Schreiner'
...
...
@@ -47,14 +47,14 @@ from sqlalchemy import orm
log
=
logging
.
getLogger
(
__name__
)
class
S
emantic
Result
(
PluginResult
):
class
S
imilar
Result
(
PluginResult
):
pass
orm
.
mapper
(
S
emantic
Result
,
inherits
=
plugin_result_mapper
,
orm
.
mapper
(
S
imilar
Result
,
inherits
=
plugin_result_mapper
,
polymorphic_identity
=
'semantic'
)
class
S
emantic
Plugin
(
BasePlugin
):
result_model
=
S
emantic
Result
class
S
imilar
Plugin
(
BasePlugin
):
result_model
=
S
imilar
Result
def
test_similar_packages
(
self
):
binary_packages
=
self
.
package_version
.
get_binary_packages
()
...
...
@@ -64,10 +64,8 @@ class SemanticPlugin(BasePlugin):
sd
=
SemanticData
(
packages
,
descriptions
)
_id
=
0
for
p
in
sd
.
iter_similar_packages
():
self
.
_add_data
(
id
=
_id
,
**
p
)
_id
+=
1
for
p
in
sd
.
iter_similar_packages
():
self
.
_add_result
(
**
p
)
plugin
=
S
emantic
Plugin
plugin
=
S
imilar
Plugin
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