Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
wsgi.cpython-313.pyc61 linesDownload Raw Back to __pycache__
1�

2��j�����SSKJr SSKrSSKrSSKrSSKrSSKJrJr SSK	J3r4 SSKJr \R(aSSKJr SS	KJr \R$"S55rS/rSSjr"S
S\65r"SS\5rg)�)�annotationsN�)�Request�Response)�SyncByteStream�)�
BaseTransport)�7OptExcInfo)�WSGIApplication�_T�
WSGITransportc�p�[U5nUH$nU(dM[R"U/U5s $ /$�N)�iter�	itertools�chain)�body�chunks  �HD:\code\apps\devtools\python\Lib\site-packages\httpx/_transports/wsgi.py�_skip_leading_empty_chunksrs4����:�D����5��?�?�E�7�D�1�1���I�c�2�\rSrSrSSjrSSjrS	SjrSrg)8�WSGIByteStream�c�H�[USS5Ul[U5Ulg)N�close)�getattr�_closer�_result)�self�results  r�__init__�WSGIByteStream.__init__s���f�g�t�4���1�&�9��rc#�:# �URHnUv� M	 g7fr)r)r �parts  r�__iter__�WSGIByteStream.__iter__#s����L�L�D��J�!�s�c�@�URbUR5 ggr)r)r s rr�WSGIByteStream.close's���;�;�"��K�K�M�#r)rrN)r!ztyping.Iterable[bytes]�return�None)r*ztyping.Iterator[bytes])r*r+)�__name__�9__module__�__qualname__�__firstlineno__r"r&r�__static_attributes__�rrrrs��:��rrc�N�\rSrSrSrSSSjjrS	SjrSrg)10r
�,a�11A custom transport that handles sending requests directly to an WSGI app.12The simplest way to use this functionality is to use the `app` argument.13 14```15client = httpx.Client(app=app)16```17 18Alternatively, you can setup the transport instance explicitly.19This allows you to include any additional configuration arguments specific20to the WSGITransport class:21 22```23transport = httpx.WSGITransport(24    app=app,25    script_name="/submount",26    remote_addr="1.2.3.4"27)28client = httpx.Client(transport=transport)29```30 31Arguments:32 33* `app` - The WSGI application.34* `raise_app_exceptions` - Boolean indicating if exceptions in the application35   should be raised. Default to `True`. Can be set to `False` for use cases36   such as testing the content of a client 500 response.37* `script_name` - The root path on which the WSGI application should be mounted.38* `remote_addr` - A string indicating the client IP of incoming requests.39```40Nc�@�XlX lX0lX@lXPlgr)�app�raise_app_exceptions�script_name�remote_addr�wsgi_errors)r r5r6r7r8r9s      rr"�WSGITransport.__init__Ms!����$8�!�&��&��&�rc�^^^�UR5 [R"UR5nURR41=(d SSS.URRnSURRUUR=(d [RSSSURURURRURRRS5URR[!U5SUR"S	.nUR$R&HRupVURS5R)5R+S42S5nUS;aS
U-nURS5XG'MT SmSmSmSSUUU4SjjjnUR-XH5n	[/U	5n43TceTceT(a TS(aUR0(aTSe[3TR55S5nTVVs/sH'up|UR7S5UR7S54PM) n
nn[9X�U44S9$s snnf)N�Pi�)�http�https)rrTF�asciizHTTP/1.1)zwsgi.versionzwsgi.url_schemez45wsgi.inputzwsgi.errorszwsgi.multithreadzwsgi.multiprocessz
wsgi.run_once�REQUEST_METHOD�SCRIPT_NAME�	PATH_INFO�QUERY_STRING�SERVER_NAME�SERVER_PORT�SERVER_PROTOCOL�REMOTE_ADDR�-�_)�CONTENT_TYPE�CONTENT_LENGTH�HTTP_c�>�UmUmUmS$)Nc��grr1)rIs r�<lambda>�FWSGITransport.handle_request.<locals>.start_response.<locals>.<lambda>�s��Trr1)�status�response_headers�exc_info�
seen_exc_info�seen_response_headers�seen_statuss   ���r�start_response�4WSGITransport.handle_request.<locals>.start_response{s���!�K�$4�!�$�M�!�!rrr)�headers�streamr)rQ�strrRzlist[tuple[str, str]]rSzOptExcInfo | Noner*z$typing.Callable[[bytes], typing.Any])�read�io�BytesIO�content�url�port�schemer9�sys�stderr�methodr7�path�query�decode�hostr[r8rY�raw�upper�replacer5rr6�int�split�encoder)r �request�46wsgi_inputra�environ�47header_key�header_value�keyrWr!rZ�status_code�valuerYrTrUrVs              @@@r�handle_request�WSGITransport.handle_request[s.��������Z�Z����0�48��{�{���Q�B��#=�g�k�k�>P�>P�#Q��"�&�{�{�1�1�$��+�+�9�s�z�z� $�!&�"�%�n�n��+�+� ���)�)�#�K�K�-�-�4�4�W�=�"�;�;�+�+��t�9�)��+�+�49��")0���(;�(;�$�J��#�#�G�,�2�2�4�<�<�S�#�F�C��<�<���m��'�.�.�w�7�G�L�	)<��� $���
�50+/�		"��		"�3�		"�(�		"�2�			"�		"����'�2����'���&�&�&�$�0�0�0��]�1�-�$�2K�2K���"�"��+�+�+�-�a�0�1��4�51�3�52���Z�Z��
 �%�,�,�w�"7�8�3�	�53�54��V�D�D��55s�.I)r5r6r8r7r9)T�z	127.0.0.1N)r5rr6�boolr7r[r8r[r9ztyping.TextIO | Noner*r+)rprr*r)r,r-r.r/�__doc__r"rxr0r1rrr
r
,s[���F&*��&�,0�
'�
�'�#�'��	'�56�'�*�
'�57�'�:Er)r�typing.Iterable[_T]r*r})�58__future__rr]rrc�typing�_modelsrr�_typesr�baser	�
TYPE_CHECKING�	_typeshedr59�_typeshed.wsgir�TypeVarr�__all__rrr
r1rr�<module>r�se��"�	��60�
�'�#��	���$�.��^�^�D����61����^��iE�M�iEr
codekingpro/portable-devtools · Team Ai