403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/paste/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/paste//progress.pyo
Ñò
•ÊIc@sÂdZddkZddklZdZdZdZdZd	Zd
e	fd„ƒYZ
de	fd
„ƒYZde	fd„ƒYZddgZ
dejo#ddkZeideiƒndS(s~
Upload Progress Monitor

This is a WSGI middleware component which monitors the status of files
being uploaded.  It includes a small query application which will return
a list of all files being uploaded by particular session/user.

>>> from paste.httpserver import serve
>>> from paste.urlmap import URLMap
>>> from paste.auth.basic import AuthBasicHandler
>>> from paste.debug.debugapp import SlowConsumer, SimpleApplication
>>> # from paste.progress import *
>>> realm = 'Test Realm'
>>> def authfunc(username, password):
...     return username == password
>>> map = URLMap({})
>>> ups = UploadProgressMonitor(map, threshold=1024)
>>> map['/upload'] = SlowConsumer()
>>> map['/simple'] = SimpleApplication()
>>> map['/report'] = UploadProgressReporter(ups)
>>> serve(AuthBasicHandler(ups, realm, authfunc))
serving on...

.. note::

   This is experimental, and will change in the future.
iÿÿÿÿN(tcatch_errorsii<ispaste.bytes_receivedspaste.request_startedspaste.request_finishedt
_ProgressFilecBsAeZdZd„Zd„Zdd„Zd„Zdd„ZRS(sy
    This is the input-file wrapper used to record the number of
    ``paste.bytes_received`` for the given request.
    cCs:||_||_|i|_|i|_|i|_dS(N(t_ProgressFile_environt_ProgressFile_rfiletflushtwritet
writelines(tselftenvirontrfile((s2/usr/lib/python2.6/site-packages/paste/progress.pyt__init__1s
		cs4|i‰t|iƒ‰‡‡fd†}t|ƒS(Nc3s0x)ˆD]!}ˆtct|ƒ7<|VqWdS(N(tENVIRON_RECEIVEDtlen(tchunk(Rtriter(s2/usr/lib/python2.6/site-packages/paste/progress.pytiterwrap;s(RtiterR(RR((RRs2/usr/lib/python2.6/site-packages/paste/progress.pyt__iter__8s	iÿÿÿÿcCs/|ii|ƒ}|itct|ƒ7<|S(N(RtreadRRR(RtsizeR
((s2/usr/lib/python2.6/site-packages/paste/progress.pyRAscCs,|iiƒ}|itct|ƒ7<|S(N(RtreadlineRRR(RR
((s2/usr/lib/python2.6/site-packages/paste/progress.pyRFscCs/|ii|ƒ}|itct|ƒ7<|S(N(Rt	readlinesRRR(RthintR
((s2/usr/lib/python2.6/site-packages/paste/progress.pyRKsN(	t__name__t
__module__t__doc__R
RRRtNoneR(((s2/usr/lib/python2.6/site-packages/paste/progress.pyR+s				tUploadProgressMonitorcBs/eZdZddd„Zd„Zd„ZRS(s<
    monitors and reports on the status of uploads in progress

    Parameters:

        ``application``

            This is the next application in the WSGI stack.

        ``threshold``

            This is the size in bytes that is needed for the
            upload to be included in the monitor.

        ``timeout``

            This is the amount of time (in seconds) that a upload
            remains in the monitor after it has finished.

    Methods:

        ``uploads()``

            This returns a list of ``environ`` dict objects for each
            upload being currently monitored, or finished but whose time
            has not yet expired.

    For each request ``environ`` that is monitored, there are several
    variables that are stored:

        ``paste.bytes_received``

            This is the total number of bytes received for the given
            request; it can be compared with ``CONTENT_LENGTH`` to
            build a percentage complete.  This is an integer value.

        ``paste.request_started``

            This is the time (in seconds) when the request was started
            as obtained from ``time.time()``.  One would want to format
            this for presentation to the user, if necessary.

        ``paste.request_finished``

            This is the time (in seconds) when the request was finished,
            canceled, or otherwise disconnected.  This is None while
            the given upload is still in-progress.

    TODO: turn monitor into a queue and purge queue of finished
          requests that have passed the timeout period.
    cCs6||_|pt|_|pt|_g|_dS(N(tapplicationtDEFAULT_THRESHOLDt	thresholdtDEFAULT_TIMEOUTttimeouttmonitor(RRRR ((s2/usr/lib/python2.6/site-packages/paste/progress.pyR
„s	cs¶ˆiddƒ}|ot|ƒ|ijow|iiˆƒdˆt<tiƒˆt<dˆt	<t
ˆˆdƒˆd<d‡fd†}t|iˆ|||ƒS|iˆ|ƒS(NtCONTENT_LENGTHis
wsgi.inputcstiƒˆt<dS(N(ttimetREQUEST_FINISHED(texc_info(R(s2/usr/lib/python2.6/site-packages/paste/progress.pyt	finalizer”s(
tgettintRR!tappendRR#tREQUEST_STARTEDRR$RRR(RRtstart_responsetlengthR&((Rs2/usr/lib/python2.6/site-packages/paste/progress.pyt__call__Šs

cCs|iS(N(R!(R((s2/usr/lib/python2.6/site-packages/paste/progress.pytuploadsšsN(RRRRR
R-R.(((s2/usr/lib/python2.6/site-packages/paste/progress.pyRPs3	tUploadProgressReportercBs2eZdZd„Zd„Zd„Zd„ZRS(sg
    reports on the progress of uploads for a given user

    This reporter returns a JSON file (for use in AJAX) listing the
    uploads in progress for the given user.  By default, this reporter
    uses the ``REMOTE_USER`` environment to compare between the current
    request and uploads in-progress.  If they match, then a response
    record is formed.

        ``match()``

            This member function can be overriden to provide alternative
            matching criteria.  It takes two environments, the first
            is the current request, the second is a current upload.

        ``report()``

            This member function takes an environment and builds a
            ``dict`` that will be used to create a JSON mapping for
            the given upload.  By default, this just includes the
            percent complete and the request url.

    cCs
||_dS(N(R!(RR!((s2/usr/lib/python2.6/site-packages/paste/progress.pyR
µscCs.|iddƒ|iddƒjotStS(NtREMOTE_USERi(R'RtTruetFalse(Rtsearch_environtupload_environ((s2/usr/lib/python2.6/site-packages/paste/progress.pytmatch¸scCs¦htidti|tƒƒd6dd6|idƒd6|td6|iddƒd	6|id
dƒd6}|t}|o#tidti|ƒƒ|d<n|S(
Ns%Y-%m-%d %H:%M:%StstartedttfinishedR"tcontent_lengthtbytes_receivedt	PATH_INFOt	path_infotQUERY_STRINGtquery_strings%Y:%m:%d %H:%M:%S(R#tstrftimetgmtimeR*R'RR$(RRtretvalR8((s2/usr/lib/python2.6/site-packages/paste/progress.pytreport¾s
	c

Csg}xÊg}|iiƒD]-}|i||ƒo||i|ƒqq~D]~}g}xU|iƒD]G\}}	t|	ƒiddƒiddƒ}	|id||	fƒqjW|iddi|ƒƒqQWddi|ƒ}|d	d
dt	|ƒfgƒ|gS(Ns\s\\t"s\"s%s: "%s"s{ %s }s, s[ %s ]s200 OKsContent-Types
text/plainsContent-Length(sContent-Types
text/plain(
R!R.R5RBtitemststrtreplaceR)tjoinR(
RRR+tbodyt_[1]tenvtmaptpartstktv((s2/usr/lib/python2.6/site-packages/paste/progress.pyR-Ìs.
$	(RRRR
R5RBR-(((s2/usr/lib/python2.6/site-packages/paste/progress.pyR/s
			t__main__toptionflagsii,(RR#t
paste.wsgilibRRRRR*R$tobjectRRR/t__all__RtdoctestttestmodtELLIPSIS(((s2/usr/lib/python2.6/site-packages/paste/progress.pyt<module>!s%M=


Youez - 2016 - github.com/yon3zu
LinuXploit