Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tasks.py
# Copyright (C) 2016-2019 The Software Heritage developers | # Copyright (C) 2016-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from celery import current_app as app | from celery import current_app as app | ||||
from .mimetype import MimetypeIndexer, MimetypeRangeIndexer | from .mimetype import MimetypeIndexer, MimetypeRangeIndexer | ||||
from .language import LanguageIndexer | |||||
from .ctags import CtagsIndexer | from .ctags import CtagsIndexer | ||||
from .fossology_license import ( | from .fossology_license import ( | ||||
FossologyLicenseIndexer, FossologyLicenseRangeIndexer | FossologyLicenseIndexer, FossologyLicenseRangeIndexer | ||||
) | ) | ||||
from .rehash import RecomputeChecksums | from .rehash import RecomputeChecksums | ||||
from .metadata import OriginMetadataIndexer | from .metadata import OriginMetadataIndexer | ||||
@app.task(name=__name__ + '.OriginMetadata') | @app.task(name=__name__ + '.OriginMetadata') | ||||
def origin_metadata(*args, **kwargs): | def origin_metadata(*args, **kwargs): | ||||
results = OriginMetadataIndexer().run(*args, **kwargs) | results = OriginMetadataIndexer().run(*args, **kwargs) | ||||
return getattr(results, 'results', results) | return getattr(results, 'results', results) | ||||
@app.task(name=__name__ + '.ContentLanguage') | |||||
def content_language(*args, **kwargs): | |||||
results = LanguageIndexer().run(*args, **kwargs) | |||||
return getattr(results, 'results', results) | |||||
@app.task(name=__name__ + '.Ctags') | @app.task(name=__name__ + '.Ctags') | ||||
def ctags(*args, **kwargs): | def ctags(*args, **kwargs): | ||||
results = CtagsIndexer().run(*args, **kwargs) | results = CtagsIndexer().run(*args, **kwargs) | ||||
return getattr(results, 'results', results) | return getattr(results, 'results', results) | ||||
@app.task(name=__name__ + '.ContentFossologyLicense') | @app.task(name=__name__ + '.ContentFossologyLicense') | ||||
def fossology_license(*args, **kwargs): | def fossology_license(*args, **kwargs): | ||||
Show All 26 Lines |