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/application/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/application/service.pyc
ó
†Nc	@s\dZddlmZmZmZddlmZddlmZddl	m
Z
ddlmZddl
mZdefd	„ƒYZd
efd„ƒYZdefd
„ƒYZddd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZddd„ƒYZddd„Zdd„Zdddddddddg	ZdS(sa
Service architecture for Twisted.

Services are arranged in a hierarchy. At the leafs of the hierarchy,
the services which actually interact with the outside world are started.
Services can be named or anonymous -- usually, they will be named if
there is need to access them through the hierarchy (from a parent or
a sibling).

Maintainer: Moshe Zadka
iÿÿÿÿ(t
implementst	Interfacet	Attribute(tnamedAny(t
components(tdefer(tsob(tIPlugint
IServiceMakercBs;eZdZedƒZedƒZedƒZd„ZRS(sê
    An object which can be used to construct services in a flexible
    way.

    This interface should most often be implemented along with
    L{twisted.plugin.IPlugin}, and will most often be used by the
    'twistd' command.
    sA short string naming this Twisted plugin, for example 'web' or 'pencil'. This name will be used as the subcommand of 'twistd'.sLA brief summary of the features provided by this Twisted application plugin.scA C{twisted.python.usage.Options} subclass defining the configuration options for this application.cCsdS(s
        Create and return an object providing
        L{twisted.application.service.IService}.

        @param options: A mapping (typically a C{dict} or
        L{twisted.python.usage.Options} instance) of configuration
        options to desired configuration values.
        N((toptions((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytmakeService/s(t__name__t
__module__t__doc__RttapnametdescriptionR	R
(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRs			tServiceMakercBsTeZdZeeeƒd„Zd„ZeeƒŒZd„Z	ee	ƒŒZ	RS(sO
    Utility class to simplify the definition of L{IServiceMaker} plugins.
    cCs(||_||_||_||_dS(N(tnametmoduleRR(tselfRRRR((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyt__init__As			cCsd„}|fS(NcSst|jƒjS(N(RRtOptions(R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytgetIs((R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR	Hs	cCsd„}|fS(NcSst|jƒjS(N(RRR
(R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRPs((R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR
Os	(
RRR
RRRRR	tpropertyR
(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR;s
			tIServicecBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s
    A service.

    Run start-up and shut-down code at the appropriate times.

    @type name:            C{string}
    @ivar name:            The name of the service (or None)
    @type running:         C{boolean}
    @ivar running:         Whether the service is running.
    cCsdS(s“
        Set the name of the service.

        @type name: C{str}
        @raise RuntimeError: Raised if the service already has a parent.
        N((R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytsetNamecscCsdS(sx
        Set the parent of the service.  This method is responsible for setting
        the C{parent} attribute on this service (the child service).

        @type parent: L{IServiceCollection}
        @raise RuntimeError: Raised if the service already has a parent
            or if the service has a name and the parent already has a child
            by that name.
        N((tparent((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytsetServiceParentkscCsdS(s×
        Use this API to remove an L{IService} from an L{IServiceCollection}.

        This method is used symmetrically with L{setServiceParent} in that it
        sets the C{parent} attribute on the child.

        @rtype: L{Deferred<defer.Deferred>}
        @return: a L{Deferred<defer.Deferred>} which is triggered when the
            service has finished shutting down. If shutting down is immediate,
            a value can be returned (usually, C{None}).
        N((((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytdisownServiceParentvscCsdS(s$
        Start the service.
        N((((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytstartServiceƒscCsdS(s"
        Stop the service.

        @rtype: L{Deferred<defer.Deferred>}
        @return: a L{Deferred<defer.Deferred>} which is triggered when the
            service has finished shutting down. If shutting down is immediate,
            a value can be returned (usually, C{None}).
        N((((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytstopServiceˆscCsdS(s²
        Do preparation work for starting the service.

        Here things which should be done before changing directory,
        root or shedding privileges are done.
        N((((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytprivilegedStartService’s(	RRR
RRRRRR(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRWs
			
		
tServicecBsieZdZeeƒdZd	Zd	Zd„Z	d„Z
d„Zd„Zd„Z
d„Zd„ZRS(
sÝ
    Base class for services.

    Most services should inherit from this class. It handles the
    book-keeping reponsibilities of starting and stopping, as well
    as not serializing this book-keeping information.
    icCs,|jjƒ}|jdƒr(|d=n|S(Ntrunning(t__dict__tcopythas_key(Rtdict((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyt__getstate__ªs
cCs+|jdk	rtdƒ‚n||_dS(Ns%cannot change name when parent exists(RtNonetRuntimeErrorR(RR((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR°scCsH|jdk	r|jƒnt||ƒ}||_|jj|ƒdS(N(RR'RtIServiceCollectiont
addService(RR((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRµs

	cCs|jj|ƒ}d|_|S(N(Rt
removeServiceR'(Rtd((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR¼s	cCsdS(N((R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRÁscCs
d|_dS(Ni(R!(R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRÄscCs
d|_dS(Ni(R!(R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRÇsN(RRR
RRR!R'RRR&RRRRRR(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR ›s
						R)cBs2eZdZd„Zd„Zd„Zd„ZRS(sÓ
    Collection of services.

    Contain several services, and manage their start-up/shut-down.
    Services can be accessed by name if they have a name, and it
    is always possible to iterate over them.
    cCsdS(sÏ
        Get the child service with a given name.

        @type name: C{str}
        @rtype: L{IService}
        @raise KeyError: Raised if the service has no child with the
            given name.
        N((R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytgetServiceNamedÕscCsdS(s:
        Get an iterator over all child services.
        N((((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyt__iter__ßscCsdS(s
        Add a child service.

        Only implementations of L{IService.setServiceParent} should use this
        method.

        @type service: L{IService}
        @raise RuntimeError: Raised if the service has a child with
            the given name.
        N((tservice((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR*äscCsdS(só
        Remove a child service.

        Only implementations of L{IService.disownServiceParent} should
        use this method.

        @type service: L{IService}
        @raise ValueError: Raised if the given service is not a child.
        @rtype: L{Deferred<defer.Deferred>}
        @return: a L{Deferred<defer.Deferred>} which is triggered when the
            service has finished shutting down. If shutting down is immediate,
            a value can be returned (usually, C{None}).
        N((R/((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR+ðs(RRR
R-R.R*R+(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR)Ìs
	
		tMultiServicecBs`eZdZeeƒd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„ZRS(	s
    Straightforward Service Container.

    Hold a collection of services, and manage them in a simplistic
    way. No service will wait for another, but this object itself
    will not finish shutting down until all of its child services
    will finish.
    cCsg|_i|_d|_dS(N(tservicest
namedServicesR'R(R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR
s		cCs,tj|ƒx|D]}|jƒqWdS(N(R R(RR/((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRs

cCs,tj|ƒx|D]}|jƒqWdS(N(R R(RR/((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRs

cCs`tj|ƒg}t|ƒ}|jƒx'|D]}|jtj|jƒƒq0Wtj|ƒS(N(R RtlisttreversetappendRt
maybeDeferredtDeferredList(RtlR1R/((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRs


cCs|j|S(N(R2(RR((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR-%scCs
t|jƒS(N(titerR1(R((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR.(scCs|jdk	rM|jj|jƒr:td|jƒ‚n||j|j<n|jj|ƒ|jr}|jƒ|j	ƒndS(Ns,cannot have two services with same name '%s'(
RR'R2R$R(R1R5R!RR(RR/((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR*+s	
cCsD|jr|j|j=n|jj|ƒ|jr<|jƒSdSdS(N(RR2R1tremoveR!RR'(RR/((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR+7s		
(
RRR
RR)RRRRR-R.R*R+(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR0s
								tIProcesscBs2eZdZedƒZedƒZedƒZRS(sa
    Process running parameters.

    Represents parameters for how processes should be run.
    sv
        A C{str} giving the name the process should have in ps (or C{None}
        to leave the name alone).
        s{
        An C{int} giving the user id as which the process should run (or
        C{None} to leave the UID alone).
        s|
        An C{int} giving the group id as which the process should run (or
        C{None} to leave the GID alone).
        (RRR
RtprocessNametuidtgid(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR;Ds		tProcesscBs-eZdZeeƒdZddd„ZRS(s‚
    Process running parameters.

    Sets up uid/gid in the constructor, and has a default
    of C{None} as C{processName}.
    cCs||_||_dS(s=
        Set uid and gid.

        @param uid: The user ID as whom to execute the process.  If
            this is C{None}, no attempt will be made to change the UID.

        @param gid: The group ID as whom to execute the process.  If
            this is C{None}, no attempt will be made to change the GID.
        N(R=R>(RR=R>((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyRhs
	N(RRR
RR;R'R<R(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyR?^s
cCshtjƒ}xBtƒtj||ƒt||ƒfD]}|j|ddƒq4Wt|ƒj|ƒ|S(s
    Return a compound class.

    Return an object supporting the L{IService}, L{IServiceCollection},
    L{IProcess} and L{sob.IPersistable} interfaces, with the given
    parameters. Always access the return value by explicit casting to
    one of the interfaces.
    tignoreClassi(	Rt
ComponentizedR0Rt
PersistentR?taddComponentRR(RR=R>trettcomp((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytApplicationvs
	.cCs=|dkr$tj|d|ƒ}ntj|||ƒ}|S(s`
    Load Application from a given file.

    The serialization format it was saved in should be given as
    C{kind}, and is one of C{pickle}, C{source}, C{xml} or C{python}. If
    C{passphrase} is given, the application was encrypted with the
    given passphrase.

    @type filename: C{str}
    @type kind: C{str}
    @type passphrase: C{str}
    tpythontapplication(RtloadValueFromFiletload(tfilenametkindt
passphraseRH((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pytloadApplication‡s
RFRNN(((R
tzope.interfaceRRRttwisted.python.reflectRttwisted.pythonRttwisted.internetRttwisted.persistedRttwisted.pluginRRtobjectRRR R)R0R;R?R'RFRNt__all__(((s?/usr/lib/python2.7/dist-packages/twisted/application/service.pyt<module>s&"D15C	

Youez - 2016 - github.com/yon3zu
LinuXploit