Skip to content

Instantly share code, notes, and snippets.

@jacquerie
Last active October 14, 2015 09:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jacquerie/d561017ed3b5dd9926ed to your computer and use it in GitHub Desktop.
Save jacquerie/d561017ed3b5dd9926ed to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utility script to build the Invenio Status Dashboard."""
from __future__ import print_function
import sys
PACKAGE_TPL = '[{repo}](https://github.com/{org}/{repo})'
BUILD_STATUS_TPL = (
'[![Build Status](https://travis-ci.org/{org}/{repo}.svg?branch=master)]'
'(https://travis-ci.org/{org}/{repo})'
)
COVERAGE_TPL = (
'[![Coverage Status](https://coveralls.io/repos/{org}/{repo}/badge.svg?'
'branch=master&service=github)](https://coveralls.io/github/{org}/{repo}?'
'branch=master)'
)
TABLE_LINE_TPL = '| {package} | {build_status} | {coverage} |'
def format_table_line(repo, org='inveniosoftware'):
"""Format a single line of the table."""
package = PACKAGE_TPL.format(org=org, repo=repo)
build_status = BUILD_STATUS_TPL.format(org=org, repo=repo)
coverage = COVERAGE_TPL.format(org=org, repo=repo)
print(
TABLE_LINE_TPL.format(
package=package,
build_status=build_status,
coverage=coverage
)
)
if __name__ == '__main__':
if len(sys.argv) != 2:
print(
'Usage: $ python {script} file'.format(
script=sys.argv[0]
), file=sys.stderr
)
sys.exit()
print('| Package | Build Status | Coverage |')
print('| ------- | ------------ | -------- |')
with open(sys.argv[1], 'r') as input_file:
for line in input_file:
format_table_line(line.strip())
invenio
invenio-access
invenio-accounts
invenio-authorities
invenio-base
invenio-celery
invenio-checker
invenio-classifier
invenio-client
invenio-collections
invenio-deposit
invenio-documents
invenio-ext
invenio-formatter
invenio-jsonref
invenio-jsonschemas
invenio-knowledge
invenio-oaiharvester
invenio-oairepository
invenio-oauth2server
invenio-oauthclient
invenio-pidstore
invenio-query-parser
invenio-records
invenio-search
invenio-sequencegenerator
invenio-testing
invenio-upgrader
invenio-utils
invenio-webhooks
invenio-workflows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment