Skip to content

Commit

Permalink
Improve cli performance
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezatheh committed Aug 19, 2021
1 parent 5399c33 commit f11aeb0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions perke/cli/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import typer
from typer.main import get_command

app = typer.Typer(name='perke')
app = typer.Typer(name='perke', help='Perke\'s Command-line Interface')


def setup_cli() -> None:
"""
Setup command-line interface for perke.
Setups command-line interface for perke.
"""
# Ensure that the help messages always display the correct prompt
command = get_command(app)
Expand Down
2 changes: 1 addition & 1 deletion perke/cli/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@app.command('clear')
def clear_command() -> None:
"""
Clears the resources directory.
Clears the resources directory from downloaded files.
"""
clear()

Expand Down
2 changes: 1 addition & 1 deletion perke/cli/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def download_and_extract_asset(asset: GitReleaseAsset,
"""
chunk_size = 1024*1024
with typer.progressbar(length=asset.size,
label='Downloading resources ...') as progress:
label=f'Downloading {asset.name} ...') as progress:
with requests.get(url=asset.browser_download_url,
stream=True) as r:
with BytesIO() as io_file:
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
author='Alireza Hosseini',
author_email='alirezah320@yahoo.com',
packages=packages,
entry_points={
'console_scripts': ['perke = perke.cli:setup_cli']
},
entry_points={'console_scripts': ['perke = perke.cli:setup_cli']},
keywords=[
'nlp',
'natural language processing',
Expand Down

0 comments on commit f11aeb0

Please # to comment.