Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /lib/python3.9/site-packages/up2date_client/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3.9/site-packages/up2date_client/__pycache__/statistics.cpython-39.pyc
a

۔*j�@s4ddlZddlmZmZdd�Zdd�Zdd�ZdS)	�N)�PIPE�PopencCsftj�d�std��d}t|dttd�}dd�|��D�\}}|rPtd|����t|d	d
��d��S)z�
    Get user count using the common CloudLinux library.
    This number is more accurate for systems
    with a control panel installed.
    z/opt/cloudlinux/venv/binz(CloudLinux virtual environment not foundzZ/opt/cloudlinux/venv/bin/python3 -c "from clcommon.cpapi import cpusers; print(cpusers())"T)�shell�stdout�stderrcSsg|]}|�����qS�)�decode�strip)�.0�resultrr�=/usr/lib/python3.9/site-packages/up2date_client/statistics.py�
<listcomp>�z.get_users_count_from_cllib.<locals>.<listcomp>z-Failed to get users from CloudLinux library: ����z, )	�os�path�exists�
ValueErrorrrZcommunicate�len�split)�cmdZprocess�output�errorsrrr�get_users_count_from_cllibsrcCsddlm}|�}t|���S)zY
    Fallback method to get the user count
    by looking into the /etc/passwd file.
    r)�ClPwd)Zup2date_client.clpwdrrZget_uid_dict)r�pwdrrr�get_users_count_genericsrcCs(z
t�}Wnty"t�}Yn0|S)z�
    Get the total count of users on the server.
    Tries the CloudLinux library first, falls back to generic method if it fails.
    )r�	Exceptionr)Zusers_countrrr�count_server_users"s

r)r�
subprocessrrrrrrrrr�<module>s

Yohohohohohooho | Sanrei Aya