Skip to content

Commit

Permalink
Add upload speed to display
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Dec 26, 2018
1 parent 5fe4649 commit 5c8be6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
Command-line tool and Python library to interact with an `aria2c` daemon process through JSON-RPC.

## Requirements
`aria2p` requires Python 3.6. To install Python 3.6, I recommend [`pyenv`](https://github.com/pyenv/pyenv):
`aria2p` requires Python 3.6 or above.

<details>
<summary>To install Python 3.6, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>

```bash
# install pyenv
git clone https://github.com/pyenv/pyenv ~/.pyenv
Expand All @@ -17,6 +21,7 @@ pyenv install 3.6.7
# make it available globally
pyenv global system 3.6.7
```
</details>

## Installation
With `pip`:
Expand Down Expand Up @@ -82,7 +87,7 @@ The following are all equivalent:

Calling `aria2p` without any arguments will simply display the list of current downloads:
```
GID STATUS PROGRESS NAME
GID STATUS PROGRESS DOWN_SPEED UP_SPEED ETA NAME
```

There is no interactive mode yet, but you can use `watch` to see how the downloads progress:
Expand Down
10 changes: 9 additions & 1 deletion src/aria2p/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,20 @@ def main(args=None):
print(e)
return 1

print(f"{'GID':<17} {'STATUS':<9} {'PROGRESS':>8} {'DOWN_SPEED':>12} {'ETA':>8} NAME")
print(f"{'GID':<17} "
f"{'STATUS':<9} "
f"{'PROGRESS':>8} "
f"{'DOWN_SPEED':>12} "
f"{'UP_SPEED':>12} "
f"{'ETA':>8} "
f"NAME")

for download in downloads:
print(f"{download.gid:<17} "
f"{download.status:<9} "
f"{download.progress_string():>8} "
f"{download.download_speed_string():>12} "
f"{download.upload_speed_string():>12} "
f"{download.eta_string():>8} "
f"{download.name}")

Expand Down

0 comments on commit 5c8be6c

Please sign in to comment.