File manager - Edit - /opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/webisolation/crontab/__pycache__/parser.cpython-311.pyc
Back
� ��i� � � � d Z ddlmZmZmZ ddlmZmZmZm Z m Z mZ dedefd�Z dede fd�Zd e defd �Zddee d edee fd�ZdS )z8Parsing and serialization functions for crontab entries.� )�CRON_SCHEDULE_PATTERN�WEBSITE_CRON_BEGIN_PATTERN�WEBSITE_CRON_END_PATTERN)�BeginWebsite�CommentLine�CrontabEntry�CrontabStructure� EndWebsite�ParsedCrontabLine�line�returnc � � | � � � }t j |� � }|rN|� d� � � � � }|� dd�� � }t |�� � S t j |� � rt � � S |st | �� � S |� d� � rt | �� � S t j |� � }|st | �� � S |� d� � }|� d� � }| � d � � r|d z }t ||� � � S )z� Parse a crontab line into a cron entry, comment, or website marker. Args: line: A single line from crontab output (bytes) r �utf-8�replace)�errors)�docroot)�content� #� � )�schedule�command) �stripr �match�group�decoder r r r � startswithr �endswithr )r �stripped�begin_match� docroot_bytesr �schedule_matchr r s ��/builddir/build/BUILDROOT/cagefs-7.6.29-2.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/webisolation/crontab/parser.py�parse_crontab_liner$ s` � � �z�z�|�|�H� -�2�8�<�<�K�� -�#�)�)�!�,�,�2�2�4�4� ��&�&�w�y�&�A�A���G�,�,�,�,� �%�h�/�/� ��|�|�� � )��4�(�(�(�(����4� � � )��4�(�(�(�(� +�0��:�:�N�� )��4�(�(�(�(��#�#�A�&�&�H��"�"�1�%�%�G��}�}�U��� ��5������� � � � � input_datac �h � | � d�� � }i }d}|D ]o}t |� � }t |t � � r|j }�.t |t � � rd}�F|� |g � � � |� � �p|� dg � � }t ||�� � S )ag Parse crontab file into structured format with user records and docroot sections. Supports both old format (with isolation wrapper prefixes) and new format (with section markers). Args: input_data: bytes containing crontab entries Returns: CrontabStructure: Structure containing global_records and docroot_sections T)�keependsN)�global_records�docroot_sections) � splitlinesr$ � isinstancer r r � setdefault�append�popr )r&