Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def print_status(status):
if status.get("title"):
click.echo("Title: {}".format(status["title"]))
if status.get("current_time"):
current = human_time(status["current_time"])
if status.get("duration"):
duration = human_time(status["duration"])
remaining = human_time(status["remaining"])
click.echo("Time: {} / {} ({}%)".format(current, duration, status["progress"]))
click.echo("Remaining time: {}".format(remaining))
else:
click.echo("Time: {}".format(current))
if status.get("player_state"):
click.echo("State: {}".format(status["player_state"]))
if status.get("volume_level"):
click.echo("Volume: {}".format(status["volume_level"]))
def print_status(status):
if status.get("title"):
click.echo("Title: {}".format(status["title"]))
if status.get("current_time"):
current = human_time(status["current_time"])
if status.get("duration"):
duration = human_time(status["duration"])
remaining = human_time(status["remaining"])
click.echo("Time: {} / {} ({}%)".format(current, duration, status["progress"]))
click.echo("Remaining time: {}".format(remaining))
else:
click.echo("Time: {}".format(current))
if status.get("player_state"):
click.echo("State: {}".format(status["player_state"]))
if status.get("volume_level"):
click.echo("Volume: {}".format(status["volume_level"]))
def print_status(status):
if status.get("title"):
click.echo("Title: {}".format(status["title"]))
if status.get("current_time"):
current = human_time(status["current_time"])
if status.get("duration"):
duration = human_time(status["duration"])
remaining = human_time(status["remaining"])
click.echo("Time: {} / {} ({}%)".format(current, duration, status["progress"]))
click.echo("Remaining time: {}".format(remaining))
else:
click.echo("Time: {}".format(current))
if status.get("player_state"):
click.echo("State: {}".format(status["player_state"]))
if status.get("volume_level"):
click.echo("Volume: {}".format(status["volume_level"]))