Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2�j���B�SSKrSSKrSSKJr SSKJr "SS\5rg)�N)�AbstractFileSystem�)�3MemoryFilec�^�\rSrSrSrSrSrSU4Sjjr\U4Sj5r	Sr4\S5r\SS	j5r
SS5jrSSjrSSjrSS
jrSrU=r$)�
GitFileSystem�6zTBrowse the files of a local git repo at any hash/tag/branch7 8(experimental backend)9�Tc��>�[TU]"S0UD6 [R"U=(d U=(d [R10"55UlU=(d SUlg)a�11 12Parameters13----------14path: str (optional)15    Local location of the repo (uses current directory if not given).16    May be deprecated in favour of ``fo``. When used with a higher17    level function such as fsspec.open(), may be of the form18    "git://[path-to-repo[:]][ref@]path/to/file" (but the actual19    file path should not contain "@" or ":").20fo: str (optional)21    Same as ``path``, but passed as part of a chained URL. This one22    takes precedence if both are given.23ref: str (optional)24    Reference to work with, could be a hash, tag or branch name. Defaults25    to current working tree. Note that ``ls`` and ``open`` also take hash,26    so this becomes the default for those operations27kwargs28�masterN�)�super�__init__�pygit2�29Repository�os�getcwd�repo�ref)�self�path�for�kwargs�	__class__s     ��`D:\code\apps\devtools\python\user_packages\Python313\site-packages\fsspec/implementations/git.pyr�GitFileSystem.__init__sB���(	���"�6�"��%�%�b�&?�D�&?�B�I�I�K�@��	��?�(���c��>�[TU]U5RS5nSU;aURSS5SnSU;aURSS5SnURS5$)N�/�:r�@)r
�_strip_protocol�lstrip�split)�clsrrs  �rr!�GitFileSystem._strip_protocol+sd����w�&�t�,�3�3�C�8���$�;��:�:�c�1�%�a�(�D��$�;��:�:�c�1�%�a�(�D��{�{�3��rc�.�URRU=(d UR5up2URS5nURnUHAnU(dM[U[R5(dM-Xe;a[U5eXVnMC U$)Nr)	r�resolve_refishrr#�tree�30isinstancer�Tree�FileNotFoundError)rrr�comm�partsr(�parts       r�_path_to_object�GitFileSystem._path_to_object4st���I�I�,�,�S�_�D�H�H�=�	���31�32�3����y�y���D��t�33�4����5�5��#�+�D�1�1��z��	�34�rc��URS5n0nSU;aURSS5uUS'nSU;aURSS5uUS'nU$)Nzgit://rrrr r)�removeprefixr#)r�outs  r�_get_kwargs_from_urls�#GitFileSystem._get_kwargs_from_urls?s\��� � ��*�����$�;� $�35�36�3�� 2��C��K���$�;�#�z�z�#�q�1��C��J���37rc�h�[U[R5nU(aSOSU(a4SRXR=(d S/5RS5OUR[
UR5URcSO
URSU(aSS.$URS.$)	N�	directory�filerr	�100644�or)�type�name�hex�mode�size)38r)rr*�joinr<r"�str�id�filemoder?)�objr�is_dirs   r�_object_to_info�GitFileSystem._object_to_infoIs����C����-��#)�K�v�@D����$����B�/�0�7�7��<�#�(�(��s�v�v�;� #��� 4�H�S�\�\�!�<L��A�39�	40�&)�X�X�41�	42rc��URURU5U5n[U[R5(aUOU/Vs/sH7nU(a[43R
Xa5O[44R
Xa5SPM9 sn$s snf)Nr<)r/r!r)rr*rrF)rr�detailrrr(rDs       r�ls�GitFileSystem.lsWs����#�#�D�$8�$8��$>��D��45!+�4���� =� =��D�6�I�	46�J���
�)�)�#�4��.�.�s�9�&�A�
B�J�	47�	48��49s�>B	c�n�URURU5U5n[RXA5$�N)r/r!rrF)rrrrr(s     r�info�GitFileSystem.info`s0���#�#�D�$8�$8��$>��D���,�,�T�8�8rc�&�URXS9S$)N)rr=)rN)rrrs   r�ukey�GitFileSystem.ukeyds���y�y��y�'��.�.rc�p�URX=(d UR5n[URS9$)N)�data)r/rrrT)	rrr>�50block_size�51autocommit�
cache_optionsrrrDs	         r�_open�GitFileSystem._opengs+���"�"�4�����9���s�x�x�(�(r)rr)NNNrM)TN)�rbNTNN)�__name__�52__module__�__qualname__�__firstlineno__�__doc__�root_marker�cachabler�classmethodr!r/�staticmethodr4rFrJrNrQrX�__static_attributes__�
__classcell__)rs@rrr53s�����54�K��H�#�0� �� �	������55��56�57�9�/������)�)rr)rr�fsspec.specr�memoryrrrrr�<module>rhs ��	�
�*��h)�&�h)r
codekingpro/portable-devtools · Team Ai