관리-도구
편집 파일: utils.cpython-311.opt-1.pyc
� ��g$ � �: � d Z ddlmZ dededefd�Zdedefd�Zd S ) u This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> � )�Path�message� max_length�returnc �� � |dk s J d� � �t | � � |k r| S d}|dz }t d||z t |� � z � � }| d|� |z | | d� z S )z� Remove the middle part of the string, so that the overall length is no more than specified. Returned string's length should not exceed max_length. �2 z6Specify a bigger max_length or don't use this functionz ... � � N)�len�max)r r �filler�left_cutoff�right_cutoffs �O/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/utils.py�trimr s� � � �R����?� ��� �7�|�|�z�!�!��� �F���/�K��q�*�{�2�S��[�[�@�A�A�L��<�K�<� �6�)�G�\�M�N�N�,C�C�C� �log_pathc �z � t | � dd�� � d�� � }n# t $ r d}Y nw xY w|S )Nzutf-8�backslashreplace)�encoding�errorsi� )r � )r � read_text�FileNotFoundError)r �logs r �trim_file_contentr / sb � �������8J��K�K�� � � ���� � � � ����������Js �&) �8�8N)�__doc__�pathlibr �str�intr r � r r �<module>r"