Файловый менеджер - Редактировать - /opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/__pycache__/utils.cpython-311.opt-1.pyc
Назад
� �Ѡg�� � � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dl mZmZ d dl mZ d dlmZmZmZmZmZmZ d dlZd dlZd dlmZ d dlmZmZmZmZ dZdZ d Z!d Z"dZ#d� Z$dRd �Z%d� Z&d� Z'd� Z(d� Z) dSd�Z*d� Z+dee, fd�Z-d� Z.de/fd�Z0dee, fd�Z1 ed�� � dee, fd�� � Z2de3fd�Z4de,de/fd �Z5de/fd!�Z6de/fd"�Z7de/fd#�Z8d$� Z9d%e,de/fd&�Z:d'� Z;d(� Z<d)� Z=d*� Z>d+� Z?d,e,de/fd-�Z@d.e3de/fd/�ZAd0edee/ fd1�ZBde3fd2�ZCd3e,dee/e/f fd4�ZDd3e,dee/e/f fd5�ZEd3e,dee/e/f fd6�ZFd7e,d8e/de/fd9�ZGd:eej ejH f de,fd;�ZI dRd<e,d=e,d>e,d?e3dee3e,f f d@�ZJde,fdA�ZKde/fdB�ZLdCe,dee3 fdD�ZMdCe,fdE�ZNdCe,fdF�ZOdG� ZPdHe,de,fdI�ZQde/fdJ�ZRdKe,de,fdL�ZSdeee, ee, f fdM�ZTde/fdN�ZUde/fdO�ZVdP� ZWdQ� ZXdS )T� N)�ConfigParser�Error)� lru_cache)�Any�AnyStr�Dict�Optional�Tuple�Union)�etree)�ExternalProgramFailed� check_command�exec_utility�run_commandz/etc/sysconfig/rhn/systemid)�Mon�Tue�Wed�Thu�Fri�Sat�Sunz /opt/cloudlinux/litespeed_statusz/opt/cloudlinux/nginx_statusz/opt/apache2nginx/statec � � d}t j � |� � r& t j |� � }n# t $ r Y nw xY w| |k r= t j |� � n# t $ r Y nw xY wt j | |� � dS dS )a Create symlink link_path -> link_value if it does not exist or points to different location :param link_value: path that symlink should point to (symlink value) :type link_value: str :param link_path: path where to create symlink :type link_path: str N)�os�path�islink�readlink�OSError�unlink�symlink)� link_value� link_path�link_tos ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.22-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/utils.py�create_symlinkr$ 1 s� � � �G� �w�~�~�i� � � � ��k�)�,�,�G�G��� � � ��D� �����W��� ��I�i� � � � ��� � � ��D� ���� � �:�y�)�)�)�)�)� �s! �8 � A�A�A$ �$ A1�0A1c �� � g }t j � | � � r?t | dd|�� � 5 }|� � � }ddd� � n# 1 swxY w Y |S )a Read file and return file's lines errors param may be passed to define how handle unicode errors, errors=None is default value of open() :param path: path to file :param unicode_errors_handle: how to handle unicode errors :return: list of file's lines �r�utf-8)�encoding�errorsN)r r �isfile�open� readlines)r �unicode_errors_handle�content�fs r# �get_file_linesr0 H s� � � �G� �w�~�~�d��� $� �$��g�6K� L� L� L� $�PQ��k�k�m�m�G� $� $� $� $� $� $� $� $� $� $� $���� $� $� $� $��Ns �A�A�Ac � � t | |d�� � 5 }|� |� � ddd� � dS # 1 swxY w Y dS )z� Write lines to file :param content: list of lines for writing to file :param path: path to file :param mode: open mode :return: None r'