Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
autoreload.cpython-313.pyc134 linesDownload Raw Back to __pycache__
1�

2��j�4���%SrSSKrSSKr\S:Xa9\RS\RR\5:Xa
\RS	SSKrSSKr	SSKrSSK3r4SSKrSSKrSSKrSSK
r
SSKrSSKJr SSKJr SSKJr SSKrSSKJrJrJrJrJr \R8S:gr\"5r/r S	q!\RD"5r#S5\$S'S	q%Sq&\\\'\$S'Sq(SS
\)SS4Sjjr*SSjr+S\'SS4Sjr,S\/S4SS4Sjr-S\\'\.4SS4Sjr/S\\'\.4S\'SS4Sjr0SSjr1Sr2SSjr3\S:Xa\3"5 gg!\a SrN�f=f)a7Automatically restart the server when a source file is modified.6 7Most applications should not access this module directly.  Instead,8pass the keyword argument ``autoreload=True`` to the9`tornado.web.Application` constructor (or ``debug=True``, which10enables this setting and several others).  This will enable autoreload11mode as well as checking for changes to templates and static12resources.  Note that restarting is a destructive operation and any13requests in progress will be aborted when the process restarts.  (If14you want to disable autoreload while using other debug-mode features,15pass both ``debug=True`` and ``autoreload=False``).16 17This module can also be used as a command-line wrapper around scripts18such as unit test runners.  See the `main` method for details.19 20The command-line wrapper and Application debug modes can be used together.21This combination is encouraged as the wrapper catches syntax errors and22other import-time failures, while debug mode catches changes once23the server has started.24 25This module will not work correctly when `.HTTPServer`'s multi-process26mode is used.27 28Reloading loses any Python interpreter command-line arguments (e.g. ``-u``)29because it re-executes Python using ``sys.executable`` and ``sys.argv``.30Additionally, modifying these variables will cause reloading to behave31incorrectly.32 33�N�__main__)�ioloop)�gen_log)�process)�Callable�Dict�Optional�List�Union�win32Fz.weakref.WeakKeyDictionary[ioloop.IOLoop, bool]�	_io_loops�_original_argv�34check_time�returnc�@�[RR5nU[;agS[U'[	[5S:�a[35R"S5 0n[R"[U5n[R"X05nUR5 g)z�Begins watching source files for changes.36 37.. versionchanged:: 5.038   The ``io_loop`` argument (deprecated since version 4.1) has been removed.39NT�z=tornado.autoreload started more than once in the same process)r�IOLoop�currentr
�lenr�warning�	functools�partial�_reload_on_update�PeriodicCallback�start)r�io_loop�modify_times�callback�	schedulers     �XD:\code\apps\devtools\python\user_packages\Python313\site-packages\tornado/autoreload.pyrrrsv���m�m�#�#�%�G��)����I�g��40�9�~������W�X�%'�L�� � �!2�L�A�H��'�'��=�I�
�O�O��c�x�[R"5nUR[5 UR5 g)z�Wait for a watched file to change, then restart the process.41 42Intended to be used at the end of scripts like unit test runners,43to run the tests again after any source file changes (but see also44the command-line interface in `main`)45N)rr�add_callbackr)rs r �waitr$�s&���m�m�o�G�������M�M�Or!�filenamec�.�[RU5 g)zLAdd a file to the watch list.46 47All imported modules are watched by default.48N)�_watched_files�add)r%s r �watchr)�s��49���x� r!�fnc�.�[RU5 g)z�Add a function to be called before reloading the process.50 51Note that for open file and socket handles it is generally52preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or53`os.set_inheritable`) instead of using a reload hook to close them.54N)�
_reload_hooks�append)r*s r �add_reload_hookr.�s������r!rc��[(ag[R"5bg[[R55R
55Hvn[U[R5(dM$[USS5nU(dM:URS5(dURS5(aUSSn[X5 Mx [Hn[X5 M g)N�__file__z.pycz.pyo�����)�_reload_attemptedr�task_id�list�sys�modules�values�56isinstance�types�57ModuleType�getattr�endswith�_check_filer')r�module�paths   r rr�s����������$�	��s�{�{�)�)�+�,��58�&�%�"2�"2�3�3���v�z�4�0�����=�=�� � �D�M�M�&�$9�$9����9�D��L�'�-����L�'�r!r?c���[R"U5RnX;aX U'gXU:wa"[R59"SU5 [
5 gg![a gf=f)Nz%s modified; restarting server)�os�stat�st_mtime�	Exceptionr�info�_reload)rr?�modifieds   r r=r=�se����7�7�4�=�)�)����%�T�����X�%����5�t�<��	�&������s� A�60A$�#A$c��Sq[H61nU"5 M [RS:wa&[R62"[RSS5 [(a[ce[n[nO.[[RSSS5n[RnU(a$URS:waSUR/USS-n[(d?[R "[R"/U-5 [$R&"S5 g[$R("[R"[R"/U-5 g)NTrrr�__spec__�-mr)r2r,r5�platform�signal�	setitimer�ITIMER_REAL�_autoreload_is_mainr�_original_specr;r6�argv�name�63_has_execv�64subprocess�Popen�65executablerA�_exit�execv)r*�specrQs   r rFrF�s�������66���67�|�|�w��	����+�+�Q��2�68���)�)�)������s�{�{�:�.�69�D�A���x�x����	�	�Z�'��d�i�i� �4���8�+���:����#�.�.�)�D�0�1�70�����71������#�.�.�!1�D�!8�9r!zv72  python -m tornado.autoreload -m module.to.run [args...]73  python -m tornado.autoreload path/to/script.py [args...]74c�f�SSKnSSKnS=URlq[R75nU=URlq[[RSSS5nU=URl	q	URS[SS9nUR5 URS	S76S77SS9 URS
SSS9 UR5upVURcIU(d.[!S[R"S9 [R$"S5 USnUSS[lO"Sn[R78S/U-[lSnSSKn	URbU	R)URSSS9 OUceU	R+USS9 Sn[,R."S5 U[lURbtURce[FRH"UR5nUbB[AU[JRLRN5(a[?URQ55 URR(aU(dg[U5 g![0a7n79U80R2n[,R."SU81R25 Sn82A83N�Sn84A85f[4a�n86[,R6"SSS9 [8R:"[R<"5S5Hup�p�[?U5 M [AU87[B5(a"U88RDb[?U89RD5 Sn90A91GN�Sn92A93ff=f)a�Command-line wrapper to re-run a script whenever its source changes.94 95Scripts may be specified by filename or module name::96 97    python -m tornado.autoreload -m tornado.test.runtests98    python -m tornado.autoreload tornado/test/runtests.py99 100Running a script with this wrapper is similar to calling101`tornado.autoreload.wait` at the end of the script, but this wrapper102can catch import-time problems like syntax errors that would otherwise103prevent the script from reaching its call to `wait`.104rNTrrIzpython -m tornado.autoreloadz3Either -m or a path must be specified, but not both)�prog�usage�epilogrJr>z
module to run)�dest�metavar�helpz--until-success�105store_truezCstop reloading after the program exist successfully (status code 0))�actionr`z%Either -m or a path must be specified)�filer)�run_name�	alter_sys)rdzScript exited normallyzScript exited with status %sz%Script exited with uncaught exception)�exc_info�)+�optparse�tornado.autoreload�106autoreloadrOr5rQrr;r6rP�OptionParser�_USAGE�disable_interspersed_args�107add_option�108parse_argsr>�print�stderr�exit�runpy�109run_module�run_pathrrE�110SystemExit�coderDr�	traceback�111extract_tbrfr)r8�SyntaxErrorr%�pkgutil�112get_loader�	importlib�abc�113FileLoader�get_filename�
until_successr$)rh�tornado�
original_argv�
original_spec�parser�opts�restr?�exit_statusrs�er%�linenorR�line�loaders                r �mainr��s���*��DH�G�G���*�-@��H�H�M�9F�F�G���%���C�K�K�114�3�Z��F�M�9F�F�G���%��
�
"�
"�
+��D�#��F�115�$�$�&�116���d��8�/��R�117�����
R���118�"�"�$�J�D��{�{����9��119�120�K��H�H�Q�K��A�w����7������H�H�Q�K�=�4�'���*+�K�/���;�;�"����T�[�[�:���N��#�#�#��N�N�4�*�N�5�&�����-�.��C�H��{�{���{�{�&�&�&��#�#�D�K�K�0����*�V�Y�]�]�5M�5M�"N�"N��&�%�%�'�(����+���F��A�=��f�f�����3�Q�V�V�<�<���
"����?�$�O�121-6�,@�,@�����PQ�AR�,S�(�H�d��(�O�-T��a��%�%��z�z�%��a�j�j�!���
"�s&�AI�122L0�-J�
L0�B
L+�+L0)i�)rN)4�__doc__rAr5�__name__r?�dirnamer0r�
importlib.abcr}r{rxr9rT�weakrefr�r�tornado.logrrrL�ImportError�typingrrr	r123rrKrS�setr'r,r2�WeakKeyDictionaryr
�__annotations__rOr�strrP�intrr$r)r.�floatrr=rFrlr��r!r �<module>r�s��� �<124�125�(�z���x�x��{�b�g�g�o�o�h�/�/��H�H�Q�K���	��126����������9�8�127�\�\�W�
$�128�����
�������129�;����&*����c��#�*����c��D��$	�!�C�!�D�!����T��*��t��(�D��e��$4�(��(�4130�d�3��:�.�131�c�132�d�133�$:�N134��b�J�z��	�F���}��
�F��s�D5�5E�?E
codekingpro/portable-devtools · Team Ai