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//urlparser.pyo
Ñò
•ÊIc@s´dZddkZddkZddkZddkZyddkZWnej
o
eZnXddkl	Z	ddkl
Z
ddklZddkl
Z
ddklZddklZd	efd
„ƒYZddd
gZdefd„ƒYZd„Zeideƒd„Zeideƒd„Zd„Zd„Zeideƒdefd„ƒYZed„Zd
efd„ƒYZdd„Zeeed„ZdS(sH
WSGI applications that parse the URL and dispatch to on-disk resources
iÿÿÿÿN(trequest(tfileapp(t
import_string(thttpexceptions(tETAG(t
converterst	NoDefaultcBseZRS((t__name__t
__module__(((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRst	URLParsertStaticURLParsertPkgResourcesParsercBsžeZdZhZeZhZeeedd„Zd„Z	d„Z
dd„Zd„Zd„Z
d„Zd„ZeeƒZd	„Zd
„Zd„ZRS(
s	
    WSGI middleware

    Application dispatching, based on URL.  An instance of `URLParser` is
    an application that loads and delegates to other applications.  It
    looks for files in its directory that match the first part of
    PATH_INFO; these may have an extension, but are not required to have
    one, in which case the available files are searched to find the
    appropriate file.  If it is ambiguous, a 404 is returned and an error
    logged.

    By default there is a constructor for .py files that loads the module,
    and looks for an attribute ``application``, which is a ready
    application object, or an attribute that matches the module name,
    which is a factory for building applications, and is called with no
    arguments.

    URLParser will also look in __init__.py for special overrides.
    These overrides are:

    ``urlparser_hook(environ)``
        This can modify the environment.  Its return value is ignored,
        and it cannot be used to change the response in any way.  You
        *can* use this, for example, to manipulate SCRIPT_NAME/PATH_INFO
        (try to keep them consistent with the original URL -- but
        consuming PATH_INFO and moving that to SCRIPT_NAME is ok).

    ``urlparser_wrap(environ, start_response, app)``:
        After URLParser finds the application, it calls this function
        (if present).  If this function doesn't call
        ``app(environ, start_response)`` then the application won't be
        called at all!  This can be used to allocate resources (with
        ``try:finally:``) or otherwise filter the output of the
        application.

    ``not_found_hook(environ, start_response)``:
        If no file can be found (*in this directory*) to match the
        request, then this WSGI application will be called.  You can
        use this to change the URL and pass the request back to
        URLParser again, or on to some other application.  This
        doesn't catch all ``404 Not Found`` responses, just missing
        files.

    ``application(environ, start_response)``:
        This basically overrides URLParser completely, and the given
        application is used for all requests.  ``urlparser_wrap`` and
        ``urlparser_hook`` are still called, but the filesystem isn't
        searched in any way.
    c
KsÑ|o ddk}	|	idtƒnh}tiidjo|itiidƒ}n||_||_|t	jo|i
ddƒ}nti|ƒ|_
|t	jo|i
d
dƒ}nti|ƒ|_|t	jo|i
ddƒ}nti|ƒ|_|iiƒ|_|o|ii|ƒnx|iƒD]‚\}
}|
idƒptd|
|fƒ‚n|
tdƒiƒ}t|ttfƒoti|ƒ}n||i|<qGWdS(sò
        Create a URLParser object that looks at `directory`.
        `base_python_name` is the package that this directory
        represents, thus any Python modules in this directory will
        be given names under this package.
        iÿÿÿÿNsfThe global_conf argument to URLParser is deprecated; either pass in None or {}, or use make_url_parsert/tindex_namestindextIndextmaintMainthide_extensionss.pycs.baks.py~s.pyotignore_extensionssconstructor s]Only extra configuration keys allowed are 'constructor .ext = import_expr'; you gave %r (=%r)(sindexRsmainR(s.pycs.baks.py~s.pyo((twarningstwarntDeprecationWarningtostpathtseptreplacet	directorytbase_python_nameRtgetRtaslistR
RRtglobal_constructorstcopytconstructorstupdatetitemst
startswitht
ValueErrortlentstript
isinstancetstrtunicodeRteval_import(
tselftglobal_confRRR
RRR!tconstructor_confRtnametvaluetext((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyt__init__VsF
		



cCs"|i|d<|itjo|i|ƒ|_n|iddƒ}|p|i||ƒS|io*t|iddƒo|ii|ƒn|d}|d}|i	|ƒ\}}|p|iodt|iddƒoN|idƒ|j	o8|ii
}||d<||d<||d<|||ƒS|djoeti|dƒ\}	}
|	p$dd	i
|ipd
gƒ}	n|i||d|	|ifƒS|did
|ƒ|i||d||ifƒSn|io-t|iddƒo|ii|||ƒS|||ƒSdS(Ns paste.urlparser.base_python_namet	PATH_INFOtturlparser_hooktSCRIPT_NAMEtnot_found_hooks paste.urlparser.not_found_parsers	one of %ss, s(no index_names defined)s"Tried to load %s from directory %sswsgi.errorss7Found resource %s, but could not construct application
turlparser_wrap(Rtinit_moduleRtfind_init_moduleRt	add_slashtgetattrtNoneR5tfind_applicationR7Rtpath_info_splittjoinR
t	not_foundRtwriteR8(R,tenvirontstart_responset	path_infotorig_path_infotorig_script_nametapplicationtfilenameR7R/trest_of_path((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyt__call__ŒsV








	


	cCs9|ioPt|iddƒo:|idƒ|djo|d|d<|iidfSti|dƒ\}}||d<|dj	o"|iddƒd||d<n|pB|i}xH|D]$}|i||ƒ}|oPqÃqÃWd}n|i||ƒ}|djod|fS|i	||ƒ|fSdS(NRHs paste.urlparser.init_applicationR6R3R4R(
R9R<R=RRHRR?R
t	find_filetget_application(R,RCR/RJtnamest
index_nameRI((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR>¼s*


"		

cCs^tidti|ƒdd|idƒ|idƒ|i|pdfƒ}|i||ƒS(Ns%The resource at %s could not be foundtcomments6SCRIPT_NAME=%r; PATH_INFO=%r; looking in %r; debug: %sR6R3s(none)(RtHTTPNotFoundRt
construct_urlRRtwsgi_application(R,RCRDt
debug_messagetexc((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRAÖscCswti|dtƒ}|d7}|idƒo|d|d7}ntid|dd|fgƒ}|i||ƒS(s^
        This happens when you try to get to a directory
        without a trailing /
        twith_query_stringRtQUERY_STRINGt?sFThe resource has moved to %s - you should be redirected automatically.theaderstlocation(RRRtFalseRRtHTTPMovedPermanentlyRS(R,RCRDturlRU((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR;ßs
cCs3g}x¿ti|iƒD]«}tii|ƒ\}}tii|i|ƒ}||ijp|oqn||jo|i|ƒqn||ijoqn||jo|i|ƒqqW|pdSt
|ƒdjoD||jo|S|didti
|ƒdi|ƒfƒdS|dS(Niswsgi.errorss$Ambiguous URL: %s; matches files %s
s, i(RtlistdirRRtsplitextR@RtappendRR=R&RBRRR(R,RCt
base_filenametpossibleRItbaseR1t
full_filename((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRLîs4




cCstii|ƒo
d}ntii|ƒd}|ii||iidƒƒ}|djo|S||||ƒ}|djon|S(Ntdirit*(RRtisdirR_R!RR=(R,RCRItttconstructortapp((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRMs
!

cCs|i}|||<dS(s’
        Register a function as a constructor.  Registered constructors
        apply to all instances of `URLParser`.

        The extension should have a leading ``.``, or the special
        extensions ``dir`` (for directories) and ``*`` (a catch-all).

        `constructor` must be a callable that takes two arguments:
        ``environ`` and ``filename``, and returns a WSGI application.
        N(R(tclst	extensionRitd((s3/usr/lib/python2.6/site-packages/paste/urlparser.pytregister_constructor#s	cCs|y|i||fSWn`tj
oT|ih||d|id|id|id|iƒ}||i||f<|SXdS(sÃ
        Get a parser for the given directory, or create one if
        necessary.  This way parsers can be cached and reused.

        # @@: settings are inherited from the first caller
        R
RRR!N(tparsers_by_directorytKeyErrort	__class__R
RRR!(R,RRtparser((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyt
get_parser6s				cCs=tii|idƒ}tii|ƒpdSt||ƒS(Ns__init__.py(RRR@RtexistsR=tload_module(R,RCRI((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR:JscCs2d|ii|i|ittt|ƒƒƒfS(Ns"<%s directory=%r; module=%s at %s>(RqRRRthextabstid(R,((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyt__repr__Ps
	N(RRt__doc__RoRR9RR=R2RKR>RAR;RLRMRntclassmethodRsR:Ry(((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR	s&21	0				#				cCsQ|d}|o|dtii|ƒ7}ntii|ƒ}|i||ƒS(Ns paste.urlparser.base_python_namet.(RRtbasenameRs(RrRCRIR((s3/usr/lib/python2.6/site-packages/paste/urlparser.pytmake_directoryWs

RecCs
ti|ƒS(N(RtFileApp(RrRCRI((s3/usr/lib/python2.6/site-packages/paste/urlparser.pytmake_unknownasRfcCs\|d}tiitii|ƒƒd}|o|d|}nt||||dƒS(Ns paste.urlparser.base_python_nameiR|swsgi.errors(RRR_R}tload_module_from_name(RCRIRtmodule_name((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRufs
"cCs¾tii|ƒoti|Stiitii|ƒdƒ}tii|ƒppyt|dƒ}Wn?t	t
fj
o-}|idtii|ƒ|fƒdSX|idƒ|i
ƒnd}tii|ƒoti|Sd|joTdi|idƒd ƒ}|idƒd}	t|tii|ƒ||ƒ}
n|}	d}zFti|	tii|ƒgƒ\}}}ti||||ƒ}
Wd|dj	o|i
ƒnX|
S(Ns__init__.pytws5Cannot write __init__.py file into directory %s (%s)
s#
R|iÿÿÿÿ(tsystmodulesthas_keyRRR@tdirnameRttopentOSErrortIOErrorRBR=tclosetsplitRtimptfind_moduleRu(RCRIR‚terrorst
init_filenametftetfptparent_namet	base_nametparenttpathnametstufftmodule((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRns<!

$
cCsÌt||ƒ}|pdSt|dƒo!|iot|id|iƒS|iidƒd}t||ƒo;t||ƒ}t|dƒo|iSt||ƒƒSn|did||fƒdS(NRHRSR|iÿÿÿÿswsgi.errorss'Cound not find application or %s in %s
(	RuR=thasattrRHR<RRŒRSRB(RrRCRIR™R•tobj((s3/usr/lib/python2.6/site-packages/paste/urlparser.pytmake_pys
s.pycBsVeZdZddd„Zd„Zd„Zd„Zdd„Zd„Z	d„Z
RS(	s‹
    Like ``URLParser`` but only serves static files.

    ``cache_max_age``:
      integer specifies Cache-Control max_age in seconds
    cCstiidjo|itiidƒ}ntiitii|ƒƒ|_||_|dj	otii	|iƒ|_n
||_tiitii	tii|iƒƒƒ|_||_
tiidjo:|idtiiƒ}|iidtiiƒ|_ndS(NR(RRRRtnormcasetabspathRtroot_directoryR=tnormpatht
cache_max_age(R,RRŸR¡((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR2¯s!	
		cCsB|iddƒ}|p|i||ƒS|djo
d}nti|ƒ}tiitiitii|i	|ƒƒƒ}tii
djo|idtii
ƒ}n|idj	o%|i|iƒo|i||ƒStii|ƒp|i||ƒStii|ƒoI|idj	o
|ip|i	}|i|d|d|iƒ||ƒS|idƒo'|idƒdjo|i||ƒS|idƒ}|oTti|ƒi}t|ƒ|jo+g}	ti|	|ƒ|d|	ƒdgSn|i|ƒ}
|io|
id	|iƒn|
||ƒS(
NR3R4Rs
index.htmlRŸR¡tHTTP_IF_NONE_MATCHs304 Not Modifiedtmax_age(RR;Rt
path_info_popRRRR R@RRRRŸR=R$RARtRgRqR¡terror_extra_pathtstattst_mtimeR)RR"tmake_appt
cache_control(R,RCRDRERItfullt
child_roott
if_none_matchtmytimeRYtfa((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRKÀsD

$&

cCs
ti|ƒS(N(RR(R,RI((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR¨éscCswti|dtƒ}|d7}|idƒo|d|d7}ntid|dd|fgƒ}|i||ƒS(s^
        This happens when you try to get to a directory
        without a trailing /
        RVRRWRXsFThe resource has moved to %s - you should be redirected automatically.RYRZ(RRRR[RRR\RS(R,RCRDR]RU((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR;ìs
cCs^tidti|ƒdd|idƒ|idƒ|i|pdfƒ}|i||ƒS(Ns%The resource at %s could not be foundRPs6SCRIPT_NAME=%r; PATH_INFO=%r; looking in %r; debug: %sR6R3s(none)(RRQRRRRRRS(R,RCRDRTRU((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRAûscCs'tid|dƒ}|i||ƒS(Ns#The trailing path %r is not allowedR3(RRQRS(R,RCRDRU((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR¥scCsd|ii|ifS(Ns<%s %r>(RqRR(R,((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRy	sN(RRRzR=R2RKR¨R;RAR¥Ry(((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR
¥s	)				cCs-|dj	ot|ƒ}nt|d|ƒS(s«
    Return a WSGI application that serves a directory (configured
    with document_root)
    
    cache_max_age - integer specifies CACHE_CONTROL max_age in seconds
    R¡N(R=tintR
(R-t
document_rootR¡((s3/usr/lib/python2.6/site-packages/paste/urlparser.pytmake_statics
cBs5eZddd„Zd„Zd„Zdd„ZRS(cCs±tdjotdƒ‚nt|ttfƒoti|ƒ|_n
||_||_|djoti	ƒ}n||_
|djo
|}ntii
|ƒ|_dS(Ns"This class requires pkg_resources.(t
pkg_resourcesR=tNotImplementedErrorR(R)R*tget_distributionteggt
resource_nametResourceManagertmanagerRRR t
root_resource(R,tegg_or_specR¶R¸R¹((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyR2s
		
	

cCs d|ii|ii|ifS(Ns<%s for %s:%r>(RqRRµtproject_nameR¶(R,((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRy)s		cCs|iddƒ}|p|i||ƒS|djo
d}nti|ƒ}tiitii|id|ƒƒ}|i	dj	o%|i|i	ƒo|i||ƒS|i
i|ƒp|i||ƒS|i
i|ƒoL|i	dj	o
|i	p|i}|i|i
||id|ƒ||ƒS|idƒo'|idƒdjo|i||ƒSti|ƒ\}}|p
d}ny|i
i|i|ƒ}	Wn;ttfj
o)}
tid|
ƒ}|i||ƒSX|dd	|fgƒti|	ƒS(
NR3R4Rs
index.htmlR¹sapplication/octet-streams,You are not permitted to view this file (%s)s200 OKscontent-type(RR;RR¤RRRR R¶R¹R=R$RARµthas_resourcetresource_isdirRqR¸R¥t	mimetypest
guess_typetget_resource_streamRŠR‰Rt
HTTPForbiddenRSRt	_FileIter(R,RCRDRERItresourceR«ttypetencodingtfileR’RU((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRK/s>

$	&

c	Csdtidti|ƒdd|idƒ|idƒ|i|i|pdfƒ}|i||ƒS(Ns%The resource at %s could not be foundRPs=SCRIPT_NAME=%r; PATH_INFO=%r; looking in egg:%s#%r; debug: %sR6R3s(none)(RRQRRRRRµR¶RS(R,RCRDRTRU((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRAVs N(RRR=R2RyRKRA(((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyRs		'R4cCs*tdjotdƒ‚nt||ƒS(s
    A static file parser that loads data from an egg using
    ``pkg_resources``.  Takes a configuration value ``egg``, which is
    an egg spec, and a base ``resource_name`` (default empty string)
    which is the path in the egg that this starts at.
    s%This function requires pkg_resources.N(R²R=R³R(R-RµR¶((s3/usr/lib/python2.6/site-packages/paste/urlparser.pytmake_pkg_resources_s
cKs»|djo|iddƒ}nti|ƒ}|djo|idd
ƒ}nti|ƒ}|djo|id
dƒ}nti|ƒ}th||d|d|d
||S(s­
    Create a URLParser application that looks in ``directory``, which
    should be the directory for the Python package named in
    ``base_python_name``.  ``index_names`` are used when viewing the
    directory (like ``'index'`` for ``'index.html'``).
    ``hide_extensions`` are extensions that are not viewable (like
    ``'.pyc'``) and ``ignore_extensions`` are viewable but only if an
    explicit extension is given.
    R
RRRRRs.pyctbakspy~RN(sindexsIndexsmainsMain(s.pycRÈspy~((R=RRRR	(R-RRR
RRR.((s3/usr/lib/python2.6/site-packages/paste/urlparser.pytmake_url_parserjs"



( RzRR„RR¾R²tImportErrorR=tpasteRRt
paste.utilRRthttpheadersRRtobjectRt__all__R	R~RnR€RuRRœR
R±RRÇRÉ(((s3/usr/lib/python2.6/site-packages/paste/urlparser.pyt<module>s@ÿ=				"	gG

Youez - 2016 - github.com/yon3zu
LinuXploit