ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ aNc@sdZddlZddlmZdZdZdZdZd Zd e fd YZ d e fd YZ de fdYZ d dgZ dekrddlZejdejndS(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. iN(t catch_errorsii<ispaste.bytes_receivedspaste.request_startedspaste.request_finishedt _ProgressFilecBsAeZdZdZdZddZdZddZRS(sy This is the input-file wrapper used to record the number of ``paste.bytes_received`` for the given request. cCs:||_||_|j|_|j|_|j|_dS(N(t_ProgressFile_environt_ProgressFile_rfiletflushtwritet writelines(tselftenvirontrfile((s?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pyt__init__1s     cs4|jt|jfd}t|S(Nc3s0x)D]!}tct|7<|VqWdS(N(tENVIRON_RECEIVEDtlen(tchunk(Rtriter(s?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pytiterwrap;s (RtiterR(RR((RRs?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pyt__iter__8s icCs/|jj|}|jtct|7<|S(N(RtreadRR R (RtsizeR ((s?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pyRAscCs,|jj}|jtct|7<|S(N(RtreadlineRR R (RR ((s?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pyRFscCs/|jj|}|jtct|7<|S(N(Rt readlinesRR R (RthintR ((s?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pyRKsN( t__name__t __module__t__doc__R RRRtNoneR(((s?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pyR+s    tUploadProgressMonitorcBs/eZdZdddZdZdZRS(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. cCs4||_|pt|_|p!t|_g|_dS(N(t applicationtDEFAULT_THRESHOLDt thresholdtDEFAULT_TIMEOUTttimeouttmonitor(RRRR ((s?/opt/alt/python27/lib/python2.7/site-packages/paste/progress.pyR s csjdd}|rt||jkr|jjdt!s %M=