-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/transport/http/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyc

ó
î:ïNc@@s¡dZddlmZddlmZddlmZddlmZm	Z	ddl
mZdeeed„Z
d	efd
„ƒYZdefd„ƒYZd
S(sˆWSGI application for bzr HTTP smart server.

For more information about WSGI, see PEP 333:
    http://www.python.org/dev/peps/pep-0333/
i(tabsolute_import(tStringIO(tmedium(tchroott
get_transport(tlocal_path_to_urltREQUEST_URIc
C@s˜t|ƒ}|r%td|ƒ}nt|ƒ}|rQddlm}|ƒn|rsddl}|jjƒnt||ƒ}	t|	d|ƒ}	|	S(sÏConvenience function to construct a WSGI bzr smart server.

    :param root: a local path that requests will be relative to.
    :param prefix: See RelpathSetter.
    :param path_var: See RelpathSetter.
    s	readonly+i(tload_pluginsNt(	RRt
bzrlib.pluginRtbzrlib.tracettracetenable_default_loggingtSmartWSGIAppt
RelpathSetter(
troottprefixtpath_vartreadonlyRtenable_loggingt	local_urltbase_transporttbzrlibtapp((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pytmake_app s
RcB@s&eZdZddd„Zd„ZRS(s•WSGI middleware to set 'bzrlib.relpath' in the environ.

    Different servers can invoke a SmartWSGIApp in different ways.  This
    middleware allows an adminstrator to configure how to the SmartWSGIApp will
    determine what path it should be serving for a given request for many common
    situations.

    For example, a request for "/some/prefix/repo/branch/.bzr/smart" received by
    a typical Apache and mod_fastcgi configuration will set `REQUEST_URI` to
    "/some/prefix/repo/branch/.bzr/smart".  A RelpathSetter with
    prefix="/some/prefix/" and path_var="REQUEST_URI" will set that request's
    'bzrlib.relpath' variable to "repo/branch".
    RRcC@s||_||_||_dS(sOConstructor.

        :param app: WSGI app to wrap, e.g. a SmartWSGIApp instance.
        :param path_var: the variable in the WSGI environ to calculate the
            'bzrlib.relpath' variable from.
        :param prefix: a prefix to strip from the variable specified in
            path_var before setting 'bzrlib.relpath'.
        N(RRR(tselfRRR((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyt__init__Gs			cC@sv||j}d}|j|jƒo1|j|ƒsE|dgƒgS|t|jƒt|ƒ!|d<|j||ƒS(Ns/.bzr/smarts
404 Not Foundsbzrlib.relpath(Rt
startswithRtendswithtlenR(Rtenvirontstart_responsetpathtsuffix((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyt__call__Ts
!
!(t__name__t
__module__t__doc__RR"(((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyR8s

R
cB@s,eZdZdd„Zd„Zd„ZRS(s,A WSGI application for the bzr smart server.t/cC@sDtj|ƒ|_|jjƒt|jjƒƒ|_||_dS(s<Constructor.

        :param backing_transport: a transport.  Requests will be processed
            relative to this transport.
        :param root_client_path: the client path that maps to the root of
            backing_transport.  This is used to interpret relpaths received from
            the client.
        N(RtChrootServert
chroot_servertstart_serverRtget_urltbacking_transporttroot_client_path(RR+R,((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyRas

c
C@sË|ddkr$|ddgƒgS|d}|jdƒsJd|}n|jdƒsf|d7}n|j|jƒr”d}|t|jƒ}nA|jj|ƒrÆd|jt|ƒ}d}n|j}|}|jdƒrñ|d}n|jdƒrt|ƒ‚n|jj|ƒ}tƒ}t	|d	ƒ}|d
j
|ƒ}	|j||j|	|ƒ}
|
j
ƒdkrƒd}n|jƒ}dg}|jdtt|ƒƒfƒ|d|ƒ|gS(sWSGI application callable.tREQUEST_METHODtPOSTs405 Method not allowedtAllowsbzrlib.relpathR&t.itCONTENT_LENGTHs
wsgi.inputiserrorincomplete request
sContent-typesapplication/octet-streamsContent-Lengths200 OK(R/R.N(sContent-typesapplication/octet-stream(RRR,tNoneRtAssertionErrorR+tcloneRtinttreadtmake_requesttwritetnext_read_sizetgetvaluetappendtstr(
RRRtrelpathtadjusted_rcptadjusted_relpatht	transportt
out_buffertrequest_data_lengthtrequest_data_bytestsmart_protocol_requestt
response_datatheaders((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyR"ysB


		
			
cC@s>tj|ƒ\}}|||||jƒ}|j|ƒ|S(N(Rt_get_protocol_factory_for_bytesR+taccept_bytes(RR@t
write_funct
request_bytestrcptprotocol_factorytunused_bytestserver_protocol((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyR7²s
(R#R$R%RR"R7(((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyR
^s	9N(R%t
__future__Rt	cStringIORtbzrlib.smartRtbzrlib.transportRRtbzrlib.urlutilsRtTrueRtobjectRR
(((s>/usr/lib/python2.7/dist-packages/bzrlib/transport/http/wsgi.pyt<module>s&

Copyright © 2017 || Recoded By Mr.Bumblebee