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)), )))
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} """ )
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}|")
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)
def say(words): echo(*words)
def login(app): echo(f"Logged in with user: {app.user.login}")