Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/npm/__init__.py
# Copyright (C) 2019 the Software Heritage developers | |||||
# License: GNU General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
def register(): | |||||
from .models import NpmVisitModel, NpmModel | |||||
from .lister import NpmLister | |||||
return {'models': [NpmVisitModel, NpmModel], | |||||
'lister': NpmLister, | |||||
anlambert: For npm, there is two models to initialize: `swh.lister.npm.models.NpmModel` and `swh.lister. | |||||
Done Inline Actionsthat's typically why I'm not convinced by the 'API' of the plugin loading mechanism here. The true initialization work is in fact done in the 'init' hook, which is a simple function and thus can initialize as many databases/tables as one wants. douardda: that's typically why I'm not convinced by the 'API' of the plugin loading mechanism here. The… | |||||
'task_modules': ['%s.tasks' % __name__], | |||||
} |
For npm, there is two models to initialize: swh.lister.npm.models.NpmModel and swh.lister.npm.models.NpmVisitModel