forked from manrajgrover/halo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue manrajgrover#157 -+- change decorator implementation -+- add an example of new decorator approach -+- it needs to write new tests but example work well
- Loading branch information
1 parent
db406ea
commit 6ae75b8
Showing
3 changed files
with
77 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from halo import Halo | ||
from time import sleep | ||
|
||
|
||
@Halo(text='Loading {task}', spinner='line') | ||
def run_task(halo_iter=[], stop_text='', stop_symbol=' '): | ||
sleep(.5) | ||
|
||
|
||
tasks1 = ['breakfest', 'launch', 'dinner'] | ||
tasks2 = ['morning', 'noon', 'night'] | ||
|
||
run_task(halo_iter=tasks1, stop_symbol='🦄'.encode( | ||
'utf-8'), stop_text='Task1 Finished') | ||
run_task(halo_iter=tasks2, stop_text='Finished Time') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters