Skip to content

Commit

Permalink
feat: Add a live property to Download
Browse files Browse the repository at this point in the history
This property calls `self.update()`, and then returns `self`.
This allows to call `download.live.progress` to get
the progress in real-time for example.
  • Loading branch information
pawamoy committed Mar 27, 2020
1 parent 7e3d31f commit 98a8504
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/aria2p/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ def update(self) -> None:
self._following = None
self._belongs_to = None

@property
def live(self):
self.update()
return self

@property
def name(self):
"""
Expand Down

0 comments on commit 98a8504

Please sign in to comment.