Skip to main content
Glama

ClickUp Operator

by noah-vh
generic.cpython-312.pyc19.6 kB
� lMg�5����ddlmZddlZddlZddlZddlZddlZddlmZddl m Z m Z m Z ddl mZddlmZmZmZmZiZej*d�Zd �Zd Zdd �Z dd �ZGd �de �Z dd�Zdd�Zd�Zy)�)� annotationsN)�Optional�)�AsyncFileSystem�_run_coros_in_chunks� sync_wrapper)�DEFAULT_CALLBACK)� filesystem�get_filesystem_class�split_protocol� url_to_fszfsspec.genericc �*�t|fi|��t|<y�N)r � _generic_fs)�protocol�storage_optionss �ZC:\Users\noahv\Documents\GitHub\clickup-operator\.venv\Lib\site-packages\fsspec/generic.py�set_generic_fsrs��&�x�C�?�C�K����defaultc�*�|xst}|xst|�d}|xsi}|dk(r t|�S|dk(r t|S|dk(rt |�}|j �S|dk(r!t |fi|j|i���\}}|Std|����)zPick instance of backend FSrr�generic�current�optionszUnknown FS resolution method: ) �default_methodr r rr rr �get� ValueError)�url�methodrr�cls�fs�_s r� _resolve_fsr#s��� � %�~�F��1�>�#�.�q�1�H�%�+��O� ����(�#�#� ����8�$�$� ���"�8�,���{�{�}�� ����#�C��!4�!4�X�r�!B�C���A�� � �5�f�X�>� ?�?rc ��|xstdi|xsi��}|j|�}|j|�}|j|dd��} |j|�s t d��|j|dd��} | j �D� � cgc]#\} } | ddk(r| j ||�| vr| ��%} } } tjt| ��d��| r1|j| D�cgc]}|j ||���c}d��| j �D� � cic]\} } | ddk(s�| | ��} } } tjt| ��d ��| j �D�� cgc]#\}} |j ||�| vr | ddk(r|��%}}} | j�j �D]�\}} |j ||�}|| vrc|d k(r|| |<�'|d k(s�-t|�r|| �n| |}| |}t|�r||�n||}||k7r|| |<�m| j|��|| |<��tjt| ��d ��| r-t| j ��\}}|j||fi|��tjt|��d ��|r|r|j!|�| Scc} } wcc}wcc} } wcc} }w)aUSync files between two directory trees (experimental) Parameters ---------- source: str Root of the directory tree to take files from. This must be a directory, but do not include any terminating "/" character destination: str Root path to copy into. The contents of this location should be identical to the contents of ``source`` when done. This will be made a directory, and the terminal "/" should not be included. delete_missing: bool If there are paths in the destination that don't exist in the source and this is True, delete them. Otherwise, leave them alone. source_field: str | callable If ``update_field`` is "different", this is the key in the info of source files to consider for difference. Maybe a function of the info dict. dest_field: str | callable If ``update_field`` is "different", this is the key in the info of destination files to consider for difference. May be a function of the info dict. update_cond: "different"|"always"|"never" If "always", every file is copied, regardless of whether it exists in the destination. If "never", files that exist in the destination are not copied again. If "different" (default), only copy if the info fields given by ``source_field`` and ``dest_field`` (usually "size") are different. Other comparisons may be added in the future. inst_kwargs: dict|None If ``fs`` is None, use this set of keyword arguments to make a GenericFileSystem instance fs: GenericFileSystem|None Instance to use if explicitly given. The instance defines how to to make downstream file system instances from paths. Returns ------- dict of the copy operations that were performed, {source: destination} T)�withdirs�detailzCan only rsync on a directory�type� directoryz directories to create��exist_ok�filez files to consider for copy�always� differentz files to copyz files to delete�)�GenericFileSystem�_strip_protocol�find�isdirr�items�replace�logger�debug�len�make_many_dirs�copy�callable�pop�zip�cp�rm)�source� destination�delete_missing� source_field� dest_field� update_cond� inst_kwargsr!�kwargs�allfiles� otherfiles�a�v�dirs�dirn�o� to_delete�k� otherfile�inf1�v2�inf2� source_files� target_filess r�rsyncrV+s���h � 7� �7�K�$5�2�7�B� � � �� '�F��$�$�[�1�K��w�w�v��T�w�:�H� �8�8�F� ��8�9�9�����t�D��A�J��N�N�$� �$�D�A�q� �V�9� � #�� � �&�+�(F�j�(X� �$� � �  �L�L�C��I�;�4�5�6� � ���;?� @�4�4�T�\�\�&�+� .�4� @�4� � �"*���!1�I�!1���A�Q�v�Y�&�5H��1��!1�H�I� �L�L�C��M�?�"=�>�?��$�$�&��&�D�A�q� �9�9�[�&� )�� 9�a��i�6�>Q� �&��� � � ��%�%�'���1��I�I�f�k�2� � � � "��h�&�'��� �� �+�*2�<�*@�|�A��a� �o��� �*��)1�*�)=�z�"�~�2�j�>���4�<�"+�H�Q�K��L�L��O�$�H�Q�K�#(�$ �L�L�C��M�?�.�1�2��%(�(�.�.�*:�%;�"� �l� ����l�L�3�F�3� �L�L�C� �N�#�#3�4�5��)� ���i�� �O��U �� A��I��s� (K�*K �K�0K�,(Kc���eZdZdZdZd�fd� Zd�Zd�Zdd�Zd�Z dd�Z d �Z d �Z d �Z dd �Zd �Zdefd�Zdd�Zee�Z d dd�Z�xZS)r/a^Wrapper over all other FS types <experimental!> This implementation is a single unified interface to be able to run FS operations over generic URLs, and dispatch to the specific implementations using the URL protocol prefix. Note: instances of this FS are always async, even if you never use it with any async backend. rc �2��||_t�|�di|��y)aK Parameters ---------- default_method: str (optional) Defines how to configure backend FS instances. Options are: - "default": instantiate like FSClass(), with no extra arguments; this is the default instance of that FS, and can be configured via the config system - "generic": takes instances from the `_generic_fs` dict in this module, which you must populate before use. Keys are by protocol - "current": takes the most recently instantiated version of each FS Nr.)r�super�__init__)�selfrrF� __class__s �rrZzGenericFileSystem.__init__�s���%�� � ���"�6�"rc�n�t||j�}|j|j|��Sr)r#r�unstrip_protocol�_parent�r[�pathr!s rr_zGenericFileSystem._parent�s,�� ��t�{�{� +���"�"�2�:�:�d�#3�4�4rc�n�t||j�}|j|j|��Sr)r#rr^r0r`s rr0z!GenericFileSystem._strip_protocol�s.�� ��t�{�{� +���"�"�2�#5�#5�d�#;�<�<rc��hK�t||j�}|jr |j|f||dd�|���d{���}n|j|f||dd�|��}i}|j �D]0\} } | j �} |j| �} | | d<| || <�2|r|St|�S7�p�w)NT)�maxdepthr%r&�name) r#r� async_impl�_findr1r3r9r^�list) r[rardr%r&rFr!�out�resultrOrJres rrgzGenericFileSystem._find�s����� ��t�{�{� +�� �=�=� ������'�(�4��KQ���C��"�'�'���'�(�4��KQ��C����I�I�K�D�A�q�����A��&�&�q�)�D��A�f�I��F�4�L�  � ��M��F�|���s�=B2�B0�A1B2c��K�t||j�}|jr|j|fi|���d{���}n|j|fi|��}|j �}|j |d�|d<|S7�A�w)Nre)r#rrf�_info�infor9r^)r[rrFr!ris rrlzGenericFileSystem._info�sw���� ��d�k�k� *�� �=�=� �����/��/�/�C��"�'�'�#�(��(�C��h�h�j���)�)�#�f�+�6��F� �� � 0�s�9A?�A=�AA?c��pK�t||j�}|jr|j|fddi|���d{���}n|j|fddi|��}|D�cgc]}|j ���}}|D]}|j |d�|d<�|r|S|D�cgc]}|d�� c}S7�lcc}wcc}w�w)Nr&Tre)r#rrf�_ls�lsr9r^)r[rr&rFr!rirMs rrozGenericFileSystem._ls�s����� ��d�k�k� *�� �=�=�����s�:�4�:�6�:�:�C��"�%�%��3�D�3�F�3�C�!$�%��A�q�v�v�x���%��A��+�+�A�f�I�6�A�f�I�� ��J�'*�+�s�!�A�f�I�s�+� +�;��&�� ,�s-�;B6�B*�B6�B,�3(B6� B1�'B6�, B6c��K�t||j�}|jr|j|fi|���d{���S|j|fi|��S7��wr)r#rrf� _cat_file�cat_file)r[rrFr!s rrrzGenericFileSystem._cat_file�sS���� ��d�k�k� *�� �=�=�%����c�4�V�4�4� 4��2�;�;�s�-�f�-� -�5�s�9A�A�Ac��K�t||j�}|jr|j||fi|���d{���S|j||fi|��S7��wr)r#rrf� _pipe_file� pipe_file)r[ra�valuerFr!s rruzGenericFileSystem._pipe_file�sW���� ��t�{�{� +�� �=�=�&����t�U�=�f�=�=� =��2�<�<��e�6�v�6� 6�>�s�:A�A�Ac���K�|}t|t�r|g}t|d|j�}|jr|j |fi|���d{���y|j |fi|��y7��w)Nr)� isinstance�strr#rrf�_rmr>)r[rrF�urlsr!s rr{zGenericFileSystem._rmsh������ �d�C� ��6�D� ��a��$�+�+� .�� �=�=��"�&�&��(��(� (� (� �B�E�E�#� �� � )�s�AA/�A-�A/c���K�tjd|�t||j�}|jr|j ||���d{���y|j ||��y7��w)Nz Make dir %sr))r5r6r#rrf� _makedirs�makedirs)r[rar*r!s rr~zGenericFileSystem._makedirssV����� � �]�D�)� ��t�{�{� +�� �=�=��,�,�t�h�,�7� 7� 7� �K�K��x�K� 0� 8�s�AA-�A+�A-c �"�t||fd|i|��y)z[Sync files between two directory trees See `func:rsync` for more details. r!N)rV)r[r?r@rFs rrVzGenericFileSystem.rsyncs�� �f�k�5�d�5�f�5ric��:K�t||j�}t||j�}||ur<|jr|j||fi|���d{���S|j||fi|��Sddd�} t |d�r|j |d��d{���n|j|dfi|��} |jt| j��d{����t |d�r|j |d��d{���n|j|dfi|��} | j�| j�| jkr�t| j|���d{���} | j�| snlt| j| ���d{���|j| j��| j��| j�| jkr�� t| j���d{���t| j���d{���y7���7���7��S7��,7��7��7�67�#t $rYywxYw# t j���d{���7t j���d{���7w#t $rYwwxYwxYw�w)Nr�none)� blocksize� cache_type� open_async�rb�wb)r#rrf�_cp_file�cp_file�hasattrr��open�set_size� maybe_await�size�tell�read�write�absolute_update�close� NameError) r[r�url2r��callbackrFr!�fs2�kw�f1�f2�datas rr�zGenericFileSystem._cp_files:������d�k�k� *���$�� � �,�� ��9��}�}�(�R�[�[��d�=�f�=�=�=�!�r�z�z�#�t�6�v�6�6��F� 3�� ��2�|�,��m�m�C��.�.�.��R�W�W�S�$�-�"�-� � � � �K����$8�8� 9��3� �-��n�n�T�4�0�0�0��S�X�X�d�D�/�B�/� � �'�'�/�R�W�W�Y����%8�(�����);�<�<���7�7�?�4��!�"�(�(�4�.�1�1�1��(�(�����3� �'�'�/�R�W�W�Y����%8� �!�"�(�(�*�-�-�-�!�"�(�(�*�-�-�-�3>�� /��9��0�� =��2��.��-��� �� �� �!�"�(�(�*�-�-�-�!�"�(�(�*�-�-�-��� �� �s �AJ�H�J�5!I�H"�;I�H%�)I�<H(�=AI�H+�0I� H-� /I�=I�H3�8H/�9 H3�H1�H3�J�"I�%I�(I�+I�-I�/H3�1H3�3 H?�<J�>H?�?J�J�J � I#�!!J �J�J �J� J�J�J�J�Jc��K�t|d|j�}|jr4|D�cgc]}|j||����}}t |��d{���y|D]}|j ||���ycc}w7�%�w)Nrr))r#rrfr~rr)r[r|r*r!�u�coross r�_make_many_dirsz!GenericFileSystem._make_many_dirsHss���� ��a��$�+�+� .�� �=�=�AE�F��A�R�\�\�!�h�\�7��E�F�&�u�-� -� -���� � �A�� �1���G� -�s�*A>�A7�A>�A<�&A>c ��<K�|rt�t|d|j�} t|d|j�} | | ur<| jr| j||fi|���d{���S| j ||fi|��St | || ||||���d{���y7�37��w)Nr��on_error)�NotImplementedErrorr#rrf�_copyr9� copy_file_op) r[�path1�path2� recursiver�rd� batch_size�tempdirrFr!r�s rr�zGenericFileSystem._copySs����� �%� %� ��q��4�;�;� /���%��(�D�K�K�0�� ��9��}�}�%�R�X�X�e�U�=�f�=�=�=��r�w�w�u�e�6�v�6�6�� ��s�E�7�J�� � � �>�� �s$�A"B�$B�%-B�B�B�B)r)NFF)T)F)F�ignoreNNN)r�� list[str]r�r�r��boolr�rzrd� Optional[int]r�r�r�z Optional[str])�__name__� __module__� __qualname__�__doc__rrZr_r0rgrlrorrrur{r~rVr r�r�rr8r�� __classcell__)r\s@rr/r/�s���� ��H�#�"5�=� �(��,�& .� 7�!�1�6��!� )�V2�"�/�2�N�  � �"&�$(�!%� �� �� ��  � �  �  �  �"� �� rr/c��K�ddl}|xs|j�} t||�D�� cgc]P\}} t|||| tj j |tj�j�|����R} }} t| |���d{���tj|�ycc} }w7� #tj|�wxYw�w)Nrr�)r�) �tempfile�mkdtempr<� _copy_file_op�osra�join�uuid�uuid4�hexr�shutil�rmtree) �fs1�url1r�r�r�r�r�r��u1�u2r�s rr�r�ns�������+��)�)�+�G���d�D�/�  �*���B� �������� � �W�d�j�j�l�&6�&6�7�!�  �*� �  �#�5�Z�@�@�@�� � �g���  � A��� � �g��s:�C�B6�AB.�B6�B4�B6�C�.B6�6C � Cc���K�|dk(rdnt}tjd||� |jr|j ||��d{���n|j ||�|jr|j ||��d{���n|j||�tj|�tjd||�y7�}7�F#|$r!}tjd||�Yd}~yd}~wwxYw�w)N�raiser.z Copy %s -> %szCopy %s -> %s; donez ignoring cp exception for %s: %s) � Exceptionr5r6rf� _get_file�get_file� _put_file�put_filer��unlink)r�r�r�r��localr��ex�es rr�r��s������7�"�� �B� �L�L��$��-� B� �>�>��-�-��e�,� ,� ,� �L�L��u� %� �>�>��-�-��t�,� ,� ,� �L�L��� %� � � �%��� � �*�D�$�7� -�� -�� �B�� � �7��q�A�A��B�sS�%C4�!C � C� 8C �C �AC �C4�C � C � C1�C,�'C4�,C1�1C4c��PK�tj|�r |�d{���S|S7��wr)�inspect� iscoroutine)�cors rr�r��s&�������3���y��� ��s �&�$�&)NNN)Fr�r�r-NN)N�r�)r�)� __future__rr��loggingr�r�r��typingr�asynrrr� callbacksr �corer r r r r� getLoggerr5rrr#rVr/r�r�r�r.rr�<module>r�s���"��� � � ��E�E�'�M�M�� � �� � �+� ,��D���@�*����� �e�PX ��X �xAI��.B�$r

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/noah-vh/mcp-server-clickup'

If you have feedback or need assistance with the MCP directory API, please join our Discord server