HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib64/python3.9/site-packages/lsm/__pycache__/_pluginrunner.cpython-39.pyc
a

V��d�@s|ddlZddlZddlZddlmZmZmZddlmZddl	Z	ddl
Z
ddlmZ
ddlmZdd�ZGdd	�d	e�ZdS)
�N)�LsmError�error�ErrorNumber)�cmd_line_wrapper)�	SocketEOF)�	TransPortcs$�dur|St��fdd�|D��S)z{
    This method does not check whether lsm_obj contain requested property.
    The method caller should do the check.
    Nc3s |]}t|���kr|VqdS)N)�getattr)�.0Zlsm_obj��
search_key�search_value��7/usr/lib64/python3.9/site-packages/lsm/_pluginrunner.py�	<genexpr>s�z"search_property.<locals>.<genexpr>)�list)Zlsm_objsrrr
r
r�search_propertysrc@s,eZdZdZedd��Zdd�Zdd�ZdS)	�PluginRunnerz]
    Plug-in side common code which uses the passed in plugin to do meaningful
    work.
    cCs(zt|�WdSty"YdS0dS)z4
        Returns True if val is an integer.
        TFN)�int�
ValueError)�valr
r
r�
_is_number$s
zPluginRunner._is_numberc
Cs�d|_t|�dkr�t�|d�r�z�t|d�}tt�|tjtj	��|_
z|�|_WnNty�}z6t
��}|j
�dddt|��tj|��WYd}~n
d}~00Wq�ty�tt���td�t
�d�Yq�0nd|_t|�dS)	NF��ri����zError instantiating plug-in zPlug-in exiting.T)�cmdline�lenrrrr�socketZfromfdZAF_UNIXZSOCK_STREAM�tp�plugin�	Exception�sys�exc_info�
send_error�str�sixZreraiser�	traceback�
format_exc�exitr)�selfr�args�fd�eZec_infor
r
r�__init__/s*�

�$zPluginRunner.__init__cCs�|jr
dSd}d}�z^�ztz�|j��}|d}|d}|d}t|j|�r~|durbt|j|��}q�t|j|�fi|d��}nttjd��|j�	|�|dkr�d}|d	kr�d}|j�
�W�q�Wqt�y}z,tt
���|j�|d
t|��WYd}~qd}~0t�yJ}z,tt
���|j�|dt|��WYd}~qd}~0t�y�}	z$|j�||	j|	j|	j�WYd}	~	qd}	~	00qWn�t�y�|�r�td�Yn�tj�y�}
z4|
jtjk�r�td�ntd
t
���WYd}
~
nbd}
~
0t�yTtd
t
���z |j�|tjdtt
����Wnt�yNYn0Yn0W|�r�|j��t�d�n|�r�|j��t�d�0dS)NFr�method�id�paramszUnsupported operationZplugin_registerT�plugin_unregisteriD���i����z!Client went away, exiting plug-inz Unhandled exception in plug-in!
zUnhandled exception in plug-inr)rrZread_req�hasattrrrrrZ
NO_SUPPORTZ	send_resp�closerrr$r%r!r"�AttributeError�code�msg�data�
_SocketEOFr�errnoZEPIPErZ
PLUGIN_BUGr/rr&)r'Z
need_shutdownZmsg_idr4r,r.�result�veZaeZlsm_errZser
r
r�runKs|
���

((� 
�
�
�
zPluginRunner.runN)�__name__�
__module__�__qualname__�__doc__�staticmethodrr+r:r
r
r
rrs


r)rr$rZlsmrrrZ
lsm.lsmclirr#r7Zlsm._commonrr6Zlsm._transportrr�objectrr
r
r
r�<module>s