Example #1
0
def info(app):
    echo(
        definition_list((
            ("Name", app.game.name),
            ("Id", app.game.id),
            ("GM", app.game.gm.name),
            ("Apps", ",".join(app.name for app in app.game.apps)),
            ("Num Players", len(app.game.players)),
            ("Num Repos", len(app.game.repositories)),
        )))
Example #2
0
def new(app, name):
    """Create a private repository with the given NAME."""
    if not click.confirm(f"Create a new repository named {repr(name)}?"):
        echo("Okay nevermind")
        return

    created_repo = app.new_repo(name)
    echo(
        f"""
        Created!
        HTML URL: {created_repo.html_url}
        Clone URL: {created_repo.clone_url}
        """
    )
Example #3
0
def links(app):
    echo(f"|name|url|")
    echo(f"|--  |-- |")
    for local in app.game.repositories:
        name = local.metadata["name"]
        html_url = local.metadata["html_url"]
        echo(f"|{name} |{html_url}|")
Example #4
0
def ls(app, pattern, details):
    """List repositories matching PATTERN regular expression."""
    for repo in app.ls(pattern):
        echo(repo.name)
        if details:
            echo(repo.html_url)
            echo(repo.ssh_url)
Example #5
0
def say(words):
    echo(*words)
Example #6
0
def login(app):
    echo(f"Logged in with user: {app.user.login}")