rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def parse_dict_querystring(environ): """Parses a query string like parse_querystring, but returns a multidict Caches this value in case parse_dict_querystring is called again for the same request. Example:: #environ['QUERY_STRING'] - day=Monday&user=fred&user=jane >>> parsed = parse_dict_querystring(environ) >>> p... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def parse_dict_querystring(environ): """Parses a query string like parse_querystring, but returns a multidict Caches this value in case parse_dict_querystring is called again for the same request. Example:: #environ['QUERY_STRING'] - day=Monday&user=fred&user=jane >>> parsed = parse_dict_querystring(environ) >>> p... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def parse_formvars(environ, all_as_list=False, include_get_vars=True): """Parses the request, returning a dictionary of the keys. If ``all_as_list`` is true, then all values will be lists. If not, then only values that show up multiple times will be lists. If ``include_get_vars`` is true and this was a POST request,... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def construct_url(environ, with_query_string=True, with_path_info=True, script_name=None, path_info=None, querystring=None): """Reconstructs the URL from the WSGI environment. You may override SCRIPT_NAME, PATH_INFO, and QUERYSTRING with the keyword arguments. """ url = environ['wsgi.url_scheme']+'://' if environ.ge... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def construct_url(environ, with_query_string=True, with_path_info=True, script_name=None, path_info=None, querystring=None): """Reconstructs the URL from the WSGI environment. You may override SCRIPT_NAME, PATH_INFO, and QUERYSTRING with the keyword arguments. """ url = environ['wsgi.url_scheme']+'://' if environ.ge... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def resolve_relative_url(url, environ): """ Resolve the given relative URL as being relative to the location represented by the environment. This can be used for redirecting to a relative path. Note: if url is already absolute, this function will (intentionally) have no effect on it. """ cur_url = construct_url(envi... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def path_info_split(path_info): """ Splits off the first segment of the path. Returns (first_part, rest_of_path). first_part can be None (if PATH_INFO is empty), '' (if PATH_INFO is '/'), or a name without any /'s. rest_of_path can be '' or a string starting with /. """ if not path_info: return None, '' assert path... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
>>> def call_it(script_name, path_info): | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
LazyCache takes a function, and will hold onto it to be called at a | LazyCache takes a function, and will hold onto it to be called at a | def parse_headers(environ): """ Parse the headers in the environment (like ``HTTP_HOST``) and yield a sequence of those (header_name, value) tuples. """ # @@: Maybe should parse out comma-separated headers? for cgi_var, value in environ.iteritems(): if cgi_var in _parse_headers_special: yield _parse_headers_special[cgi... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py |
def parse_headers(environ): """ Parse the headers in the environment (like ``HTTP_HOST``) and yield a sequence of those (header_name, value) tuples. """ # @@: Maybe should parse out comma-separated headers? for cgi_var, value in environ.iteritems(): if cgi_var in _parse_headers_special: yield _parse_headers_special[cgi... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def parse_headers(environ): """ Parse the headers in the environment (like ``HTTP_HOST``) and yield a sequence of those (header_name, value) tuples. """ # @@: Maybe should parse out comma-separated headers? for cgi_var, value in environ.iteritems(): if cgi_var in _parse_headers_special: yield _parse_headers_special[cgi... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def __init__(self, func): self.fn = func self.result = None | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def __call__(self, *args): if not self.result: self.result = self.fn(*args) return self.result | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def __call__(self, *args): if not self.result: self.result = self.fn(*args) return self.result | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def __call__(self, *args): if not self.result: self.result = self.fn(*args) return self.result | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
""" | """ | def __call__(self, *args): if not self.result: self.result = self.fn(*args) return self.result | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py |
def __init__(self, environ): self.environ = environ | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
doc = """Host name provided in HTTP_HOST, with fall-back to SERVER_NAME""" def fget(self): return self.environ.get('HTTP_HOST', self.environ.get('SERVER_NAME')) | doc = textwrap.dedent("""\ Host name provided in HTTP_HOST, with fall-back to SERVER_NAME """) def fget(self): return self.environ.get('HTTP_HOST', self.environ.get('SERVER_NAME')) | def host(): doc = """Host name provided in HTTP_HOST, with fall-back to SERVER_NAME""" def fget(self): return self.environ.get('HTTP_HOST', self.environ.get('SERVER_NAME')) return locals() | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py |
def fget(self): return self.environ.get('HTTP_HOST', self.environ.get('SERVER_NAME')) | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
Dictionary-like object representing the QUERY_STRING parameters. Always present, if possibly empty. If the same key is present in the query string multiple times, it will be present as a list. | Dictionary-like object representing the QUERY_STRING parameters. Always present, if possibly empty. If the same key is present in the query string multiple times, it will be present as a list. | def get(): doc = textwrap.dedent("""\ Dictionary-like object representing the QUERY_STRING parameters. Always present, if possibly empty. | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py |
def fget(self): return parse_dict_querystring(self.environ) | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def post(): doc = textwrap.dedent("""\ Dictionary-like object representing the POST body. Most values are strings, but file uploads can be FieldStorage objects. If this is not a POST request, or the body is not encoded fields (e.g., an XMLRPC request) then this will be None. | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def fget(self): formvars = MultiDict() formvars.update(parse_formvars(self.environ, all_as_list=True, include_get_vars=False)) return formvars | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
Returns a list keyed by parameter location of all the values by that key in that parameter location | Returns a list keyed by parameter location of all the values by that key in that parameter location | def params(): doc = textwrap.dedent("""\ MultiDict of keys from POST, GET, URL dicts | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py |
def fget(self): pms = MultiDict() pms.update(self.post) pms.update(self.get) return pms | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
Return a plain dictionary representing any variables captured from the URL parsing (the parsed URL portion is in SCRIPT_NAME); frequently {}, but never None""") | Return a plain dictionary representing any variables captured from the URL parsing (the parsed URL portion is in SCRIPT_NAME); frequently {}, but never None""") | def urlvars(): doc = textwrap.dedent("""\ Return a plain dictionary representing any variables captured from the URL parsing (the parsed URL portion is in SCRIPT_NAME); frequently {}, but never None""") def fget(self): pass return locals() | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py |
def fget(self): pass | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def cookies(self): """Dictionary of cookies keyed by cookie name. Just a plain dictionary, may be empty but not None. """ pass | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def cookies(self): """Dictionary of cookies keyed by cookie name. Just a plain dictionary, may be empty but not None. """ pass | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def cookies(self): """Dictionary of cookies keyed by cookie name. Just a plain dictionary, may be empty but not None. """ pass | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def fget(self): pass | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
if domain: | if port: | def parse_path_expression(path): """ Parses a path expression like 'domain foobar.com port 20 /' or just '/foobar' for a path alone. Returns as an address that URLMap likes. """ parts = path.split() domain = port = path = None while parts: if parts[0] == 'domain': parts.pop(0) if not parts: raise ValueError("'domain' ... | a17e4499e635c9aa42a7640e45e1b959d0f0698d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a17e4499e635c9aa42a7640e45e1b959d0f0698d/urlmap.py |
def post(self, url, params=None, headers={}, extra_environ={}, | def post(self, url, params='', headers={}, extra_environ={}, | def post(self, url, params=None, headers={}, extra_environ={}, status=None, upload_files=None, expect_errors=False): """ Do a POST request. Very like the ``.get()`` method. ``params`` are put in the body of the request. | 9711dc495e0e1c8ff65de583a4dc35cd5b510cd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9711dc495e0e1c8ff65de583a4dc35cd5b510cd4/fixture.py |
href = urlparse.urljoin(self.request.url, href) | href = urlparse.urljoin(self.request.full_url, href) | def goto(self, href, method='get', **args): """ Go to the (potentially relative) link ``href``, using the given method (``'get'`` or ``'post'``) and any extra arguments you want to pass to the ``app.get()`` or ``app.post()`` methods. | ace1db2bf188c8778de1a561d369f8bc8ad895ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ace1db2bf188c8778de1a561d369f8bc8ad895ff/fixture.py |
start_response("200 OK", (('Content-Type', 'text/html'), ('Content-Length', len(content)))) | start_response("200 OK", [('Content-Type', 'text/html'), ('Content-Length', str(len(content)))]) | def __call__(self, environ, start_response): username = environ.get('REMOTE_USER','') if username: return self.application(environ, start_response) | 2f58f1ef3bdea56059da8713ec189151c0be2d2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/2f58f1ef3bdea56059da8713ec189151c0be2d2f/form.py |
if daemon_threads: server.daemon_threads = daemon_threads | if daemon_threads: server.daemon_threads = daemon_threads | def serve(application, host=None, port=None, handler=None, ssl_pem=None, ssl_context=None, server_version=None, protocol_version=None, start_loop=True, daemon_threads=None, socket_timeout=None, use_threadpool=True, threadpool_workers=10): """ Serves your ``application`` over HTTP(S) via WSGI interface ``host`` This i... | a28087bf30e4a136dd0d9b6b23f9d210f982c6d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a28087bf30e4a136dd0d9b6b23f9d210f982c6d7/httpserver.py |
status=None, time_request=False): | status=None): | def get(self, url, params=None, headers={}, status=None, time_request=False): if params: if isinstance(params, dict): params = urllib.urlencode(params) if '?' in url: url += '&' else: url += '?' url += params environ = self.make_environ() for header, value in headers.items(): environ['HTTP_%s' % header.replace('-', '_'... | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
return self.do_request(req, status=status, time_request=time_request) | return self.do_request(req, status=status) | def get(self, url, params=None, headers={}, status=None, time_request=False): if params: if isinstance(params, dict): params = urllib.urlencode(params) if '?' in url: url += '&' else: url += '?' url += params environ = self.make_environ() for header, value in headers.items(): environ['HTTP_%s' % header.replace('-', '_'... | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
upload_files=None, time_request=False): | upload_files=None): | def post(self, url, params=None, headers={}, status=None, upload_files=None, time_request=False): environ = self.make_environ() if params and isinstance(params, dict): params = urllib.urlencode(params) if upload_files: params = cgi.parse_qsl(params, keep_blank_values=True) content_type, params = self.encode_multipart( ... | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
return self.do_request(req, status=status, time_request=time_request) | return self.do_request(req, status=status) | def post(self, url, params=None, headers={}, status=None, upload_files=None, time_request=False): environ = self.make_environ() if params and isinstance(params, dict): params = urllib.urlencode(params) if upload_files: params = cgi.parse_qsl(params, keep_blank_values=True) content_type, params = self.encode_multipart( ... | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
def do_request(self, req, status, time_request): | def do_request(self, req, status): | def do_request(self, req, status, time_request): app = lint.middleware(self.app) old_stdout = sys.stdout out = StringIO() try: sys.stdout = out start_time = time.time() raw_res = wsgilib.raw_interactive(app, req.url, **req.environ) end_time = time.time() finally: sys.stdout = old_stdout sys.stderr.write(out.getvalue())... | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
res = self.make_response(raw_res) | res = self.make_response(raw_res, end_time - start_time) | def do_request(self, req, status, time_request): app = lint.middleware(self.app) old_stdout = sys.stdout out = StringIO() try: sys.stdout = out start_time = time.time() raw_res = wsgilib.raw_interactive(app, req.url, **req.environ) end_time = time.time() finally: sys.stdout = old_stdout sys.stderr.write(out.getvalue())... | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
if time_request: return end_time - start_time | if self.namespace is None: return res | def do_request(self, req, status, time_request): app = lint.middleware(self.app) old_stdout = sys.stdout out = StringIO() try: sys.stdout = out start_time = time.time() raw_res = wsgilib.raw_interactive(app, req.url, **req.environ) end_time = time.time() finally: sys.stdout = old_stdout sys.stderr.write(out.getvalue())... | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
def make_response(self, (status, headers, body, errors)): return TestResponse(self, status, headers, body, errors) | def make_response(self, (status, headers, body, errors), total_time): return TestResponse(self, status, headers, body, errors, total_time) | def make_response(self, (status, headers, body, errors)): return TestResponse(self, status, headers, body, errors) | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
def __init__(self, test_app, status, headers, body, errors): | def __init__(self, test_app, status, headers, body, errors, total_time): | def __init__(self, test_app, status, headers, body, errors): self.test_app = test_app self.status = int(status.split()[0]) self.full_status = status self.headers = headers self.body = body self.errors = errors self._normal_body = None | 90680266c6d4645d6a3382f7b4579f79f4757170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/90680266c6d4645d6a3382f7b4579f79f4757170/fixture.py |
status, headers, body = capture_output( | status, headers, body = intercept_output( | def replacement_app(environ, start_response): status, headers, body = capture_output( environ, application) content_type = header_value(headers, 'content-type') if (not content_type or not content_type.startswith('text/html')): return [body] body = re.sub(r'<.*?>', '', body) return [body] | bccb303376e5cc3485eea2d6cd6a7d2717ce48f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/bccb303376e5cc3485eea2d6cd6a7d2717ce48f0/wsgilib.py |
stacked._push_object(obj) | def replace(self, stacked, obj): """Replace the object referenced by a StackedObjectProxy with a different object | f4296cd9d5f89baae83c28cb191eebead3b8d0c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/f4296cd9d5f89baae83c28cb191eebead3b8d0c1/registry.py | |
pass | print_exception(exc_info[0], exc_info[1], exc_info[2], file=errors) | def start_response(status, headers, exc_info=None): if exc_info: try: if headers_sent: # Re-raise original exception only if headers sent raise exc_info[0], exc_info[1], exc_info[2] else: # We assume that the sender, who is probably setting # the headers a second time /w a 500 has produced # a more appropriate response... | 8fdf9d4aa02d01c741fb2d098b973000ae755ed2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8fdf9d4aa02d01c741fb2d098b973000ae755ed2/wsgilib.py |
if 'html' in environ.get('HTTP_ACCEPT',''): | if 'html' in environ.get('HTTP_ACCEPT','') or \ '*/*' in environ.get('HTTP_ACCEPT',''): | def wsgi_application(self, environ, start_response, exc_info=None): """ This exception as a WSGI application """ if self.headers: headers = list(self.headers) else: headers = [] if 'html' in environ.get('HTTP_ACCEPT',''): replace_header(headers, 'content-type', 'text/html') content = self.html(environ) else: replace_he... | 1759bc18bca0598598fe9cd82a1c061acd816f35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/1759bc18bca0598598fe9cd82a1c061acd816f35/httpexceptions.py |
self.app = app | self.application = app | def __init__(self, app, global_conf, session_type=NoDefault, cookie_name=NoDefault, **store_config ): self.app = app if session_type is NoDefault: session_type = global_conf.get('session_type', 'disk') self.session_type = session_type try: self.store_class, self.store_args = self.session_classes[self.session_type] exce... | f358f698f0cc6d4e3b706574585a6a37f306c68c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/f358f698f0cc6d4e3b706574585a6a37f306c68c/flup_session.py |
ok_callback() | if ok_callback: ok_callback() | def catch_errors(application, environ, start_response, error_callback, ok_callback=None): """ Runs the application, and returns the application iterator (which should be passed upstream). If an error occurs then error_callback will be called with exc_info as its sole argument. If no errors occur and ok_callback is gi... | cd8b29c2ae4be556b8ce9e6823b7bfb8d1cf8a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/cd8b29c2ae4be556b8ce9e6823b7bfb8d1cf8a08/wsgilib.py |
abs_regex = re.compile(r'^[a-zA-Z]:') | abs_regex = re.compile(r'^[a-zA-Z]+:') | def forward_to_wsgiapp(self, app): """ Forwards the request to the given WSGI application """ raise ForwardRequest(app) | e433e6949690a934c0a0d0465d5fe89a47ca14f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e433e6949690a934c0a0d0465d5fe89a47ca14f4/servlet.py |
status, headers, body = wsgilib.capture_output( environ, start_response, self.app) | status, headers, body = wsgilib.intercept_output( environ, self.app) | def __call__(self, environ, start_response): global _threadedprint_installed if environ.get('paste.testing'): # In a testing environment this interception isn't # useful: return self.app(environ, start_response) if not _threadedprint_installed: # @@: Not strictly threadsafe _threadedprint_installed = True threadedprint... | be2113b04b975e0d4833f5d2f45ddc64b3a30974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/be2113b04b975e0d4833f5d2f45ddc64b3a30974/printdebug.py |
..code-block:: Python | .. code-block:: Python | def error_response(environ, error_code, message, debug_message=None, __warn=True): """ Returns the status, headers, and body of an error response. Use like: ..code-block:: Python status, headers, body = wsgilib.error_response( '301 Moved Permanently', 'Moved to <a href="%s">%s</a>' % (url, url)) start_response(statu... | 166ed8176950c4be7c1cb1b9f4a97b158d1c5ede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/166ed8176950c4be7c1cb1b9f4a97b158d1c5ede/response.py |
def error_response(environ, error_code, message, debug_message=None, __warn=True): """ Returns the status, headers, and body of an error response. Use like: ..code-block:: Python status, headers, body = wsgilib.error_response( '301 Moved Permanently', 'Moved to <a href="%s">%s</a>' % (url, url)) start_response(statu... | 166ed8176950c4be7c1cb1b9f4a97b158d1c5ede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/166ed8176950c4be7c1cb1b9f4a97b158d1c5ede/response.py | ||
for name, value in req.environ['paste.testing_variables']: setattr(res, name, value) | def do_request(self, req, status): __tracebackhide__ = True if self.cookies: c = SimpleCookie() for name, value in self.cookies.items(): c[name] = value req.environ['HTTP_COOKIE'] = str(c).split(': ', 1)[1] req.environ['paste.testing'] = True req.environ['paste.testing_variables'] = {} app = lint.middleware(self.app) o... | 875104250ce32a74e693be4f65f8ce30162c3769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/875104250ce32a74e693be4f65f8ce30162c3769/fixture.py | |
', '.join(map(repr, matches))) | ',\n '.join(map(repr, matches))) | def not_found_app(self, environ, start_response): mapper = environ.get('paste.urlmap_object') if mapper: matches = [p for p, a in mapper.applications] extra = 'defined apps: %s' % ( ', '.join(map(repr, matches))) else: extra = '' extra += '\nSCRIPT_NAME: %r' % environ.get('SCRIPT_NAME') extra += '\nPATH_INFO: %r' % env... | e1a052c802aecd7c328af246552be494d80c174d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e1a052c802aecd7c328af246552be494d80c174d/urlmap.py |
host = host.split(':', 1)[0] | host, port = host.split(':', 1)[0] else: if environ['wsgi.url_scheme'] == 'http': port = '80' else: port = '443' | def __call__(self, environ, start_response): host = environ.get('HTTP_HOST', environ.get('SERVER_NAME')).lower() if ':' in host: host = host.split(':', 1)[0] path_info = environ.get('PATH_INFO') path_info = self.normalize_url(path_info, False)[1] for (domain, app_url), app in self.applications: if domain and domain != ... | e1a052c802aecd7c328af246552be494d80c174d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e1a052c802aecd7c328af246552be494d80c174d/urlmap.py |
if domain and domain != host: | if domain and domain != host and domain != host+':'+port: | def __call__(self, environ, start_response): host = environ.get('HTTP_HOST', environ.get('SERVER_NAME')).lower() if ':' in host: host = host.split(':', 1)[0] path_info = environ.get('PATH_INFO') path_info = self.normalize_url(path_info, False)[1] for (domain, app_url), app in self.applications: if domain and domain != ... | e1a052c802aecd7c328af246552be494d80c174d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e1a052c802aecd7c328af246552be494d80c174d/urlmap.py |
cache_max_age=None): if os.path.sep != '/': directory = directory.replace(os.path.sep, '/') self.directory = directory | cache_max_age=None, index_files=None): self.index_files = index_files if self.index_files is None: self.index_files = ['index.html'] self.directory = os.path.normpath(directory).replace(os.path.sep, '/') | def __init__(self, directory, root_directory=None, cache_max_age=None): if os.path.sep != '/': directory = directory.replace(os.path.sep, '/') self.directory = directory self.root_directory = root_directory if root_directory is not None: self.root_directory = os.path.normpath(self.root_directory) else: self.root_direct... | 8cffe1f939f176ec34eabf176f4e9ed96aa58cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8cffe1f939f176ec34eabf176f4e9ed96aa58cb2/urlparser.py |
self.root_directory = os.path.normpath(self.root_directory) else: self.root_directory = directory | self.root_directory = os.path.normpath(self.root_directory).replace(os.path.sep, '/') else: self.root_directory = self.directory | def __init__(self, directory, root_directory=None, cache_max_age=None): if os.path.sep != '/': directory = directory.replace(os.path.sep, '/') self.directory = directory self.root_directory = root_directory if root_directory is not None: self.root_directory = os.path.normpath(self.root_directory) else: self.root_direct... | 8cffe1f939f176ec34eabf176f4e9ed96aa58cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8cffe1f939f176ec34eabf176f4e9ed96aa58cb2/urlparser.py |
if os.path.sep != '/': directory = directory.replace('/', os.path.sep) self.root_directory = self.root_directory.replace('/', os.path.sep) | def __init__(self, directory, root_directory=None, cache_max_age=None): if os.path.sep != '/': directory = directory.replace(os.path.sep, '/') self.directory = directory self.root_directory = root_directory if root_directory is not None: self.root_directory = os.path.normpath(self.root_directory) else: self.root_direct... | 8cffe1f939f176ec34eabf176f4e9ed96aa58cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8cffe1f939f176ec34eabf176f4e9ed96aa58cb2/urlparser.py | |
if path_info == '/': filename = 'index.html' else: filename = request.path_info_pop(environ) full = os.path.normpath(os.path.join(self.directory, filename)) if os.path.sep != '/': full = full.replace('/', os.path.sep) if self.root_directory is not None and not full.startswith(self.root_directory): return self.not_fou... | if '/../' in path_info: start_response('400 Bad Request', headers) return [''] full = self.directory + path_info | def __call__(self, environ, start_response): path_info = environ.get('PATH_INFO', '') if not path_info: return self.add_slash(environ, start_response) if path_info == '/': # @@: This should obviously be configurable filename = 'index.html' else: filename = request.path_info_pop(environ) full = os.path.normpath(os.path.... | 8cffe1f939f176ec34eabf176f4e9ed96aa58cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8cffe1f939f176ec34eabf176f4e9ed96aa58cb2/urlparser.py |
child_root = self.root_directory is not None and \ self.root_directory or self.directory return self.__class__(full, root_directory=child_root, cache_max_age=self.cache_max_age)(environ, start_response) if environ.get('PATH_INFO') and environ.get('PATH_INFO') != '/': return self.error_extra_path(environ, start_respons... | for file in self.index_files: full = os.path.normpath(os.path.join(full, file)).replace(os.path.sep, '/') if not os.path.exists(full): return self.no_index(environ, start_response) elif os.path.isdir(full): return self.not_found(environ, start_response) else: break | def __call__(self, environ, start_response): path_info = environ.get('PATH_INFO', '') if not path_info: return self.add_slash(environ, start_response) if path_info == '/': # @@: This should obviously be configurable filename = 'index.html' else: filename = request.path_info_pop(environ) full = os.path.normpath(os.path.... | 8cffe1f939f176ec34eabf176f4e9ed96aa58cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8cffe1f939f176ec34eabf176f4e9ed96aa58cb2/urlparser.py |
def __call__(self, environ, start_response): path_info = environ.get('PATH_INFO', '') if not path_info: return self.add_slash(environ, start_response) if path_info == '/': # @@: This should obviously be configurable filename = 'index.html' else: filename = request.path_info_pop(environ) full = os.path.normpath(os.path.... | 8cffe1f939f176ec34eabf176f4e9ed96aa58cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8cffe1f939f176ec34eabf176f4e9ed96aa58cb2/urlparser.py | ||
def __call__(self, environ, start_response): path_info = environ.get('PATH_INFO', '') if not path_info: return self.add_slash(environ, start_response) if path_info == '/': # @@: This should obviously be configurable filename = 'index.html' else: filename = request.path_info_pop(environ) full = os.path.normpath(os.path.... | 8cffe1f939f176ec34eabf176f4e9ed96aa58cb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8cffe1f939f176ec34eabf176f4e9ed96aa58cb2/urlparser.py | ||
if ';' in value: value = value.split(';', 1)[0] | def parse(self, *args, **kwargs): """ return the time value (in seconds since 1970) """ value = self.__call__(*args, **kwargs) if ';' in value: value = value.split(';', 1)[0] if value: try: return mktime_tz(parsedate_tz(value)) except TypeError: raise HTTPBadRequest(( "Received an ill-formed timestamp for %s: %s\r\n") ... | bdd29963acb62b3770e0fd7cf85109843afc77fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/bdd29963acb62b3770e0fd7cf85109843afc77fd/httpheaders.py | |
else: return None | def parse(self, *args, **kwargs): """ return the time value (in seconds since 1970) """ value = self.__call__(*args, **kwargs) if ';' in value: value = value.split(';', 1)[0] if value: try: return mktime_tz(parsedate_tz(value)) except TypeError: raise HTTPBadRequest(( "Received an ill-formed timestamp for %s: %s\r\n") ... | bdd29963acb62b3770e0fd7cf85109843afc77fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/bdd29963acb62b3770e0fd7cf85109843afc77fd/httpheaders.py | |
return _DateHeader.__call__(self, *args, **kwargs).split(';')[0] | return _DateHeader.__call__(self, *args, **kwargs).split(';', 1)[0] | def __call__(self, *args, **kwargs): """ Split the value on ';' incase the header includes extra attributes. E.g. IE 6 is known to send: If-Modified-Since: Sun, 25 Jun 2006 20:36:35 GMT; length=1506 """ return _DateHeader.__call__(self, *args, **kwargs).split(';')[0] | bdd29963acb62b3770e0fd7cf85109843afc77fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/bdd29963acb62b3770e0fd7cf85109843afc77fd/httpheaders.py |
return self.init_module.application | return self.init_module.application, None | def find_application(self, environ): if (self.init_module and getattr(self.init_module, 'application', None) and not environ.get('paste.urlparser.init_application') == environ['SCRIPT_NAME']): environ['paste.urlparser.init_application'] = environ['SCRIPT_NAME'] return self.init_module.application name, rest_of_path = w... | 3bd7a262a1951091200b06a0628a0676a711beaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3bd7a262a1951091200b06a0628a0676a711beaf/urlparser.py |
if global_conf.has_key('debug') and global_conf['debug'].lower() == 'true': self.debug = True else: self.debug = False | self.debug = converters.asbool(global_conf.get('debug')) | def __init__(self, app, mapper, global_conf=None, **params): if global_conf is None: global_conf = {} if global_conf.has_key('debug') and global_conf['debug'].lower() == 'true': self.debug = True else: self.debug = False self.application = app self.mapper = mapper self.global_conf = global_conf self.params = params | ae2dcd6736b93c93feced935239465ba4835bd4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ae2dcd6736b93c93feced935239465ba4835bd4c/errordocument.py |
print k, key | def wsgi_setup(self, environ=None): """ Setup the member variables used by this WSGI mixin, including the ``environ`` and status member variables. | f7d213a4797501428ba8f9d4d43a4dc002c2e6ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/f7d213a4797501428ba8f9d4d43a4dc002c2e6ad/httpserver.py | |
filename = file_info[2] | filename = file_info[1] | def _get_file_info(self, file_info): if len(file_info) == 2: # It only has a filename filename = file_info[2] if self.relative_to: filename = os.path.join(self.relative_to, filename) f = open(filename, 'rb') content = f.read() f.close() return (file_info[0], filename, content) elif len(file_info) == 3: return file_info... | c360229f755335aeac72a3f4e6c8a6fc6371de33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c360229f755335aeac72a3f4e6c8a6fc6371de33/fixture.py |
data_files=get_data_files(os.path.join("paste","app_templates")) + | data_files=get_data_files(os.path.join("paste","app_templates")) + get_data_files(os.path.join("paste", "frameworks")) + | def get_data_files(path, files = []): l = [] for name in os.listdir(path): if name[0] == ".": continue relpath = os.path.join(path, name) f = os.path.join(BASEDIR, relpath) if os.path.isdir(f): get_data_files(relpath, files) elif os.path.isfile(f): l.append(f) pref = sysconfig.get_python_lib()[len(sysconfig.PREFIX) + 1... | b8a25abb9db64912b3b3b13efd308267d9d65068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b8a25abb9db64912b3b3b13efd308267d9d65068/setup.py |
path = environ['REQUEST_URI'][len(prefix):] | path = environ['REQUEST_URI'][len(prefix):].split('?', 1)[0] | def handle_connection(self, conn): """ Handle an individual connection. """ input = conn.makefile("r") output = conn.makefile("w") | 8df0c351d245a13e9dd222d7e7f5c0552bb71b16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8df0c351d245a13e9dd222d7e7f5c0552bb71b16/scgiserver.py |
<<<<<<< .working class HTTPConflict(HTTPException): ======= | def html(self, environ): """ text/html representation of the exception """ return '' | 255773b152c67560628a1908478d7fbd32c49d9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/255773b152c67560628a1908478d7fbd32c49d9b/httpexceptions.py | |
>>>>>>> .merge-right.r4008 | def html(self, environ): """ text/html representation of the exception """ return '' | 255773b152c67560628a1908478d7fbd32c49d9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/255773b152c67560628a1908478d7fbd32c49d9b/httpexceptions.py | |
<<<<<<< .working class HTTPNotImplemented(HTTPException): code = 501 ======= | def html(self, environ): """ text/html representation of the exception """ return '' | 255773b152c67560628a1908478d7fbd32c49d9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/255773b152c67560628a1908478d7fbd32c49d9b/httpexceptions.py | |
>>>>>>> .merge-right.r4008 | def html(self, environ): """ text/html representation of the exception """ return '' | 255773b152c67560628a1908478d7fbd32c49d9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/255773b152c67560628a1908478d7fbd32c49d9b/httpexceptions.py | |
local_dict()[self._local_key] = [] | def __init__(self): self._constructor_lock.acquire() try: self.dispatching_id = 0 while 1: self._local_key = 'paste.processconfig_%i' % self.dispatching_id if not local_dict().has_key(self._local_key): break self.dispatching_id += 1 finally: self._constructor_lock.release() local_dict()[self._local_key] = [] self._proc... | 2a6b59d710286b6900226cbf36490d36a12a8e28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/2a6b59d710286b6900226cbf36490d36a12a8e28/pyconfig.py | |
local_dict()[self._local_key].append(conf) | local_dict().setdefault(self._local_key, []).append(conf) | def push_thread_config(self, conf): """ Make ``conf`` the active configuration for this thread. Thread-local configuration always overrides process-wide configuration. | 2a6b59d710286b6900226cbf36490d36a12a8e28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/2a6b59d710286b6900226cbf36490d36a12a8e28/pyconfig.py |
class Request(object): """Request API Object | class WSGIRequest(object): """WSGI Request API Object | def __call__(self, *args): if not self.result: self.result = self.fn(*args) return self.result | 3c849e8128435ab4962e0dde8e1189832df4a388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3c849e8128435ab4962e0dde8e1189832df4a388/request.py |
_explicit_re = re.compile(r'<pre\s*[^>]*id="paste.debug.prints".*?>', | _explicit_re = re.compile(r'<pre\s*[^>]*id="paste-debug-prints".*?>', | def remove_printdebug(): removed.append(None) | e9332375895886dbdc0955fd430dad6c568227ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e9332375895886dbdc0955fd430dad6c568227ea/prints.py |
pms.update(self.post) pms.update(self.get) | pms.update(self.POST) pms.update(self.GET) | def params(self): """MultiDict of keys from POST, GET, URL dicts | edb409f75c6a013eb90ed1d3a0afe5b18d2a755d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/edb409f75c6a013eb90ed1d3a0afe5b18d2a755d/request.py |
elif client_clock <= self.last_modified: | elif client_clock >= int(self.last_modified): | def __call__(self, environ, start_response): headers = self.headers[:] if self.expires is not None: replace_header(headers,'expires', formatdate(time.time()+self.expires)) | 60714441369b53b6db6a83ae4c92c7f9eb281fc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/60714441369b53b6db6a83ae4c92c7f9eb281fc0/fileapp.py |
assert start_response_started, ( "The application returned, but did not call start_response()") | def start_response_wrapper(*args, **kw): assert len(args) == 2 or len(args) == 3, ( "Invalid number of arguments: %s" % args) assert not kw, "No keyword arguments allowed" status = args[0] headers = args[1] if len(args) == 3: exc_info = args[2] else: exc_info = None | c58a48970db97621cfb47e2d7d6545518b3ddfac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c58a48970db97621cfb47e2d7d6545518b3ddfac/lint.py | |
return IteratorWrapper(iterator) | return IteratorWrapper(iterator, start_response_started) | def start_response_wrapper(*args, **kw): assert len(args) == 2 or len(args) == 3, ( "Invalid number of arguments: %s" % args) assert not kw, "No keyword arguments allowed" status = args[0] headers = args[1] if len(args) == 3: exc_info = args[2] else: exc_info = None | c58a48970db97621cfb47e2d7d6545518b3ddfac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c58a48970db97621cfb47e2d7d6545518b3ddfac/lint.py |
def __init__(self, wsgi_iterator): | def __init__(self, wsgi_iterator, check_start_response): | def __init__(self, wsgi_iterator): self.original_iterator = wsgi_iterator self.iterator = iter(wsgi_iterator) self.closed = False | c58a48970db97621cfb47e2d7d6545518b3ddfac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c58a48970db97621cfb47e2d7d6545518b3ddfac/lint.py |
return self.iterator.next() | v = self.iterator.next() if self.check_start_response is not None: assert self.check_start_response, ( "The application returns and we started iterating over its body, but start_response has not yet been called") self.check_start_response = None return v | def next(self): assert not self.closed, ( "Iterator read after closed") return self.iterator.next() | c58a48970db97621cfb47e2d7d6545518b3ddfac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c58a48970db97621cfb47e2d7d6545518b3ddfac/lint.py |
This an optional SSL certificate file (via OpenSSL) You can | This an optional SSL certificate file (via OpenSSL). You can | def serve(application, host=None, port=None, handler=None, ssl_pem=None, server_version=None, protocol_version=None, start_loop=True, daemon_threads=None, socket_timeout=None, use_threadpool=True, threadpool_workers=10): """ Serves your ``application`` over HTTP(S) via WSGI interface ``host`` This is the ipaddress to... | b98dfaebe1a1893a07230b798c4f873343aaf1d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b98dfaebe1a1893a07230b798c4f873343aaf1d6/httpserver.py |
return output | return output.write | def replacement_start_response(status, headers, exc_info=None): data.append(status) data.append(headers) start_response(status, headers, exc_info) return output | edb06112feb3a02cce6f39cd08c0e7c41280c39c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/edb06112feb3a02cce6f39cd08c0e7c41280c39c/wsgilib.py |
return StatusKeeper(app, status='404 Not Found', url='/error') | return StatusKeeper(app, status='404 Not Found', url='/error', headers=[]) | def factory(app): return StatusKeeper(app, status='404 Not Found', url='/error') | c80f470920306b5f75202ff24cba18ee300a649f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c80f470920306b5f75202ff24cba18ee300a649f/test_recursive.py |
return_error = error_template( error_message or ''' | msg = error_message or ''' | def handle_exception(exc_info, error_stream, html=True, debug_mode=False, error_email=None, error_log=None, show_exceptions_in_wsgi_errors=False, error_email_from='errors@localhost', smtp_server='localhost', error_subject_prefix='', error_message=None, ): """ For exception handling outside of a web context Use like:: ... | eb2983924feafcde2d6b938ec544eeb87f514d6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/eb2983924feafcde2d6b938ec544eeb87f514d6c/errormiddleware.py |
''', '') | ''' return_error = error_template('', error_message, '') | def handle_exception(exc_info, error_stream, html=True, debug_mode=False, error_email=None, error_log=None, show_exceptions_in_wsgi_errors=False, error_email_from='errors@localhost', smtp_server='localhost', error_subject_prefix='', error_message=None, ): """ For exception handling outside of a web context Use like:: ... | eb2983924feafcde2d6b938ec544eeb87f514d6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/eb2983924feafcde2d6b938ec544eeb87f514d6c/errormiddleware.py |
host, port = host.split(':', 1)[0] | host, port = host.split(':', 1) | def __call__(self, environ, start_response): host = environ.get('HTTP_HOST', environ.get('SERVER_NAME')).lower() if ':' in host: host, port = host.split(':', 1)[0] else: if environ['wsgi.url_scheme'] == 'http': port = '80' else: port = '443' path_info = environ.get('PATH_INFO') path_info = self.normalize_url(path_info,... | 809b470453c2bc265c30a61f71df00a54564fbc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/809b470453c2bc265c30a61f71df00a54564fbc5/urlmap.py |
status = '200 OK' headers = [] import pprint pprint.pprint(cgi_environ) | def __call__(self, environ, start_response): if 'REQUEST_URI' not in environ: environ['REQUEST_URI'] = ( environ.get('SCRIPT_NAME', '') + environ.get('PATH_INFO', '')) if self.include_os_environ: cgi_environ = os.environ.copy() else: cgi_environ = {} for name in environ: # Should unicode values be encoded? if (name.upp... | 010356214da34f3e88fe1150653f33dc5c45e3af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/010356214da34f3e88fe1150653f33dc5c45e3af/cgiapp.py | |
//var jsolait = importModule("jsolait"); //jsolait.baseURL = "%(lib)s"; //jsolait.libURL = "%(jsolaitURL)s"; | jsolait.baseURL = "%(lib)s"; jsolait.libURL = "%(jsolaitURL)s"; | def jsonjs(self): env = self.servlet().request().environ() jsolaitURL = self.jsolaitURL lib = self.libURL here = wsgilib.construct_url(env, False) here += '?_action_=jsonaction'; if self.baseConfig: app_base = env['%s.base_url' % self.baseConfig] if not jsolaitURL.startswith('/'): jsolaitURL = app_base + '/' + jsolaitU... | c9c15334756421fdd7338848410e86ceab112912 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c9c15334756421fdd7338848410e86ceab112912/jsoncomponent.py |
sys.exit(server.run_commandline(self.args)) | sys.exit(server.run_server(conf, self.app)) | def command(self): conf = self.config verbose = conf.get('verbose') or 0 if conf.get('daemon'): # We must enter daemon mode! if verbose > 1: print 'Entering daemon mode' pid = os.fork() if pid: sys.exit() # Always record PID and output when daemonized if not conf.get('pid_file'): conf['pid_file'] = 'server.pid' if not ... | dac7a940c7ee6eec8520bc85667733a23f08bf0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/dac7a940c7ee6eec8520bc85667733a23f08bf0b/app_setup.py |
return self.find_method(servlet, *args, **kw) | result = self.find_method(servlet, *args, **kw) if result is None: return event.Continue else: return result | def respond_event(self, name, servlet, *args, **kw): if name == 'end_awake': return self.find_method(servlet, *args, **kw) return event.Continue | 0ad1d06afdb557bc633cee847d518570970947d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ad1d06afdb557bc633cee847d518570970947d4/dispatch.py |
try: return action, getattr(servlet, action) except AttributeError: pass | def get_method(self, servlet, action): try: return action, getattr(servlet, action) except AttributeError: pass if self.prefix: try: return (self.prefix + action, getattr(servlet, self.prefix + action)) except AttributeError: pass return None, None | 0ad1d06afdb557bc633cee847d518570970947d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ad1d06afdb557bc633cee847d518570970947d4/dispatch.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.