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

Keep up with API changes (+ trivial renaming to more meaningful name).

parent cc1044b6
# -*- coding: utf-8 -*-
#
# semantic.py — semantic plugin
# similar.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 semantic plugin.
Holds the similar packages plugin.
"""
__author__ = 'Clément Schreiner'
......@@ -47,14 +47,14 @@ from sqlalchemy import orm
log = logging.getLogger(__name__)
class SemanticResult(PluginResult):
class SimilarResult(PluginResult):
pass
orm.mapper(SemanticResult, inherits=plugin_result_mapper,
orm.mapper(SimilarResult, inherits=plugin_result_mapper,
polymorphic_identity = 'semantic')
class SemanticPlugin(BasePlugin):
result_model = SemanticResult
class SimilarPlugin(BasePlugin):
result_model = SimilarResult
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 = SemanticPlugin
plugin = SimilarPlugin
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