mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-28 19:52:14 +00:00
- Add basic line change counts for each x.x.0 library versions. - import line change counts during `import_commits` task. - Add `update_issues` management command for importing Issues for each LibraryVersion. - Add update issues runnable command in `Issue` admin. - Build word cloud using mailinglist content. - Update release report with new data.
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
from urllib.error import URLError
|
|
import djclick as click
|
|
|
|
from django.db import transaction
|
|
|
|
from libraries.github import LibraryUpdater
|
|
from libraries.models import Library
|
|
|
|
|
|
@click.command()
|
|
@click.option("--key", is_flag=False, help="Library Key", default=None)
|
|
@click.option("--clean", is_flag=True, help="Remove data before import?", default=False)
|
|
def command(key, clean):
|
|
updater = LibraryUpdater()
|
|
click.secho("Importing library issues...", fg="green")
|
|
if key is None:
|
|
libraries = Library.objects.all()
|
|
else:
|
|
libraries = [Library.objects.get(key=key)]
|
|
|
|
for library in libraries:
|
|
try:
|
|
with transaction.atomic():
|
|
if clean:
|
|
click.secho(f"Deleting issues for {library}")
|
|
library.issues.all().delete()
|
|
click.secho(f"Importing issues for {library}")
|
|
updater.update_issues(library)
|
|
except URLError:
|
|
click.secho(f"Error while importing issues for {library}.", fg="red")
|
|
continue
|
|
click.secho("Finished importing issues.", fg="green")
|