Changeset View
Changeset View
Standalone View
Standalone View
swh/web/misc/coverage.py
# Copyright (C) 2018 The Software Heritage developers | # Copyright (C) 2018 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 Affero General Public License version 3, or any later version | # License: GNU Affero 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 django.shortcuts import render | from django.shortcuts import render | ||||
from django.views.decorators.clickjacking import xframe_options_exempt | from django.views.decorators.clickjacking import xframe_options_exempt | ||||
# Current coverage list of the archive | # Current coverage list of the archive | ||||
# TODO: Retrieve that list dynamically instead of hardcoding it | # TODO: Retrieve that list dynamically instead of hardcoding it | ||||
_code_providers = [ | code_providers = [ | ||||
{ | { | ||||
'provider_id': 'debian', | |||||
'provider_url': 'https://www.debian.org/', | 'provider_url': 'https://www.debian.org/', | ||||
'provider_logo': 'img/logos/debian.png', | 'provider_logo': 'img/logos/debian.png', | ||||
'provider_info': 'source packages from the Debian distribution ' | 'provider_info': 'source packages from the Debian distribution ' | ||||
'(continuously archived)', | '(continuously archived)', | ||||
'origin_url_pattern': 'deb://', | |||||
'origin_types': 'packages' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'framagit', | |||||
'provider_url': 'https://framagit.org/', | 'provider_url': 'https://framagit.org/', | ||||
'provider_logo': 'img/logos/framagit.png', | 'provider_logo': 'img/logos/framagit.png', | ||||
'provider_info': 'public repositories from Framagit ' | 'provider_info': 'public repositories from Framagit ' | ||||
'(continuously archived)', | '(continuously archived)', | ||||
'origin_url_pattern': 'https://framagit.org/', | |||||
'origin_types': 'repositories' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'github', | |||||
'provider_url': 'https://github.com', | 'provider_url': 'https://github.com', | ||||
'provider_logo': 'img/logos/github.png', | 'provider_logo': 'img/logos/github.png', | ||||
'provider_info': 'public repositories from GitHub ' | 'provider_info': 'public repositories from GitHub ' | ||||
'(continuously archived)', | '(continuously archived)', | ||||
'origin_url_pattern': 'https://github.com/', | |||||
'origin_types': 'repositories' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'gitlab', | |||||
'provider_url': 'https://gitlab.com', | 'provider_url': 'https://gitlab.com', | ||||
'provider_logo': 'img/logos/gitlab.svg', | 'provider_logo': 'img/logos/gitlab.svg', | ||||
'provider_info': 'public repositories from GitLab ' | 'provider_info': 'public repositories from GitLab ' | ||||
'(continuously archived)', | '(continuously archived)', | ||||
'origin_url_pattern': 'https://gitlab.com', | |||||
'origin_types': 'repositories' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'gitorious', | |||||
'provider_url': 'https://gitorious.org/', | 'provider_url': 'https://gitorious.org/', | ||||
'provider_logo': 'img/logos/gitorious.png', | 'provider_logo': 'img/logos/gitorious.png', | ||||
'provider_info': 'public repositories from the former Gitorious code ' | 'provider_info': 'public repositories from the former Gitorious code ' | ||||
'hosting service', | 'hosting service', | ||||
'origin_url_pattern': 'https://gitorious.org/', | |||||
'origin_types': 'repositories' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'googlecode', | |||||
'provider_url': 'https://code.google.com/archive/', | 'provider_url': 'https://code.google.com/archive/', | ||||
'provider_logo': 'img/logos/googlecode.png', | 'provider_logo': 'img/logos/googlecode.png', | ||||
'provider_info': 'public repositories from the former Google Code ' | 'provider_info': 'public repositories from the former Google Code ' | ||||
'project hosting service', | 'project hosting service', | ||||
'origin_url_pattern': '.googlecode.com/', | |||||
'origin_types': 'repositories' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'gnu', | |||||
'provider_url': 'https://www.gnu.org', | 'provider_url': 'https://www.gnu.org', | ||||
'provider_logo': 'img/logos/gnu.png', | 'provider_logo': 'img/logos/gnu.png', | ||||
'provider_info': 'releases from the GNU project (as of August 2015)', | 'provider_info': 'releases from the GNU project (as of August 2015)', | ||||
'origin_url_pattern': 'rsync://ftp.gnu.org/', | |||||
'origin_types': 'releases' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'hal', | |||||
'provider_url': 'https://hal.archives-ouvertes.fr/', | 'provider_url': 'https://hal.archives-ouvertes.fr/', | ||||
'provider_logo': 'img/logos/hal.png', | 'provider_logo': 'img/logos/hal.png', | ||||
'provider_info': 'scientific software source code deposited in the ' | 'provider_info': 'scientific software source code deposited in the ' | ||||
'open archive HAL' | 'open archive HAL', | ||||
'origin_url_pattern': 'https://hal.archives-ouvertes.fr', | |||||
vlorentz: Add an extra slash at the end (you don't want to match `https://hal.archives-ouvertes.fr.foobar. | |||||
vlorentzUnsubmitted Not Done Inline ActionsSame for gitlab.com, gitlab.inria.fr, and pypi.org. vlorentz: Same for `gitlab.com`, `gitlab.inria.fr`, and `pypi.org`. | |||||
anlambertAuthorUnsubmitted Done Inline Actionsack anlambert: ack | |||||
'origin_types': 'deposits' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'inria', | |||||
'provider_url': 'https://gitlab.inria.fr', | 'provider_url': 'https://gitlab.inria.fr', | ||||
'provider_logo': 'img/logos/inria.jpg', | 'provider_logo': 'img/logos/inria.jpg', | ||||
'provider_info': 'public repositories from Inria GitLab ' | 'provider_info': 'public repositories from Inria GitLab ' | ||||
'(continuously archived)', | '(continuously archived)', | ||||
'origin_url_pattern': 'https://gitlab.inria.fr', | |||||
'origin_types': 'repositories' | |||||
}, | }, | ||||
{ | { | ||||
'provider_id': 'pypi', | |||||
'provider_url': 'https://pypi.org', | 'provider_url': 'https://pypi.org', | ||||
'provider_logo': 'img/logos/pypi.svg', | 'provider_logo': 'img/logos/pypi.svg', | ||||
'provider_info': 'source packages from the Python Packaging Index ' | 'provider_info': 'source packages from the Python Packaging Index ' | ||||
'(continuously archived)', | '(continuously archived)', | ||||
'origin_url_pattern': 'https://pypi.org', | |||||
'origin_types': 'packages' | |||||
}, | }, | ||||
] | ] | ||||
@xframe_options_exempt | @xframe_options_exempt | ||||
def swh_coverage(request): | def swh_coverage(request): | ||||
return render(request, 'coverage.html', {'providers': _code_providers}) | return render(request, 'coverage.html', {'providers': code_providers}) |
Add an extra slash at the end (you don't want to match https://hal.archives-ouvertes.fr.foobar.com)