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/persisted/journal/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyc
ó
[³XMc@s1dZddlmZddlZddlZyddlZWnek
r]ddlZnXddlm	Z	m
Z
ddd„ƒYZdefd„ƒYZd	e
fd
„ƒYZ
de
fd„ƒYZd
dd„ƒYZddd„ƒYZddd„ƒYZed„Zddd„ƒYZed„ZdS(s)Basic classes and interfaces for journal.iÿÿÿÿ(t
nested_scopesN(t
implementst	InterfacetJournalcBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s}All commands to the system get routed through here.

    Subclasses should implement the actual snapshotting capability.
    cCs(||_||_|jjƒ|_dS(N(tlogtjournaledServicetgetCurrentIndextlatestIndex(tselfRR((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyt__init__s		cCs\|jƒ}||jkrXx:|jj|dƒD]\}}|j|j|ƒq2WndS(s™Run all commands from log that haven't been run yet.

        This method should be run on startup to ensure the snapshot
        is up-to-date.
        iN(tgetLastSnapshotRRtgetCommandsSincetexecuteR(Rt
snapshotIndextcmdtimetcommand((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyt
updateFromLog$s#cCs;tjƒ}|jj||ƒ}|j|j||ƒ|S(sLog and execute a command.(ttimeRt
logCommandtaddCallbackt_reallyExecute(RRtrunTimetd((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pytexecuteCommand/scCs"|j|j|ƒ}||_|S(s-Callback called when logging command is done.(RRR(RtindexRRtresult((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR6s	cCs
t‚dS(s0Return command index of the last snapshot taken.N(tNotImplementedError(R((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR
<scOs
t‚dS(s­Save journal to disk, returns Deferred of finish status.

        Subclasses may choose whatever signature is appropriate, or may
        not implement this at all.
        N(R(Rtargstkwargs((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pytsync@s(	t__name__t
__module__t__doc__R	RRRR
R(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRs					t
MemoryJournalcBs)eZdZd„Zd„Zd„ZRS(s6Prevayler-like journal that dumps from memory to disk.cCs¦||_tjj|ƒr|y%tjt|dƒƒ\|_}Wn,tttj	fk
rnd\|_}nX||ƒnd|_|dƒtj|||ƒdS(Ntrbi(iN(
tpathtostexiststpickletloadtopentlastSynctIOErrortOSErrortUnpicklingErrortNoneRR	(RRRR#tloadedCallbacktobj((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR	Ms	%
	
cCs|jS(N(R)(R((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR
ZscCsHt|jdƒ}tj|j|f|dƒ|jƒ|j|_dS(Ntwbi(R(R#R&tdumpRtcloseR)(RR/tf((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR]s
(RRR R	R
R(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR!Js	
	tICommandcBseZdZd„ZRS(s@A serializable command which interacts with a journaled service.cCsdS(s"Run the command and return result.N((RR((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRhs(RRR R(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR4estICommandLogcBs)eZdZd„Zd„Zd„ZRS(sInterface for command log.cCsdS(s`Add a command and its run time to the log.

        @return: Deferred of command index.
        N((RR((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRoscCsdS(s-Return index of last command that was logged.N((((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRuscCsdS(s…Return commands who's index >= the given one.

        @return: list of (time, command) tuples, sorted with ascending times.
        N((R((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRxs(RRR RRR(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR5ls		tLoadingServicecBseZdZd„ZRS(s7Base class for journalled service used with Wrappables.cCs
t‚dS(s'Return object of specified type and id.N(R(RtobjTypetobjId((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyt
loadObject‚s(RRR R9(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR6st	WrappablecBseZdZdZd„ZRS(s0Base class for objects used with LoadingService.cCs
t‚dS(s5Return uid for loading with LoadingService.loadObjectN(R(R((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pytgetUidŒsN(RRR R-t
objectTypeR;(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR:‡stWrapperCommandcBs3eZeeƒdid„Zd„Zd„ZRS(cCsC||_|jƒ|_|j|_||_||_||_dS(N(R/R;R8R<R7t
methodNameRR(RR>R/RR((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR	•s			cCsRt|dƒs*|j|j|jƒ}n	|j}t||jƒ|j|jŽS(NR/(	thasattrR9R7R8R/tgetattrR>RR(RtsvctcommandTimeR/((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRs	cCs|jjƒ}|d=|S(NR/(t__dict__tcopy(RR((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyt__getstate__¤s((RRRR4R	RRE(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR=‘s
	cs‡‡fd†}|S(sýWrap a method so it gets turned into command automatically.

    For use with Wrappables.

    Usage::

        | class Foo(Wrappable):
        |     objectType = "foo"
        |     def getUid(self):
        |         return self.id
        |     def _bar(self, x):
        |         return x + 1
        |
        |     bar = command('_bar')

    The resulting callable will have signature identical to wrapped
    function, except that it expects journal as first argument, and
    returns a Deferred.
    cs|jˆˆ|||ƒƒS(N(R(R/tjournalRR(R>tcmdClass(sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pytwrapper¾s((R>RGRH((RGR>sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRªstServiceWrapperCommandcBs<eZeeƒdid„Zd„Zd„Zd„ZRS(cCs||_||_||_dS(N(R>RR(RR>RR((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyR	Çs		cCst||jƒ|j|jŽS(N(R@R>RR(RRARB((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRÌscCsd|j|j|jfS(Ns#<ServiceWrapperCommand: %s, %s, %s>(R>RR(R((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyt__repr__ÏscCs*t|dƒr"t|j|jƒSdSdS(NRCi(R?tcmpRC(Rtother((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyt__cmp__Òs((RRRR4R	RRJRM(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRIÃs

		cs‡‡fd†}|S(sÚWrap methods into commands for a journalled service.

    The resulting callable will have signature identical to wrapped
    function, except that it expects journal as first argument, and
    returns a Deferred.
    cs|jˆˆ||ƒƒS(N(R(R/RFRR(R>RG(sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyRHàs((R>RGRH((RGR>sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pytserviceCommandÙs((((((R t
__future__RR$RtcPickleR&tImportErrortzope.interfaceRRRR!R4R5R6R:R=RRIRN(((sB/usr/lib/python2.7/dist-packages/twisted/persisted/journal/base.pyt<module>	s"
1


Youez - 2016 - github.com/yon3zu
LinuXploit