Skip to content

Commit

Permalink
added async progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
humandecoded committed Feb 17, 2022
1 parent c8dd3e9 commit 315dffc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion twayback B/twayback.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from pathlib import Path
import simplejson as json
from tqdm import tqdm as tqdm
# this import needs to be named different since we've used up tqdm above
# used for progress bar on our async operations
from tqdm.asyncio import tqdm as asyncProgress
import colorama
from colorama import Fore, Back, Style
colorama.init(autoreset=True)
Expand Down Expand Up @@ -37,7 +40,7 @@ async def asyncStarter(url_list):
# limit to 50 concurrent jobs
sem = asyncio.Semaphore(50)
# launch all the url checks concurrently as coroutines
status_list = await asyncio.gather(*(checkStatus(u, session, sem) for u in url_list))
status_list = await asyncProgress.gather(*(checkStatus(u, session, sem) for u in url_list))
# return a list of the results
return status_list
if platform.system() == 'Windows':
Expand Down

0 comments on commit 315dffc

Please sign in to comment.