Last active
October 14, 2015 09:04
-
-
Save jacquerie/d561017ed3b5dd9926ed to your computer and use it in GitHub Desktop.
Script used to generate the table in https://github.com/inspirehep/inspire-next/wiki/invenio-status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = ( | |
'[]' | |
'(https://travis-ci.org/{org}/{repo})' | |
) | |
COVERAGE_TPL = ( | |
'[](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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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