Edit File: cloudlinux_statsnotifier.cpython-311.pyc
� L( e� � �T � d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlmZm Z d dlmc mZ d dlmZ d dlmZ d dlmZ d d lmZ d d lmZ d dlmZ dej d ej deeef fd�Z dede fd�Z!dede"fd�Z#d� Z$dede"ddfd�Z%de"de fd�Z&d� Z'dS )� )�print_function)�absolute_import)�divisionN)�Tuple�Dict)�USER_NOTIFICATIONS_OFF_MARKER)� setup_logging)�user_should_be_notified)�get_stats_notifier_parameters)�dateutil)�run_command�args�log�returnc � � | j sdS t j � � }|dk r | j sdS | j �t | j | j � � }nt | j � � }n^# t $ rQ}t d|� �t j � � �� � }|� t |� � � � Y d}~nd}~ww xY wt j |� � }|dfS )zA Generic method to analyze options and call needed funcs )z Only JSON mode supported for now���r )z'Please, specify user id via --id optionr Nzerror: ��result� timestamp)�json�os�getuid�id� notifyUser�manage_user_notifications�get_notifications_settings� Exception�dictr �gm_datetime_to_unixtimestamp�error�str�dumps)r r �current_userr �e�json_strs ��/builddir/build/BUILDROOT/lve-stats-4.2.1-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/cloudlinux_statsnotifier.py�executer'