Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 2165

Show
Ignore:
Timestamp:
03/30/09 11:14:46
Author:
jaraco
Message:

Renamed lib/http.py to lib/httputil.py to avoid naming collisions.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/python3/cherrypy/__init__.py

    r2158 r2165  
    164164 
    165165from cherrypy import _cprequest 
    166 from cherrypy.lib import http as _http 
     166from cherrypy.lib import httputil as _httputil 
    167167 
    168168from cherrypy import _cptree 
     
    266266    """ 
    267267     
    268     request = _cprequest.Request(_http.Host("127.0.0.1", 80), 
    269                                  _http.Host("127.0.0.1", 1111)) 
     268    request = _cprequest.Request(_httputil.Host("127.0.0.1", 80), 
     269                                 _httputil.Host("127.0.0.1", 1111)) 
    270270    request__doc = """ 
    271271    The request object for the current thread. In the main thread, 
  • branches/python3/cherrypy/_cperror.py

    r2164 r2165  
    55from traceback import format_exception as _format_exception 
    66from urllib.parse import urljoin as _urljoin 
    7 from cherrypy.lib import http as _http 
     7from cherrypy.lib import httputil 
    88 
    99 
     
    187187        self.status = status 
    188188        try: 
    189             self.code, self.reason, defaultmsg = _http.valid_status(status) 
     189            self.code, self.reason, defaultmsg = httputil.valid_status(status) 
    190190        except ValueError as x: 
    191191            raise cherrypy.HTTPError(500, x.args[0]) 
     
    283283     
    284284    try: 
    285         code, reason, message = _http.valid_status(status) 
     285        code, reason, message = httputil.valid_status(status) 
    286286    except ValueError as x: 
    287287        raise cherrypy.HTTPError(500, x.args[0]) 
  • branches/python3/cherrypy/_cprequest.py

    r2164 r2165  
    99from cherrypy import _cpcgifs, _cpconfig 
    1010from cherrypy._cperror import format_exc, bare_error 
    11 from cherrypy.lib import http, file_generator 
     11from cherrypy.lib import httputil, file_generator 
    1212 
    1313 
     
    174174     
    175175    # Conversation/connection attributes 
    176     local = http.Host("127.0.0.1", 80) 
     176    local = httputil.Host("127.0.0.1", 80) 
    177177    local__doc = \ 
    178178        "An http.Host(ip, port, hostname) object for the server socket." 
    179179     
    180     remote = http.Host("127.0.0.1", 1111) 
     180    remote = httputil.Host("127.0.0.1", 1111) 
    181181    remote__doc = \ 
    182182        "An http.Host(ip, port, hostname) object for the client socket." 
     
    243243    In general, you should use request.headers (a dict) instead.""" 
    244244     
    245     headers = http.HeaderMap() 
     245    headers = httputil.HeaderMap() 
    246246    headers__doc = """ 
    247247    A dict-like object containing the request headers. Keys are header 
     
    250250    headers['content-type'] refer to the same value. Values are header 
    251251    values (decoded according to RFC 2047 if necessary). See also: 
    252     http.HeaderMap, http.HeaderElement.""" 
     252    httputil.HeaderMap, httputil.HeaderElement.""" 
    253253     
    254254    cookie = http.cookies.SimpleCookie() 
     
    457457        """Populate a new Request object. 
    458458         
    459         local_host should be an http.Host object with the server info. 
    460         remote_host should be an http.Host object with the client info. 
     459        local_host should be an httputil.Host object with the server info. 
     460        remote_host should be an httputil.Host object with the client info. 
    461461        scheme should be a string, either "http" or "https". 
    462462        """ 
     
    534534            self.header_list = list(headers) 
    535535            self.rfile = rfile 
    536             self.headers = http.HeaderMap() 
     536            self.headers = httputil.HeaderMap() 
    537537            self.cookie = http.cookies.SimpleCookie() 
    538538            self.handler = None 
     
    634634    def process_headers(self): 
    635635        """Parse HTTP header data into Python structures. (Core)""" 
    636         self.params = http.parse_query_string(self.query_string) 
     636        self.params = httputil.parse_query_string(self.query_string) 
    637637         
    638638        # Process the headers into self.headers 
     
    648648            # (but they will be correctly stored in request.cookie). 
    649649            if "=?" in value: 
    650                 dict.__setitem__(headers, name, http.decode_TEXT(value)) 
     650                dict.__setitem__(headers, name, httputil.decode_TEXT(value)) 
    651651            else: 
    652652                dict.__setitem__(headers, name, value) 
     
    714714        # didn't provide a "Content-Type" header. 
    715715        if 'Content-Type' not in self.headers: 
    716             h = http.HeaderMap(list(self.headers.items())) 
     716            h = httputil.HeaderMap(list(self.headers.items())) 
    717717            h['Content-Type'] = '' 
    718718        else: 
     
    740740            self.body = forms.file 
    741741        else: 
    742             self.body_params = p = http.params_from_CGI_form(forms) 
     742            self.body_params = p = httputil.params_from_CGI_form(forms) 
    743743            self.params.update(p) 
    744744     
     
    802802    In general, you should use response.headers (a dict) instead.""" 
    803803     
    804     headers = http.HeaderMap() 
     804    headers = httputil.HeaderMap() 
    805805    headers__doc = """ 
    806806    A dict-like object containing the response headers. Keys are header 
     
    809809    headers['content-type'] refer to the same value. Values are header 
    810810    values (decoded according to RFC 2047 if necessary). See also: 
    811     http.HeaderMap, http.HeaderElement.""" 
     811    httputil.HeaderMap, httputil.HeaderElement.""" 
    812812     
    813813    cookie = http.cookies.SimpleCookie() 
     
    837837        self.time = time.time() 
    838838         
    839         self.headers = http.HeaderMap() 
     839        self.headers = httputil.HeaderMap() 
    840840        # Since we know all our keys are titled strings, we can 
    841841        # bypass HeaderMap.update and get a big speed boost. 
     
    843843            "Content-Type": 'text/html', 
    844844            "Server": "CherryPy/" + cherrypy.__version__, 
    845             "Date": http.HTTPDate(self.time), 
     845            "Date": httputil.HTTPDate(self.time), 
    846846        }) 
    847847        self.cookie = http.cookies.SimpleCookie() 
     
    856856        """Transform headers (and cookies) into self.header_list. (Core)""" 
    857857        try: 
    858             code, reason, _ = http.valid_status(self.status) 
     858            code, reason, _ = httputil.valid_status(self.status) 
    859859        except ValueError as x: 
    860860            raise cherrypy.HTTPError(500, x.args[0]) 
  • branches/python3/cherrypy/_cptree.py

    r2164 r2165  
    44import cherrypy 
    55from cherrypy import _cpconfig, _cplogging, _cprequest, _cpwsgi, tools 
    6 from cherrypy.lib import http as _http 
     6from cherrypy.lib import httputil 
    77 
    88 
     
    211211        if path is None: 
    212212            try: 
    213                 path = _http.urljoin(cherrypy.request.script_name, 
     213                path = httputil.urljoin(cherrypy.request.script_name, 
    214214                                     cherrypy.request.path_info) 
    215215            except AttributeError: 
     
    230230        # to '' (some WSGI servers always set SCRIPT_NAME to ''). 
    231231        # Try to look up the app using the full path. 
    232         path = _http.urljoin(environ.get('SCRIPT_NAME', ''), 
     232        path = httputil.urljoin(environ.get('SCRIPT_NAME', ''), 
    233233                             environ.get('PATH_INFO', '')) 
    234234        sn = self.script_name(path or "/") 
  • branches/python3/cherrypy/_cpwsgi.py

    r2158 r2165  
    66import cherrypy as _cherrypy 
    77from cherrypy import _cperror 
    8 from cherrypy.lib import http as _http 
     8from cherrypy.lib import httputil 
    99 
    1010 
     
    211211        """Run self.request and return its response.""" 
    212212        meth = self.environ['REQUEST_METHOD'] 
    213         path = _http.urljoin(self.environ.get('SCRIPT_NAME', ''), 
     213        path = httputil.urljoin(self.environ.get('SCRIPT_NAME', ''), 
    214214                             self.environ.get('PATH_INFO', '')) 
    215215        qs = self.environ.get('QUERY_STRING', '') 
     
    224224        env = self.environ.get 
    225225         
    226         local = _http.Host('', int(env('SERVER_PORT', 80)), 
     226        local = httputil.Host('', int(env('SERVER_PORT', 80)), 
    227227                           env('SERVER_NAME', '')) 
    228         remote = _http.Host(env('REMOTE_ADDR', ''), 
     228        remote = httputil.Host(env('REMOTE_ADDR', ''), 
    229229                            int(env('REMOTE_PORT', -1)), 
    230230                            env('REMOTE_HOST', '')) 
  • branches/python3/cherrypy/lib/httputil.py

    • Property svn:mergeinfo set

Hosted by WebFaction

Log in as guest/cpguest to create tickets