ó -ÎP`c@s«ddlZddlZddlZddlmZmZmZddlmZddl Z ddl Z ddl m Z ddlmZd„Zdefd„ƒYZdS( iÿÿÿÿN(tLsmErrorterrort ErrorNumber(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_keyt search_value(s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pys #sN(tNonetlist(tlsm_objsR R ((R R s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pytsearch_propertys t PluginRunnercBs/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ƒ}|j jdddt|ƒƒtj|Œ‚nXWqt k rttjƒƒtdƒtjdƒqXnt|_t|ƒdS(Niiii‚ÿÿsError instantiating plug-in sPlug-in exiting.(RtcmdlinetlenRRRRtsockettfromfdtAF_UNIXt SOCK_STREAMttptplugint Exceptiontsystexc_infot send_errortstrtsixtreraiseRt tracebackt format_exctexitRR(tselfRtargstfdtetec_info((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pyt__init__8s& %!    c CsÀ|jr dSt}d}z|y¥xžtr¿yà|jjƒ}|d}|d}|d}t|j|ƒr­|dkrŽt|j|ƒƒ}q¿t|j|ƒ|d}nt t j dƒ‚|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”td tjƒƒnetk r“td tjƒƒy,|jj|t jd ttjƒƒƒWq”tk rq”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_reqthasattrRR RRRt 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__t staticmethodRR-RG(((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pyR's (RR%RtlsmRRRt lsm.lsmcliRR#R=t lsm._commonRR<tlsm._transportRRtobjectR(((s5/usr/lib/python2.7/site-packages/lsm/_pluginrunner.pyts