MCPcopy Index your code
hub / github.com/geekcomputers/Python / download

Function download

async_downloader/async_downloader.py:14–43  ·  view source on GitHub ↗
(ways)

Source from the content-addressed store, hash-verified

12
13
14def download(ways):
15 if not ways:
16 print("Ways list is empty. Downloading is impossible")
17 return
18
19 print("downloading..")
20
21 success_files = set()
22 failure_files = set()
23
24 event_loop = asyncio.get_event_loop()
25 try:
26 event_loop.run_until_complete(
27 async_downloader(ways, event_loop, success_files, failure_files)
28 )
29 finally:
30 event_loop.close()
31
32 print("Download complete")
33 print("-" * 100)
34
35 if success_files:
36 print("success:")
37 for file in success_files:
38 print(file)
39
40 if failure_files:
41 print("failure:")
42 for file in failure_files:
43 print(file)
44
45
46async def async_downloader(ways, loop, success_files, failure_files):

Callers 1

testFunction · 0.70

Calls 2

async_downloaderFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected