You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

#!/usr/bin/env python3
# external
import click
from pprint import pprint
def reqbt(ctx):
'''Inspect the ReQBT dataset.\f'''
# pretty label
def plabel(label, message, color):
click.echo(':', fg=color, bold=True) + ' %s' % message)
def find(ctx, filename, name):
data =
case = data.get(name, None)
plabel('Name', case['name'], 'yellow')
plabel('Contributors', case['contributors'], 'yellow')
print('Deducible:', fg='yellow', bold=True),
'Yes' if case['deducible'] else 'No')
plabel('Quantity', case['quantity'], 'yellow')
for i, replicate in enumerate(case['replicates'], start=1):
click.echo('Replicate %d:', fg='yellow', bold=True) % i)
for key, value in replicate.items():
click.echo(' %-20s %s' % (, fg='yellow', bold=True), ', '.join(value)))
for i, comparison in enumerate(case['comparisons'], start=1):
click.echo('Comparison %d:', fg='yellow', bold=True) % i)
click.echo(' %-20s %s' % ('Name:', fg='yellow', bold=True), comparison.pop('name')))
for key, value in comparison.items():
click.echo(' %-20s %s' % (, fg='yellow', bold=True), ', '.join(value)))
except TypeError:
click.echo("Case '%s' not found." % name)