�
-�P`c@s�ddlZddlZddlZddlmZmZmZddlmZddl Z ddl
Z
ddlmZ
ddlmZd�Zdefd��YZdS( i����N(tLsmErrorterrortErrorNumber(tcmd_line_wrapper(t SocketEOF(t TransPortcs-�dkr|St��fd�|D��S(s{
This method does not check whether lsm_obj contain requested property.
The method caller should do the check.
c3s*|] }t|���kr|VqdS(N(tgetattr(t.0tlsm_obj(t
search_keytsearch_value(s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pys <genexpr>#sN(tNonetlist(tlsm_objsR R
((R R
s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pytsearch_propertystPluginRunnercBs/eZdZed��Zd�Zd�ZRS(s]
Plug-in side common code which uses the passed in plugin to do meaningful
work.
cCs+yt|�tSWntk
r&tSXdS(s4
Returns True if val is an integer.
N(tinttTruet
ValueErrortFalse(tval((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pyt
_is_number-s
cCst|_t|�dkrtj|d�ry�t|d�}ttj|tj tj
��|_y|�|_WnNt
k
r�}tj�}|jjdddt|��tj|��nXWqt
k
rttj��td�tjd�qXnt|_t|�dS(Niiii����sError instantiating plug-in sPlug-in exiting.(RtcmdlinetlenRRRRtsockettfromfdtAF_UNIXtSOCK_STREAMttptplugint Exceptiontsystexc_infot
send_errortstrtsixtreraiseRt tracebackt
format_exctexitRR(tselfRtargstfdtetec_info((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pyt__init__8s& %!
cCs�|jr
dSt}d}z|y�x�tr�y�|jj�}|d}|d}|d}t|j|�r�|dkr�t|j|��}q�t|j|�|d�}nt t
jd��|jj|�|dkr�t}n|dkrt}|jj
�PnWq"tk
rI}ttj��|jj|dt|��q"tk
r�}ttj��|jj|d t|��q"t k
r�} |jj|| j| j| j�q"Xq"WWn�tk
r�|r�td
�q�n�tjk
r/}
|
jtjkrtd
�q�tdtj��netk
r�tdtj��y,|jj|t
jdttj���Wq�tk
r�q�XnXWd|r�|jj�tj d
�nXdS(NitmethodtidtparamssUnsupported operationtplugin_registertplugin_unregisteriD���i����s!Client went away, exiting plug-ins Unhandled exception in plug-in!
sUnhandled exception in plug-ini(!RRRRtread_reqthasattrRRRRRt
NO_SUPPORTt send_resptcloseRRR%R&R!R"tAttributeErrortcodetmsgtdatat
_SocketEOFRterrnotEPIPERt
PLUGIN_BUGR2RR'(R(t
need_shutdowntmsg_idR:R.R0tresulttvetaetlsm_errtse((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pytrunTsl
(t__name__t
__module__t__doc__tstaticmethodRR-RG(((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pyR's (RR%RtlsmRRRt
lsm.lsmcliRR#R=tlsm._commonRR<tlsm._transportRRtobjectR(((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pyt<module>s |