Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
cli.cpython-313.pyc58 linesDownload Raw Back to __pycache__
1�

2��j���B�SSKrSSKrSSKrSSKrSSKrSSKJr SSKJr SSK	J3r4JrJrJ
r
JrJrJr SSKJr SSKJrJrJr SSKJrJrJr SS	KJr \R:"S55rS\S\4S
jr S\SS4Sjr!S\S\64Sjr"S\S\
\S\\S\\\\/\#44\44Sjr$g)�N)�Path)�dedent)�Any�Callable�List�Optional�Tuple�Union�cast�)�Change)�7BaseFilter�
DefaultFilter�PythonFilter)�detect_target_type�
import_string�run_process)�VERSIONzwatchfiles.cli�path_str�returnc�x�[U5nUR5(d[U5eUR5$)N)r�exists�FileNotFoundError�resolve)r�paths  �TD:\code\apps\devtools\python\user_packages\Python313\site-packages\watchfiles/cli.py�resolve_pathrs-����>�D��;�;�=�=���%�%��|�|�~���args_c
�	�U=(d [RSSn[R"S[	[8R=(d SRS55[RS9nURSSS	9 URS9SSS
S9 URSS[SS9 URSS[S/SQSS9 URSS[SSS9 URSS[SS9 URSSS S!9 URS"SS#S!9 URS$S[S%/S&QS'S9 URS(S[S)S*S9 URS+S[S,S-S9 URS.S[SS/S9 URS0SS1S!9 URS2S3S4S5[3S69 URU5nUR(a[ R"nO([%[ UR&R)55n[ R*"5nUR-U5 UR/[ R0"S7S8S995 [ R2"S5nUR5U5 UR-U5 UR6S:Xa[9UR:5nOUR6nUS::Xa~[<R?S;UR:5 [AUR:5 URB(a7UR:/[DRF"URB5-[lO&URB(a[<RIS<5 URJVs/sHn[MU5PM n	n[WURXURZ5up�[<R]S@[SAR_SBW	55UR:UU5 [aU	UR:UUU[ R":HURbURdURf(+URhURjSC.	6 gs snf![Na=n10[QS=U11S>3[RRS?9 [RT"S5 Sn12A13GN
Sn14A15ff=f)Da�16Watch one or more directories and execute either a shell command or a python function on file changes.17 18Example of watching the current directory and calling a python function:19 20    watchfiles foobar.main21 22Example of watching python files in two local directories and calling a shell command:23 24    watchfiles --filter python 'pytest --lf' src tests25 26See https://watchfiles.helpmanual.io/cli/ for more information.27rN�28watchfiles��29)�prog�description�formatter_class�targetz&Command or dotted function path to run)�help�paths�*�.z8Filesystem paths to watch, defaults to current directory)�nargs�defaultr(z--ignore-paths�?zrSpecify directories to ignore, to ignore multiple paths use a comma as separator, e.g. "env" or "env,node_modules")r,�typer(z
--target-type�auto)�command�functionr0z�Whether the target should be intercepted as a shell command or a python function, defaults to "auto" which infers the target type from the target string)r,r/r-�choicesr(z--filterr-z�Which files to watch, defaults to "default" which uses the "DefaultFilter", "python" uses the "PythonFilter", "all" uses no filter, any other value is interpreted as a python function/class path which is imported)r,r/r-r(z--argszbArguments to set on sys.argv before calling target function, used only if the target is a functionz	--verbose�30store_truez1Set log level to "debug", wins over `--verbosity`)�actionr(z--non-recursivez7Do not watch for changes in sub-directories recursivelyz--verbosity�info)�warningr6�debugzLog level, defaults to "info"z--sigint-timeout�z?How long to wait for the sigint timeout before sending sigkill.z--grace-periodrzKNumber of seconds after the process is started before watching for changes.z--sigkill-timeoutzLHow long to wait for the sigkill timeout before issuing a timeout exception.z--ignore-permission-deniedzEIgnore permission denied errors while watching files and directories.z	--versionz-V�versionz31%(prog)s v)r5r:z[%(asctime)s] %(message)sz%H:%M:%S)�fmt�datefmtr2z/target_type=function, attempting import of "%s"z1--args is only used when the target is a functionzpath "z" does not exist��fileu:watchfiles v%s 👀  path=%s target="%s" (%s) filter=%s...z, c3�.# �UHnSUS3v� M
 g7f)�"N�)�.0�ps  r�	<genexpr>�cli.<locals>.<genexpr>�s���*�E�q�A�a�S��(�E�s�)	r'�target_type�watch_filterr8�sigint_timeout�sigkill_timeout�	recursive�ignore_permission_denied�grace_period)6�sys�argv�argparse�ArgumentParserr�cli�__doc__�strip�RawTextHelpFormatter�add_argument�str�int�floatr�32parse_args�verbose�logging�DEBUG�getattr�	verbosity�upper�
StreamHandler�setLevel�setFormatter�	Formatter�	getLogger�33addHandlerrFrr'�loggerr8�import_exit�args�shlex�splitr7r)rr�print�stderr�exit�build_filter�filter�ignore_pathsr6�joinrrHrI�
non_recursiverKrL)
rrh�parser�
arg_namespace�	log_level�hdlr�	wg_loggerrFrCr)�erG�watch_filter_strs
             rrQrQs^��� �C�H�H�Q�R�L�D�
�
$�
$�
��C�K�K�-�2�4�4�T�:�;� �5�5��F�34����'O��P�35����s�C�.h��������
�
b��������
��/�
U��36������
��
_�
�37������
�
q�	������L�?r��s�38����,�5n��������
��,�
,�
�������
��
N��������
��
Z��������
��
[������$��
T���39����T�)�z�RY�QZ�E[��\��%�%�d�+�M�����M�M�	��G�]�%<�%<�%B�%B�%D�E�	�� � �"�D��M�M�)�����g�'�'�,G�Q[�\�]��!�!�,�/�I�
�����
���y�!�� � �F�*�(��)=�)=�>��#�/�/���j� ����F�
�H\�H\�]��M�(�(�)����%�,�,�-����M�<N�<N�0O�O�C�H��	�	�	����J�K��*7�*=�*=�>�*=�Q��a��*=��>�40&2�-�2F�2F�
�Hb�Hb�%c�"�L�41�K�K�D���	�	�*�E�*�*������
��	��#�#��!��7�=�=�(�$�3�3�%�5�5�#�1�1�1�!.�!G�!G�"�/�/���!?����
��q�c�)�*����<���������s*�Q�"P?�7Q�?Q�42R�2R�R�
function_pathc�:�[R"5nU[R;a[RR	U5 [U5$![a;n[SU3[RS9 [R"S5 SnAgSnAff=f)Nz
ImportError: r=r)43�os�getcwdrMr�appendr�ImportErrorrkrlrm)rz�cwdrxs   rrgrg�sk��44�)�)�+�C�45�#�(�(�����������]�+�+����
�
�a�S�!��46�47�3���������s�48 49A�50B�1B�B�filter_name�ignore_paths_strc��/nU(a8URS5Vs/sHn[U5R5PM nnUS:Xa[US9S4$US:Xa[	US9S4$US:XaU(a[51R
S5 g	[U5n[U[5(a'[U[5(aU"US9UR4$U(a[52R
S535 [U[5(a([U[5(aU"5UR4$[[[[ /["4U5nU[%U54$s snf)N�,r-)rpr�pythonr�allz>"--ignore-paths" argument ignored as "all" filter was selected)Nz(no filter)zN"--ignore-paths" argument ignored as filter is not a subclass of DefaultFilter)rjrrrrrfr7rg�54isinstancer/�55issubclass�__name__rrrr
rV�bool�repr)r�r�rprC�watch_filter_clsrGs      rrnrn�s2�� "�L��3C�3I�3I�#�3N�O�3N�a��Q����)�3N��O��i���,�7��H�H�	��	 ���6��F�F�	��	���N�N�[�\�"�"�;�/���"�D�)�)�j�9I�=�.Y�.Y��\�:�<L�<U�<U�U�U�����g�h��"�D�)�)�j�9I�:�.V�.V��!�#3�#<�#<�<�<��H�f�c�]�D�%8�9�;K�L���T�"2�3�3�3��-Ps�#E)%rOr[r|rirM�pathlibr�textwrapr�typingrrrrr	r56rr"r
�filtersrrr�runrrrr:rrdrfrVrrQrgr�rnrArr�<module>r�s�����	��57���D�D�D��<�<�?�?��	�	�	�+�	,���3��4��\��\��\�~	�s�	�s�	�4��4�(0��
�4�58�5��}�h���}�d�/B�&C�C�D�c�I�J�4r
codekingpro/portable-devtools · Team Ai