Sindbad~EG File Manager

Current Path : /usr/lib64/python3.6/site-packages/lsm/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/site-packages/lsm/__pycache__/_pluginrunner.cpython-36.opt-1.pyc

3

�.'e:�@s|ddlZddlZddlZddlmZmZmZddlmZddl	Z	ddl
Z
ddlmZ
ddlmZdd�ZGdd	�d	e�ZdS)
�N)�LsmError�error�ErrorNumber)�cmd_line_wrapper)�	SocketEOF)�	TransPortcs$�dkr|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��%/usr/lib64/python3.6/_pluginrunner.py�	<genexpr>#sz"search_property.<locals>.<genexpr>)�list)Zlsm_objsr
rr)r
rr
�search_propertysrc@s,eZdZdZedd��Zdd�Zdd�ZdS)	�PluginRunnerz]
    Plug-in side common code which uses the passed in plugin to do meaningful
    work.
    cCs&yt|�dStk
r dSXdS)z4
        Returns True if val is an integer.
        TFN)�int�
ValueError)�valrrr
�
_is_number-s
zPluginRunner._is_numbercCs�d|_t|�dkr�tj|d�r�y�t|d�}ttj|tjtj	��|_
y|�|_WnLtk
r�}z0t
j�}|j
jdd	dt|��tj|��WYdd}~XnXWq�tk
r�ttj��td�t
jd�Yq�Xnd|_t|�dS)
NF��ric}zError instantiating plug-in zPlug-in exiting.Ti����)�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__8s&
 zPluginRunner.__init__cCsv|jr
dSd}d}�z@�yl�xdy�|jj�}|d}|d}|d}t|j|�r~|dkrft|j|��}q�t|j|�f|d�}nttjd��|jj	|�|dkr�d}|d	kr�d}|jj
�PWqtk
�r}z&tt
j��|jj|dt|��WYdd}~Xqtk
�rB}z&tt
j��|jj|dt|��WYdd}~Xqtk
�r|}	z|jj||	j|	j|	j�WYdd}	~	XqXqWWn�tk
�r�|�r�td�Yn�tjk
�r�}
z.|
jtjk�r�td�ntd
t
j��WYdd}
~
Xn^tk
�rPtd
t
j��y |jj|tjdtt
j���Wntk
�rJYnXYnXWd|�rp|jj�tjd�XdS)NFr�method�id�paramszUnsupported operationZplugin_registerT�plugin_unregisteri�iYz!Client went away, exiting plug-inz Unhandled exception in plug-in!
zUnhandled exception in plug-inriD���i����)rrZread_req�hasattrrrrrZ
NO_SUPPORTZ	send_resp�closerrr#r$r r!�AttributeError�code�msg�data�
_SocketEOFr�errnoZEPIPErZ
PLUGIN_BUGr.rr%)r&Z
need_shutdownZmsg_idr3r+r-�resultZveZaeZlsm_errZserrr
�runTsj

$$"

zPluginRunner.runN)�__name__�
__module__�__qualname__�__doc__�staticmethodrr*r8rrrr
r'sr)rr#rZlsmrrrZ
lsm.lsmclirr"r6Zlsm._commonrr5Zlsm._transportrr�objectrrrrr
�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists