403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/twisted/manhole/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyc
ó
ΔŽMc@s~dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddkZ
e
Zdejfd„ƒYZeƒZ
dejfd	„ƒYZd
efd„ƒYZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZieej6eej6eej6eej6eej6eej6eej 6eej!6eej"6eej#6eej$6eej%6eej&6eej'6eej(6Z)dej*fd„ƒYZ+d d&d!„ƒYZ,d"d'd#„ƒYZ-d$d(d%„ƒYZ.dS()sSupport for python object introspection and exploration.

Note that Explorers, what with their list of attributes, are much like
manhole.coil.Configurables.  Someone should investigate this further. (TODO)

Also TODO: Determine how much code in here (particularly the function
signature stuff) can be replaced with functions available in the
L{inspect} module available in Python 2.1.
iÿÿÿÿN(tpb(treflectitPoolcBseZd„ZRS(cCs{t|ƒ}|jj|ƒr)|j|Stjt|ƒtƒ}tj|iƒ}||j|<|j	|||ƒ|SdS(N(
tidtdatathas_keyt	typeTabletgetttypetExplorerGenericttypestInstanceTypet__init__(tselftobjectt
identifiertoidtklasste((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytgetExplorers
(t__name__t
__module__R(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRstExplorercBsJeZddgZgZdgZdZdZd„Zd„Z	d„Z
RS(RRtget_refcountcCs‹||_||_t|ƒ|_g|_tj|jd|jƒg|_tj|jd|jƒg|_tj|jd|jƒdS(Nt
propertiestattributeGroupst	accessors(	RRRRRtaccumulateClassListt	__class__RR(R
RR((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR5s			
	
	cCsƒdddg}|j|jƒ|j|jƒi}x!|D]}t||ƒ||<q<Wtj||ƒ|d<|jj|d<|S(NRRRtviewt
explorerClass(textendRRtgetattrRt	ViewPointRR(R
tperspectivetalltstatetkey((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytgetStateToCopyForFs
cCs
tj|ƒS(N(tsystgetrefcount(R
R"((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytview_get_refcountSsN(RRRRRtNoneRRRR&R)(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR-s			
R	cBs eZdddgZd„ZRS(tstrtreprttypenamecCsGtj|||ƒt|ƒ|_t|ƒ|_t|ƒj|_dS(N(RRR+R,RRR-(R
RR((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRYs(RRRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR	VstExplorerImmutablecBseZdgZd„ZRS(tvaluecCs tj|||ƒ||_dS(N(RRR/(R
RR((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRcs(RRRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR.`s	tExplorerSequencecBs>eZdgZdgZdgZd„Zd„Zd„ZRS(tlentelementstget_elementscCs8tj|||ƒ||_t|ƒ|_g|_dS(N(RRtseqR1R2(R
R4R((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRms	cCsit|jƒ|_g}xJt|jƒD]9}d|j|f}|jtj|j||ƒƒq(W|S(Ns%s[%s](R1R4txrangeRtappendtexplorerPoolR(R
tltiR((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR3us$cCs
|jƒS(N(R3(R
R"((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytview_get_elements€s(RRRRRRR3R:(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR0hs					tExplorerMappingcBsJeZdgZdgZddgZd„Zd„Zd„Zd„ZRS(R1tkeystget_keystget_itemcCs8tj|||ƒ||_t|ƒ|_g|_dS(N(RRtdctR1R<(R
R?R((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRŠs	cCsr|jjƒ}t|ƒ|_g}xGt|jƒD]6}d|j|f}|jtj|||ƒƒq4W|S(Ns
%s.keys()[%s](R?R<R1R5RR6R7R(R
R<R8R9R((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR=“s!cCs
|jƒS(N(R=(R
R"((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt
view_get_keysŸscCs]t|ƒtjkr!|j}n|j|}d|jt|ƒf}tj||ƒ}|S(Ns%s[%s](	RR
RRR?RR,R7R(R
R"R%titemR((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt
view_get_item£s
(	RRRRRRR=R@RB(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR;…s						tExplorerBuiltincBs&eZdZdddgZd„ZRS(sÂ
    @ivar name: the name the function was defined as
    @ivar doc: function's docstring, or C{None} if unavailable
    @ivar self: if not C{None}, the function is a method of this object.
    tdoctnameR
cCs;tj|||ƒ|j|_|j|_|j|_dS(N(RRt__doc__RDRREt__self__R
(R
tfunctionR((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR¶s(RRRFRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRC¯stExplorerInstancecBs,eZdZdgZddgZd„ZRS(sq
    Attribute groups:
        - B{methods} -- dictionary of methods
        - B{data} -- dictionary of data members

    Note these are only the *instance* methods and members --
    if you want the class methods, you'll have to look up the class.

    TODO: Detail levels (me, me & class, me & class ancestory)

    @ivar klass: the class this is an instance of.
    RtmethodsRc	Csòtj|||ƒi}i}x›t|ƒD]}|ddkrHq,ntj||gdƒ}t||ƒ}t|ƒ}|tjkr£t	j
||ƒ||<q,t	j
||ƒ||<q,Wt	j
|j|jdƒ|_
||_||_dS(Nit_t.s
.__class__(RRtdirtstringtjoinR RR
t
MethodTypeR7RRRRRRJ(	R
tinstanceRtmembersRJR9tmIdentifiertmembertmType((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRÍs"
	(RRRFRRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRI½s	t
ExplorerClasscBs5eZdZddddgZddgZd„ZRS(s6
    @ivar name: the name the class was defined with
    @ivar doc: the class's docstring
    @ivar bases: a list of this class's base classes.
    @ivar module: the module the class is defined in

    Attribute groups:
        - B{methods} -- class methods
        - B{data} -- other members of the class
    RERDtbasestmoduleRJRc	Cs@tj|||ƒ|s%|j}ni}i}x§t|ƒD]™}|ddkrf|dkrfq>ntj||gdƒ}t||ƒ}t|ƒ}|tj	krÁt
j||ƒ||<q>t
j||ƒ||<q>W|j|_t
j|ƒ|_||_||_t
j|j|dƒ|_t|ddƒ|_dS(NiRKRRLs
.__bases__R(RRRRMRNROR RR
RPR7RREtinspecttgetdocRDRRJt	__bases__RWR*RX(	R
ttheClassRRRRJR9RSRTRU((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRòs*		(RRRFRRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRVås
tExplorerFunctioncBs&eZdddddgZd„ZRS(RERDtfiletlinet	signaturecCsctj|||ƒ|j}|j}|jd@o5d}|jd@oHd}|||}t|j| ƒ}|jrèd}	xjt|t	|jƒ|ƒD]I}
|j|	}t
j|d||	fƒ}|j|
|ƒ|	d}	q˜Wn|r|j
|dƒn|r |j|d|ƒn|j|_||_tj|ƒ|_|j|_|j|_dS(Niiiis%s.func_defaults[%d](RRt	func_codetco_argcounttco_flagst	Signaturetco_varnamest
func_defaultsR5R1R7Rtset_defaulttset_keywordtset_varlistRRER`RYRZRDtco_filenameR^tco_firstlinenoR_(R
RHRtcodetargcountt	takesListt
takesKeywordstnR`ti_dR9tdefault((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRs2			

	(RRRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR]stExplorerMethodcBseZddgZd„ZRS(R
RcCs¤|j}t|ƒtjkr-|jj}ntj|||ƒt|ƒ|_tj	|j
|dƒ|_tj	|j|dƒ|_
|jr |jjƒndS(Ns	.im_classs.im_self(tim_funcRR
Rt__call__R]RRR7Rtim_classRtim_selfR
R`tdiscardSelf(R
tmethodRRH((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRDs		(RRRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRs=stExplorerModulecBs5eZdZdddgZdddgZd„ZRS(sÄ
    @ivar name: the name the module was defined as
    @ivar doc: documentation string for the module
    @ivar file: the file the module is defined in

    Attribute groups:
        - B{classes} -- the public classes provided by the module
        - B{functions} -- the public functions provided by the module
        - B{data} -- the public data members provided by the module

    ("Public" is taken to be "anything that doesn't start with _")
    RERDR^tclassest	functionsRc	CsGtj|||ƒi}i}i}xÍ|jjƒD]¼\}}|ddkrWq5nd||f}t|ƒtjkr•tj||ƒ||<q5t|ƒtj	krÃtj||ƒ||<q5t|ƒtj
krÛq5tj||ƒ||<q5W|j|_t
j|ƒ|_t|ddƒ|_||_||_||_dS(NiRKs%s.%st__file__(RRt__dict__titemsRR
t	ClassTypeR7RtFunctionTypet
ModuleTypeRRERYRZRDR R*R^R{R|R(	R
RXRR|R{RR%R/RS((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRfs.				(RRRFRRR(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRzVsRdcBs’eZdZdZdZdZdZd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„ZRS(sI represent the signature of a callable.

    Signatures are immutable, so don't expect my contents to change once
    they've been set.
    iiicCs9||_dgt|ƒ|_dgt|ƒ|_dS(N(RER*R1Rrtflavour(R
targNames((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRŸs	cCs|j|S(N(RE(R
targ((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytget_name¤scCsY|tjkr$|jj|ƒ}n|j||jkrKt|j|fStdfSdS(N(
R
t
StringTypeREtindexRƒt_HAS_DEFAULTtTrueRrtFalseR*(R
R…((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytget_default§s
cCsE|tjkr$|jj|ƒ}n|j|j|<||j|<dS(N(R
R‡RERˆR‰RƒRr(R
R…R/((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRg³scCs8|tjkr$|jj|ƒ}n|j|j|<dS(N(R
R‡RERˆt	_VAR_LISTRƒ(R
R…((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRiºscCs8|tjkr$|jj|ƒ}n|j|j|<dS(N(R
R‡RERˆt
_KEYWORD_DICTRƒ(R
R…((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRhÀscCs8|tjkr$|jj|ƒ}n|j||jkS(N(R
R‡RERˆRƒR(R
R…((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt
is_varlistÆscCs8|tjkr$|jj|ƒ}n|j||jkS(N(R
R‡RERˆRƒRŽ(R
R…((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt
is_keywordÌscCs4|jd|_|jjdƒ|jjdƒdS(sKInvoke me to discard the first argument if this is a bound method.
        iiN(RERrtpopRƒ(R
((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRxÒscCs4it|jƒd6t|jƒd6t|jƒd6S(NRERƒRr(ttupleRERƒRr(R
((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytgetStateToCopyÜscCs
t|jƒS(N(R1RE(R
((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt__len__áscCsÁg}x¨tt|ƒƒD]”}|j|ƒ}|j|ƒ\}}|r\d||f}nD|j|ƒr{d|f}n%|j|ƒršd|f}n|}|j|ƒqWtj|dƒS(Ns%s=%ss*%ss**%ss, (	R5R1R†RŒRRR6RNRO(R
targlistR…REt
hasDefaultRrta((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt__str__äsN(RRRFR*t_FLAVOURLESSR‰RRŽRR†RŒRgRiRhRRRxR“R”R˜(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRd”s"									
		tCRUFT_WatchyThingiecBseZd„Zd„ZRS(cCs+t||j|jƒ}|j|||ƒS(såWatch the object returned by evaluating the identifier.

        Whenever I think the object might have changed, I'll send an
        ObjectLink of it to the callback.

        WARNING: This calls eval() on its argument!
        (tevaltglobalNamespacetlocalNamespacetwatchObject(R
RtcallbackR((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pytwatchIdentifierscCs9t|ƒtjk	r!td‚ni}tj|j|dƒx!|jjƒD]}d||<qMW|jƒ}i}tj	d|jj
t|ƒft|jf|ƒ}tj
|||d„d|ƒ|d<||_x]|D]U}	t||	ƒ}
t|
ƒtj
krÜ|
jdk	rÜt|ƒ}|j|	ƒqÜqÜWdS(sWatch the given object.

        Whenever I think the object might have changed, I'll send an
        ObjectLink of it to the callback.

        The identifier argument is used to generate identifiers for
        objects which are members of this one.
        s+Sorry, can only place a watch on Instances.tisWatching%s%XcSs||j||ƒƒS(N(tbrowseObject(tslfR9tbtcb((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt<lambda>.st_watchEmitChangedN(RR
Rt	TypeErrorRtaddMethodNamesToDictRR~R<R€RRt_MonkeysSetattrMixinRPR*R Rwt_WatchMonkeytinstall(R
RRRŸR?tkRRtclazzNStclazzREtmtmonkey((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRžs,				
(RRR Rž(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRšùs	
R«cBs8eZdZdZd„Zd„Zd„Zd„ZRS(s¶I hang on a method and tell you what I see.

    TODO: Aya!  Now I just do browseObject all the time, but I could
    tell you what got called with what when and returning what.
    cCs
||_dS(s7Make a monkey to hang on this instance object.
        N(RQ(R
RQ((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRRscCs_t|j|dƒ}||k	r[tj||j|jjƒ|jj|<||f|_ndS(s?Install myself on my instance in place of this method.
        N(R RQR*R
RPRR~t	oldMethod(R
tmethodIdentifierR²((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR¬Ws
"cCse|jdkrdS|jddkr@t|j|jdƒn!t|j|jd|jdƒdS(s]Remove myself from this instance and restore the original method.

        (I hope.)
        Nii(R²R*tdelattrRQtsetattr(R
((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt	uninstallcs
cOs=|jdr)t|jd||ƒ}nd}|jƒ|S(s@Pretend to be the method I replaced, and ring the bell.
        iN(R²tapplyR*R§(R
RQR—tkwtrval((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRurs


N(	RRRFR*R²RR¬R¶Ru(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyR«Js			RªcBseZdZd„ZRS(sDA mix-in class providing __setattr__ for objects being watched.
    cCsTt|jjddƒr9|jjdj|||ƒn
||j|<|jƒdS(s-Set the attribute and ring the bell.
        it__setattr__N(thasattrRR[RºR~R§(R
R­tv((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRºs 
(RRRFRº(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyRª~s((((/RFRYRNR'R
tUserDictttwisted.spreadRttwisted.pythonRRŠR‹RR7t	CacheableRR	R.R0R;RCRIRVR]RsRzRR€RPRR‚tBuiltinFunctionTypetListTypet	TupleTypetDictTypeR‡tNoneTypetIntTypet	FloatTypetLongTypetComplexTypeRtCopyableRdRšR«Rª(((s</usr/lib/python2.7/dist-packages/twisted/manhole/explorer.pyt<module>sL0	)
*()/-














eQ4

Youez - 2016 - github.com/yon3zu
LinuXploit