HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/celery/utils/__pycache__/nodenames.cpython-39.pyc
a

X>h[�@s$dZddlmZddlZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
ed	�Zd
ZdZdZeded
�ej�ZdZddd�dd�Zdddd�dd�Zd0dddd�dd�Zddd�dd �Zddd�d!d"�Zddd#dd$�d%d&�Zd1dddd)�d*d+�Zeed,d'�Zd2dddd#dd-�d.d/�ZdS)3zWorker name utilities.�)�annotationsN)�partial)�Exchange�Queue�)�memoize)�
simple_formatzC.dq2z{hostname}.dq2�@Zcelery)�Cache)�
worker_direct�gethostname�nodename�
anon_nodename�	nodesplit�default_nodename�node_format�host_formatzstr | Queuer)�hostname�returncCs"t|t�r|Sttj|d�t|�S)a5Return the :class:`kombu.Queue` being a direct route to a worker.

    Arguments:
        hostname (str, ~kombu.Queue): The fully qualified node name of
            a worker (e.g., ``[email protected]``).  If passed a
            :class:`kombu.Queue` instance it will simply return
            that instead.
    �r)�
isinstancer�WORKER_DIRECT_QUEUE_FORMAT�format�WORKER_DIRECT_EXCHANGEr�r�@/usr/local/lib/python3.9/site-packages/celery/utils/nodenames.pyr&s	

�r�str)�namerrcCst�||f�S)z)Create node name from name/hostname pair.)�NODENAME_SEP�join)rrrrrr
8sr
�genz
str | None)r�prefixrcCs"td�|tt���g�|pt��S)zsReturn the nodename for this process (not a worker).

    This is used for e.g. the origin task message field.
    �)r
rr�os�getpidr)rr!rrrr=srztuple[None, str] | list[str])rrcCs(|�td�}t|�dkr$d|dfS|S)z,Split node name into tuple of name/hostname.rNr)�splitr�len)r�partsrrrrEsrcCs$t|pd�\}}t|pt|p t��S)z-Return the default nodename for this process.r")rr
�NODENAME_DEFAULTr)rr�hostrrrrMsr�dict)�sr�extrarcKs(t|�\}}t|||ptfd|i|��S)z(Format worker node name ([email protected]).�p)rrr()r+rr,�	shortnamer)rrrrSsrr"�0)r!�defaultrcCs&ddlm}|�}|r"|�|��S|S)Nr)�current_process_index)�logr1)r!r0r1�indexrrr�_fmt_process_indexYsr4�-)r+r)rr,rcKsH|pt�}|�d�\}}}|p |}t|||ttd�fi|��}t||�S)zFormat host %x abbreviations.�.)�h�n�d�i�I)r�	partitionr*r4�_fmt_process_index_with_prefixr)r+r)rr,�hname�_�domain�keysrrrrcs
���
r)Nr )r"r/)NN)�__doc__�
__future__rr#�socket�	functoolsrZkombu.entityrrZ
functionalr�textrrrrr(r*r�__all__rr
rrrrr4r=rrrrr�<module>s,