ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/clquota/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clquota/__pycache__/utils.cpython-311.pyc

�

E��f'
���ddlmZddlmZddlmZddlZddlZddlZddlZddlm	Z	ddl
mZdefd�Z
defd	�Zdefd
�Zd�Zd�Zd
�Zd�ZdS)�)�print_function)�division)�absolute_importN)�UIConfig)�FormattedException�idc
��t|�����}t|��dkrdSttd�||d����}dg}|�dgt|��z��d�|��}t
|t|g|z��z��t
d��t||���D][}|g}|�ttd	�||������t
|t|��z���\dS)
z"
    Prints data as pure text
    rNc��|dS�Nr���xs �D/opt/cloudlinux/venv/lib64/python3.11/site-packages/clquota/utils.py�<lambda>zprint_text.<locals>.<lambda>�
���1���z%32sz%16s�zP--------------------------------------------------------------------------------��keyc��|dS�N�rr
s rrzprint_text.<locals>.<lambda>"�
��a��d�r)	�list�keys�len�map�extend�join�print�tuple�sorted)	�data�title�sort_key�	data_keys�fields�fmt_list�fmt�item�rows	         r�
print_textr,s(���T�Y�Y�[�[�!�!�I�
�9�~�~������
�#�~�~��Y�q�\�(:�;�;�
<�
<�F��x�H��O�O�V�H��F���,�-�-�-�
�'�'�(�
�
�C�	�#��u�g��&�'�'�
'�(�(�(�	�(�O�O�O��y�h�/�/�/� � ���f���
�
�4��]�]�T�$�Z�8�8�9�9�:�:�:�
�c�E�#�J�J������ � rc
�v�t|�����}t|��dkrdSttd�||d����}|g|z}t	jtjtj���}d�	dgt|��z��}t|t|��z��t||���D]Q}|g}|�
ttd�||������|�|���RdS)	z/
    Prints data as comma separated values
    rNc��|dSrrr
s rrzprint_csv.<locals>.<lambda>-rr��quoting�,z%src��|dSrrr
s rrzprint_csv.<locals>.<lambda>4rr)rrrr�csv�writer�sys�stdout�
QUOTE_MINIMALrr r!r"r�writerow)	r#r$r%r&r'�csv_outr)r*r+s	         r�	print_csvr:&s���T�Y�Y�[�[�!�!�I�
�9�~�~������
�#�~�~��Y�q�\�(:�;�;�
<�
<�F��W�v�
�F��j���S�->�?�?�?�G�

�(�(�D�6�C��K�K�'�
(�
(�C�	�#��f�
�
�
�����y�h�/�/�/�����f���
�
�4��]�]�T�$�Z�8�8�9�9�:�:�:����������rc	��ttjdtj��|t	��d�d�����dS)z
    Prints data as json
    �success)�result�	timestamp�items�
quota_showr��indentN)r �json�dumps�time�check_quota_show)r#r$r%s   r�
print_jsonrG8sZ��
�$�*���Y�[�[��&�(�(�	��
��������rc��t|t��r8ttj|j|j|jd�d�����dSttjdt|��id�����dS)zI
    Prints error in json format that
    is later used by cl-limits
    )r=�context�detailsrrAr=N)	�
isinstancerr rCrD�messagerIrJ�str)�errors r�print_json_errorrODs���
�%�+�,�,�	�
�d�j��m��}��}�
�
��	���	�	�	�	�	�	�d�j��c�%�j�j�
�����	�	�	�	�	rc�*�td|z��dS)Nz	ERROR: %s)r )rLs r�print_text_errorrQUs��	�+��
!�"�"�"�"�"rc��tjtjtj���}|�d|g��dS)Nr/�ERROR)r3r4r5r6�	QUOTE_ALLr8)rLr9s  r�print_csv_errorrUYs9���j���S�]�;�;�;�G����g�w�'�(�(�(�(�(rc�J�t���dd��duS)z.
    Show quota enabled
    :return: bool
    �showUserInodesUsage�inodeLimitsT)r�	get_paramrrrrFrF^s$��
�:�:��� 5�}�E�E��M�Mr)�
__future__rrrrCr5r3rE�clcommon.ui_configr�clcommonrrMr,r:rGrOrQrUrFrrr�<module>r]s!��&�%�%�%�%�%�������&�&�&�&�&�&�����
�
�
�
�
�
�
�
�����'�'�'�'�'�'�'�'�'�'�'�'� �#� � � � �&������$ �#�	�	�	�	����"#�#�#�)�)�)�
N�N�N�N�Nr

Zerion Mini Shell 1.0