\bg0FddlmZmZddlmZddlmZdZd dddddZdS) )get_event_loop iscoroutine)wraps) signaturecLK||i|}t|r |d{VdSdS)aT This helper function launches an async main function that was tagged with forever=True. There are two possibilities: - The function is a normal function, which handles initializing the event loop, which is then run forever - The function is a coroutine, which needs to be scheduled in the event loop, which is then run forever - There is also the possibility that the function is a normal function wrapping a coroutine function The function is therefore called unconditionally and scheduled in the event loop if the return value is a coroutine object. The reason this is a separate function is to make absolutely sure that all the objects created are garbage collected after all is said and done; we do this to ensure that any exceptions raised in the tasks are collected ASAP. N)r)coroargskwargsloopthings y/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/_vendor/autocommand/autoasync.py_run_forever_cororsK4 D$ !& ! !E5 NFr forever pass_loopcfdSrFtdjDt fd}r|_|S)ak Convert an asyncio coroutine into a function which, when called, is evaluted in an event loop, and the return value returned. This is intented to make it easy to write entry points into asyncio coroutines, which otherwise need to be explictly evaluted with an event loop's run_until_complete. If `loop` is given, it is used as the event loop to run the coro in. If it is None (the default), the loop is retreived using asyncio.get_event_loop. This call is defered until the decorated function is called, so that callers can install custom event loops or event loop policies after @autoasync is applied. If `forever` is True, the loop is run forever after the decorated coroutine is finished. Use this for servers created with asyncio.start_server and the like. If `pass_loop` is True, the event loop object is passed into the coroutine as the `loop` kwarg when the wrapper function is called. In this case, the wrapper function's __signature__ is updated to remove this parameter, so that autoparse can still be used on it without generating a parameter for `loop`. This coroutine can be called with ( @autoasync(...) ) or without ( @autoasync ) arguments. Examples: @autoasync def get_file(host, port): reader, writer = yield from asyncio.open_connection(host, port) data = reader.read() sys.stdout.write(data.decode()) get_file(host, port) @autoasync(forever=True, pass_loop=True) def server(host, port, loop): yield_from loop.create_server(Proto, host, port) server('localhost', 8899) Nc*t|S)Nr) autoasync)crr rs r zautoasync..cs! D!!!rc3,K|]\}}|dk |VdS)r N).0nameparams r zautoasync..ns8..!dEv~~ ~~~..r) parametersc htn} rF}|jjdd|ij|i|j|j|j}}r;|t|||| dS| |i|S)Nr r) r bind_partial argumentsupdatebindr r create_taskr run_foreverrun_until_complete) r r local_loop bound_argsrrr new_sigold_sigrs r autoasync_wrapperz$autoasync..autoasync_wrapperrs*.^%%%4   > --//J 'J ' ; ; ;',///9 ; ; ;&?J,=&D  H  " "#4dFJ$$     " " $ $ $ $ $00t1Fv1F1FGG Gr)rreplaceritemsr __signature__)rr rrr+r)r*s```` @@r rr6sX |!!!!!! ! D////..%,%7%=%=%?%?.../   4[[HHHHHHHHH[H02*1' r)N) asynciorr functoolsrinspectrrrrrr r2s$0///////>XuXXXXXXXr