1# #!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# <HTTPretty - HTTP client mock for Python>
5# Copyright (C) <2011-2021> Gabriel Falcão <gabriel@nacaolivre.org>
6#
7# Permission is hereby granted, free of charge, to any person
8# obtaining a copy of this software and associated documentation
9# files (the "Software"), to deal in the Software without
10# restriction, including without limitation the rights to use,
11# copy, modify, merge, publish, distribute, sublicense, and/or sell
12# copies of the Software, and to permit persons to whom the
13# Software is furnished to do so, subject to the following
14# conditions:
15#
16# The above copyright notice and this permission notice shall be
17# included in all copies or substantial portions of the Software.
18#
19# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26# OTHER DEALINGS IN THE SOFTWARE.
27
28import io
29import types
30from urllib.parse import urlsplit
31from urllib.parse import urlunsplit
32from urllib.parse import parse_qs
33from urllib.parse import quote
34from urllib.parse import quote_plus
35from urllib.parse import unquote
36from urllib.parse import urlencode
37from http.server import BaseHTTPRequestHandler
38
39unquote_utf8 = unquote
40
41
42def encode_obj(in_obj):
43 return in_obj
44
45
46class BaseClass(object):
47 def __repr__(self):
48 return self.__str__()
49
50
51__all__ = [
52 'BaseClass',
53 'BaseHTTPRequestHandler',
54 'quote',
55 'quote_plus',
56 'urlencode',
57 'urlunsplit',
58 'urlsplit',
59 'parse_qs',
60]