Skip to content

Commit

Permalink
[Storage] Update samples to use asyncio.run (Azure#26147)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonhyeongseo authored and mccoyp committed Sep 22, 2022
1 parent 352bf91 commit a819f8a
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,4 @@ async def main():
await sample.auth_blob_url_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,4 @@ async def main():
await sample.copy_blob_from_url_and_abort_copy_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,4 @@ async def main():
sys.exit(1)

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,4 @@ async def main():
await sample.get_container_client_from_blob_client()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ async def main():
print(props.copy.status)

if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ async def main():
print(blob.name + '\n')

if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ async def main():
await sample.stream_block_blob()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,4 @@ async def main():
await sample.get_blob_service_client_from_container_client_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,4 @@ async def main():
sys.exit(1)

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,4 @@ async def run():


if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
asyncio.run(run())
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,4 @@ async def run():


if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
asyncio.run(run())
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,4 @@ async def run():
await filesystem_client.delete_file_system()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
asyncio.run(run())
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,4 @@ async def run():
await sample.create_file_from_file_system()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
loop.close()
asyncio.run(run())
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ async def main():


if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(run())
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,4 @@ async def data_lake_service_sample():
await token_credential.close()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(data_lake_service_sample())

asyncio.run(data_lake_service_sample())
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,4 @@ async def run():


if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
asyncio.run(run())
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ async def main():
await sample.authentication_shared_access_signature_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,4 @@ async def main():
await sample.file_copy_from_url_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,4 @@ async def main():
await sample.get_subdirectory_client_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,4 @@ async def main():
await sample.upload_a_file_to_share_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,4 @@ async def main():
await sample.get_share_client_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,4 @@ async def main():
await sample.get_directory_or_file_client_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,4 @@ async def main():
await sample.authentication_by_shared_access_signature_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,4 @@ async def main():
await sample.queue_and_messages_example_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,4 @@ async def main():
await sample.receive_messages_with_max_messages()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,4 @@ async def main():
await sample.get_queue_client_async()

if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())

0 comments on commit a819f8a

Please sign in to comment.