Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2�j�'���SSKrSSKrSSKrSSKrSSKrSSKrSSKJrJr SSK	J3r4JrJrJ
r
 SSKJr SSKJr \R$"S5r"SS\
5rS	S5S6\4SjrSr\S
:XaSSKr\"\R2SS5 gg)�N)�EIO�ENOENT)�FUSE�FuseOSError�LoggingMixIn�7Operations)�__version__)�	url_to_fs�fsspec.fusec�r�\rSrSrSSjrSSjrSrSrSrSr	S	r8SS9jrSrSSjr
S
rSrSrSrg)�FUSEr�c��Xl0UlURS5S-UlSUl[10R
SU5 X0lg)N�/rzStarting FUSE at %s)�fs�cache�rstrip�root�counter�logger�info�_ready_file)�selfr�path�11ready_files    �QD:\code\apps\devtools\python\user_packages\Python313\site-packages\fsspec/fuse.py�__init__�FUSEr.__init__s?������12��K�K��$�s�*��	�������)�4�0�%��Nc�@�[RSU5 UR(aUS;aSSS.$SRURURS5/5R
S5nURRU5nURSS	5URS13S	5S.nURSS
5nUSS:wa![RU-US'SUS'SUS'O([RU-US'USUS'SUS'SUS'SU;aUSO[ R "5US'SU;aUSO[ R "5US'SU;aUSO[ R "5US'U$![an[[5UeSnAff=f)Nz14getattr %s�z/.fuse_readyz.fuse_ready�file�)�type�st_size�r�uidi��gid)�st_uid�st_gid�modei�r$�st_moderr%�15st_blksize�sizeiP��st_nlink�atime�st_atime�ctime�st_ctime�mtime�st_mtime)r�debugr�joinr�lstriprrr�FileNotFoundErrorrr�get�stat�S_IFDIR�S_IFREG�time)rr�fhr�exc�data�perms       r�getattr�
FUSEr.getattrs|�����\�4�(�����(G� G�"�q�1�1��w�w��	�	�4�;�;�s�#3�4�5�<�<�S�A��	/��7�7�<�<��%�D��(�(�5�$�/�4�8�8�E�4�;P�Q���x�x���&����<�6�!�"�l�l�T�1�D��O��D��O�!"�D���"�l�l�T�1�D��O�"�6�l�D��O�!*�D��� �D���,3�t�O�4��=������Z��,3�t�O�4��=������Z��,3�t�O�4��=������Z�����%!�	/��f�%�3�.��	/�s�/E>�>16F�F�Fc�R�[RSU5 SRURUR	S5/5nUR17R
US5nUVs/sH1n[RRURS55PM3 nnSS/U-$s snf)Nz18readdir %sr&rF�.z..)rr7r8rr9r�ls�osr�basenamer)rrr@�files�fs     r�readdir�
FUSEr.readdir6s������\�4�(��w�w��	�	�4�;�;�s�#3�4�5�����19�20�4��'��:?�@�%�Q����!�!�!�(�(�3�-�0�%��@��T�{�U�"�"��As�#8B$c��SRURURS5/5nURR	U5 g�Nr&rr)r8rr9r�mkdir�rrr+s   rrQ�FUSEr.mkdir=�5���w�w��	�	�4�;�;�s�#3�4�5�����
�
�d��rc��SRURURS5/5nURR	U5 grP)r8rr9r�rmdir)rrs  rrV�FUSEr.rmdirBrTrc���[RSXU45 UR(aUS;agURUnUR	U5 URU5nU$)Nzread %sr!sready)rr7rr�seek�read)rrr.�offsetr@rL�outs       rrZ�21FUSEr.readGsS�����Y��V� 4�5�����(G� G���J�J�r�N��	���v���f�f�T�l���22rc��[RSX45 URUnURU5 UR	U5 [U5$)Nzwrite %s)rr7rrY�write�len)rrrBr[r@rLs      rr_�FUSEr.writeRs?�����Z�$��0��J�J�r�N��	���v��	����
��4�y�rc�n�[RSX45 SRURUR	S5/5nUR23R
U5 UR24RUS5nXPRUR'U=RS-
sl	URS-25$)Nz	create %sr&r�wbr/)26rr7r8rr9r�touch�openrr)rr�flags�fi�fnrLs      r�create�FUSEr.createYs������[�4�-�0�
�W�W�d�i�i����S�!1�2�
3�����
�
�b���G�G�L�L��T�"��#$�27�28�4�<�<� ��������|�|�a��rc�P�[RSX45 SRURUR	S5/5nUS-S:XaSnOSnUR29R
X45URUR'U=RS-
slURS-30$)	Nzopen %sr&r�r�rbrcr/)	rr7r8rr9rrerr)rrrfrhr+s     rre�31FUSEr.openbs������Y��
�.�
�W�W�d�i�i����S�!1�2�
3���1�9��>��D��D�#'�7�7�<�<��#9��32�33�4�<�<� ��������|�|�a��rc��SRURURS5/5nUS:wa[eURRU5 grP)r8rr9�NotImplementedErrorrrd)rr�lengthr@rhs     r�truncate�FUSEr.truncateos?��
�W�W�d�i�i����S�!1�2�
3���Q�;�%�%����
�
�b�rc���SRURURS5/5nURR	US5 g![34[4an[[5UeSnAff=f)Nr&rF)	r8rr9r�rm�OSErrorr:rr)rrrhrAs    r�unlink�FUSEr.unlinkvs\��
�W�W�d�i�i����S�!1�2�
3��	,��G�G�J�J�r�5�!���*�+�	,��c�"��+��	,�s�A�A0�A+�+A0c���X R;a:URUnUR5 URRU5 g![an[	U5 SnAgSnAff=f)Nr)r�close�pop�	Exception�print)rrr@rL�es     r�release�
FUSEr.release}sZ��	��Z�Z���J�J�r�N�����	��35�36���r�"����	��!�H�H���	�s�A	A�37A+�A&�&A+c���[URS5(aGSRURUR	S5/5nURRX5$[e)N�chmodr&r)�hasattrrr8rr9r�rprRs   rr��FUSEr.chmod�sL���4�7�7�G�$�$��7�7�D�I�I�t�{�{�3�'7�8�9�D��7�7�=�=��,�,�!�!r)rrrrr)F)N)�__name__�38__module__�__qualname__�__firstlineno__rrDrMrQrVrZr_rirerrrwrr��__static_attributes__�rrr
r
sC��&��8#��39�40	�� � ��,��"rr
TFc��^^^^^^^�UUUUUUU4SjnT(d-[R"US9nSUlUR5 U$U"5 g![a gf=f)a�Mount stuff in a local directory41 42This uses fusepy to make it appear as if a given path on an fsspec43instance is in fact resident within the local file-system.44 45This requires that fusepy by installed, and that FUSE be available on46the system (typically requiring a package to be installed with47apt, yum, brew, etc.).48 49Parameters50----------51fs: file-system instance52    From one of the compatible implementations53path: str54    Location on that file-system to regard as the root directory to55    mount. Note that you typically should include the terminating "/"56    character.57mount_point: str58    An empty directory on the local file-system where the contents of59    the remote path will appear.60foreground: bool61    Whether or not calling this function will block. Operation will62    typically be more stable if True.63threads: bool64    Whether or not to create threads when responding to file operations65    within the mounter directory. Operation will typically be more66    stable if False.67ready_file: bool68    Whether the FUSE process is ready. The ``.fuse_ready`` file will69    exist in the ``mount_point`` directory if True. Debugging purpose.70ops_class: FUSEr or Subclass of FUSEr71    To override the default behavior of FUSEr. For Example, logging72    to file.73 74c�2>�[T"TTTS9TT(+TS9$)N)r)�	nothreads�75foreground)r)r�r�mount_point�	ops_classrr�threadss�������r�<lambda>�run.<locals>.<lambda>�s!���4��"�d�z�2���+��	r)�targetTN)�	threading�Thread�daemon�start�KeyboardInterrupt)	rrr�r�r�rr��func�ths	```````  r�runr��sV���X��D��
�
�
�T�
*����	�76���77��	�	��F�� �	��	�s�	A�78A�Ac79�p�"SS[R5nU"S[RS9nUR	SS[80S9 UR	S[S	S819 UR	S[SS829 UR	S
[SS839 UR	SSSSS9 UR	SS[SS849 UR	SSSSS9 UR	SSSSS9 UR	SSSS S9 URU5n0nUR=(d /H�nURS!5upVnU(dURS"U<3S#9 UR5nURS$5(a[US%[S$5*5nO(URS&5(aUS%[S&5*S';nS(U;a)URS(S)5up�X�;a	XsU	U85'M�X�0X9'M�XsU'M� UR (aE["R$"["R&UR S*S+9 "S,S-[([*5nUnO[(n[-UR.40UD6up�[0R3S.U[
UR455 [7U
UR8UR4UR:UR<UR>US/9 g%)0a]Mount filesystem from chained URL to MOUNT_POINT.86 87Examples:88 89python3 -m fsspec.fuse memory /usr/share /tmp/mem90 91python3 -m fsspec.fuse local /tmp/source /tmp/local \92        -l /tmp/fsspecfuse.log93 94You can also mount chained-URLs and use special settings:95 96python3 -m fsspec.fuse 'filecache::zip::file://data.zip' \97        / /tmp/zip \98        -o 'filecache-cache_storage=/tmp/simplecache'99 100You can specify the type of the setting by using `[int]` or `[bool]`,101(`true`, `yes`, `1` represents the Boolean value `True`):102 103python3 -m fsspec.fuse 'simplecache::ftp://ftp1.at.proftpd.org' \104        /historic/packages/RPMS /tmp/ftp \105        -o 'simplecache-cache_storage=/tmp/simplecache' \106        -o 'simplecache-check_files=false[bool]' \107        -o 'ftp-listings_expiry_time=60[int]' \108        -o 'ftp-username=anonymous' \109        -o 'ftp-password=xieyanbo'110c�(^�\rSrSrU4SjrSrU=r$)�*main.<locals>.RawDescriptionArgumentParser��c�>�[TU]5nURS5nURR	5US'SRU5$)Nz111 112r/)�super�format_help�split�descriptionrr8)r�usage�parts�	__class__s   �rr��6main.<locals>.RawDescriptionArgumentParser.format_help�sE����G�'�)�E��K�K��'�E��'�'�.�.�0�E�!�H��;�;�u�%�%rr�)r�r�r�r�r�r��
__classcell__)r�s@r�RawDescriptionArgumentParserr��s
���	&�	&rr�r)�progr�z	--version�version)�actionr��urlzfs url)r$�help�source_pathzsource directory in fsr�zlocal directoryz-oz--option�appendz3Any options of protocol included in the chained URL)r�r�z-lz113--log-filez%Logging FUSE debug info (Default: '')z-fz--foreground�store_falsez-Running in foreground or not (Default: False)z-tz	--threadsz-Running with threads support (Default: False)z-rz--ready-filezZThe `.fuse_ready` file will exist after FUSE is ready. (Debugging purpose, Default: False)�=zWrong option: )�messagez[int]Nz[bool])�1�yes�true�-r/z%(asctime)s %(message)s)�level�filename�formatc��\rSrSrSrg)�main.<locals>.LoggingFUSEri-r�N)r�r�r�r�r�r�rr�LoggingFUSErr�-s��rr�zMounting %s to %s)r�r�rr�) �argparse�ArgumentParser�main�__doc__�add_argumentr	�str�114parse_args�option�	partition�error�lower�endswith�intr`r��log_file�logging�basicConfig�DEBUGr
rr115r�rr7r�r�r�r�r�r)�argsr��parser�kwargs�item�key�sep�value�val�fs_name�setting_namer��fuserr�url_paths               rr�r��s���8&�x�'>�'>�&�*�}�$�,�,�
W�F�116����I�{��K�117����C�h��7�118���
�C�6N��O�119���
�C�6G��H�120������
B�	������l��+R���������
<�	��������
<�	��������.�	�����T�"�D�
�F����!�r�!���.�.��-���%���L�L�>�$��!:�L�;��k�k�m���<�<�� � ���o��W��
�.�/�E�
�\�\�(�
#�
#��(�3�x�=�.�)�-A�A�E��#�:�$'�I�I�c�1�$5�!�G�� �05�w���-�#/�"7����3�K�#"�&�}�}�����-�-��]�]�,�	121�	�5�,�	������T�X�X�0��0�L�B�122�L�L�$�h��D�4D�4D�0E�F��123��������?�?�����?�?��r�__main__r/)r�r�rIr<r�r?�errnorr�fuserrrr�fsspecr	�fsspec.corer124�	getLoggerrr
r�r�r��sys�argvr�rr�<module>r�s�����	�����<�<��!�	�	�	�=�	)��z"�J�z"�B����;�|r�j�z�������!�"���r
codekingpro/portable-devtools · Team Ai