Skip to content

Commit

Permalink
replaces asyncclick with click (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoclyps authored May 22, 2021
1 parent 7f19ab0 commit ec0cec0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncclick==7.1.2.3
click==8.0.1
humanize==3.5.0
keyboard==0.13.5
PyGithub==1.55
Expand Down
15 changes: 5 additions & 10 deletions reviews/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import asyncio

import asyncclick as click
import click

from ..tasks import render, single_render
from ..version import __version__
Expand All @@ -10,7 +8,7 @@

@click.group(context_settings=CONTEXT_SETTINGS)
@click.version_option(__version__, "-v", "--version", message="version %(version)s")
async def cli() -> None:
def cli() -> None:
"""Reviews - A terminal UI Dashboard for monitoring code review requests.\n
For feature requests or bug reports: https://github.com/apoclyps/reviews/issues
Expand All @@ -19,7 +17,7 @@ async def cli() -> None:

@cli.command(help="Visualize code review requests as a Dashboard")
@click.option("-r", "--reload/--no-reload", default=True, is_flag=True)
async def dashboard(reload: bool) -> None:
def dashboard(reload: bool) -> None:
"""
Command:\n
reviews dashboard
Expand All @@ -32,14 +30,11 @@ async def dashboard(reload: bool) -> None:
click.echo("loading dashboard")

if reload:
await asyncio.gather(
# asyncio.to_thread(update),
asyncio.to_thread(render),
)
render()
else:
single_render()


def main() -> None:
"""Entry point to CLI"""
asyncio.run(cli())
cli()
9 changes: 0 additions & 9 deletions reviews/tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
from datetime import datetime
from time import sleep
from typing import List, Tuple
Expand Down Expand Up @@ -138,11 +137,3 @@ def render() -> None:
overall_progress.update(overall_task, completed=completed)

add_log_event(message="updated")


async def update() -> None:
"""Updates data in the background."""

while True:
print("working")
await asyncio.sleep(1)

0 comments on commit ec0cec0

Please sign in to comment.