rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
return self.do_verify() | return self.do_verify(request) | def __call__(self, environ, start_response): if environ['PATH_INFO'].startswith(self.auth_prefix): self.environ = environ self.start = start_response self.body = [] self.base_url = request.construct_url(environ, with_path_info=False, with_query_string=False) path = re.sub(self.auth_prefix, '', environ['PATH_INFO']) se... | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
return self.do_process() | return self.do_process(request) | def __call__(self, environ, start_response): if environ['PATH_INFO'].startswith(self.auth_prefix): self.environ = environ self.start = start_response self.body = [] self.base_url = request.construct_url(environ, with_path_info=False, with_query_string=False) path = re.sub(self.auth_prefix, '', environ['PATH_INFO']) se... | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
return self.not_found() | return self.not_found(request) | def __call__(self, environ, start_response): if environ['PATH_INFO'].startswith(self.auth_prefix): self.environ = environ self.start = start_response self.body = [] self.base_url = request.construct_url(environ, with_path_info=False, with_query_string=False) path = re.sub(self.auth_prefix, '', environ['PATH_INFO']) se... | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
def do_verify(self): | def do_verify(self, request): | def do_verify(self): """Process the form submission, initating OpenID verification. """ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
openid_url = self.query.get('openid_url') | openid_url = request['query'].get('openid_url') | def do_verify(self): """Process the form submission, initating OpenID verification. """ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
return self.render('Enter an identity URL to verify.', | return self.render(request, 'Enter an identity URL to verify.', | def do_verify(self): """Process the form submission, initating OpenID verification. """ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
self.render(message, css_class='error', form_contents=openid_url) | self.render(request, message, css_class='error', form_contents=openid_url) | def do_verify(self): """Process the form submission, initating OpenID verification. """ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
return_to = self.build_url('process', token=info.token) | return_to = self.build_url(request, 'process', token=info.token) | def do_verify(self): """Process the form submission, initating OpenID verification. """ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
info, return_to, trust_root=self.base_url) | info, return_to, trust_root=request['base_url']) | def do_verify(self): """Process the form submission, initating OpenID verification. """ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
return self.redirect(redirect_url) | return self.redirect(request, redirect_url) | def do_verify(self): """Process the form submission, initating OpenID verification. """ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
def do_process(self): | def do_process(self, request): | def do_process(self): """Handle the redirect from the OpenID server. """ oidconsumer = self.oidconsumer | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
token = self.query.get('token', '') | token = request['query'].get('token', '') | def do_process(self): """Handle the redirect from the OpenID server. """ oidconsumer = self.oidconsumer | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
status, info = oidconsumer.completeAuth(token, self.query) | status, info = oidconsumer.completeAuth(token, request['query']) | def do_process(self): """Handle the redirect from the OpenID server. """ oidconsumer = self.oidconsumer | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
self.environ['paste.auth.open_id'] = openid_url self.environ['PATH_INFO'] = self.login_redirect return self.app(self.environ, self.start) | request['environ']['paste.auth.open_id'] = openid_url request['environ']['PATH_INFO'] = self.login_redirect return self.app(request['environ'], request['start']) | def do_process(self): """Handle the redirect from the OpenID server. """ oidconsumer = self.oidconsumer | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
return self.render(message, css_class, openid_url) def build_url(self, action, **query): | return self.render(request, message, css_class, openid_url) def build_url(self, request, action, **query): | def do_process(self): """Handle the redirect from the OpenID server. """ oidconsumer = self.oidconsumer | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
base = urlparse.urljoin(self.base_url, self.auth_prefix + '/' + action) | base = urlparse.urljoin(request['base_url'], self.auth_prefix + '/' + action) | def build_url(self, action, **query): """Build a URL relative to the server base_url, with the given query parameters added.""" base = urlparse.urljoin(self.base_url, self.auth_prefix + '/' + action) return appendArgs(base, query) | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
def redirect(self, redirect_url): | def redirect(self, request, redirect_url): | def redirect(self, redirect_url): """Send a redirect response to the given URL to the browser.""" response_headers = [('Content-type', 'text/plain'), ('Location', redirect_url)] self.start('302 REDIRECT', response_headers) return ["Redirecting to %s" % redirect_url] | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
self.start('302 REDIRECT', response_headers) | request['start']('302 REDIRECT', response_headers) | def redirect(self, redirect_url): """Send a redirect response to the given URL to the browser.""" response_headers = [('Content-type', 'text/plain'), ('Location', redirect_url)] self.start('302 REDIRECT', response_headers) return ["Redirecting to %s" % redirect_url] | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
def not_found(self): | def not_found(self, request): | def not_found(self): """Render a page with a 404 return code and a message.""" fmt = 'The path <q>%s</q> was not understood by this server.' msg = fmt % (self.parsed_uri,) openid_url = self.query.get('openid_url') return self.render(msg, 'error', openid_url, status='404 Not Found') | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
msg = fmt % (self.parsed_uri,) openid_url = self.query.get('openid_url') return self.render(msg, 'error', openid_url, status='404 Not Found') def render(self, message=None, css_class='alert', form_contents=None, | msg = fmt % (request['parsed_uri'],) openid_url = request['query'].get('openid_url') return self.render(request, msg, 'error', openid_url, status='404 Not Found') def render(self, request, message=None, css_class='alert', form_contents=None, | def not_found(self): """Render a page with a 404 return code and a message.""" fmt = 'The path <q>%s</q> was not understood by this server.' msg = fmt % (self.parsed_uri,) openid_url = self.query.get('openid_url') return self.render(msg, 'error', openid_url, status='404 Not Found') | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
self.start(str(status), response_headers) self.page_header(title) | request['start'](str(status), response_headers) self.page_header(request, title) | def render(self, message=None, css_class='alert', form_contents=None, status='200 OK', title="Python OpenID Consumer"): """Render a page.""" response_headers = [('Content-type', 'text/html')] self.start(str(status), response_headers) | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
self.body.append("<div class='%s'>" % (css_class,)) self.body.append(message) self.body.append("</div>") self.page_footer(form_contents) return self.body def page_header(self, title): | request['body'].append("<div class='%s'>" % (css_class,)) request['body'].append(message) request['body'].append("</div>") self.page_footer(request, form_contents) return request['body'] def page_header(self, request, title): | def render(self, message=None, css_class='alert', form_contents=None, status='200 OK', title="Python OpenID Consumer"): """Render a page.""" response_headers = [('Content-type', 'text/html')] self.start(str(status), response_headers) | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
self.body.append('''\ | request['body'].append('''\ | def page_header(self, title): """Render the page header""" self.body.append('''\ | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
def page_footer(self, form_contents): | def page_footer(self, request, form_contents): | def page_footer(self, form_contents): """Render the page footer""" if not form_contents: form_contents = '' | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
self.body.append('''\ | request['body'].append('''\ | def page_footer(self, form_contents): """Render the page footer""" if not form_contents: form_contents = '' | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
''' % (quoteattr(self.build_url('verify')), quoteattr(form_contents))) | ''' % (quoteattr(self.build_url(request, 'verify')), quoteattr(form_contents))) | def page_footer(self, form_contents): """Render the page footer""" if not form_contents: form_contents = '' | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py |
'Content-type': 'text/html; charset=UTF-8'} | 'content-type': 'text/html; charset=UTF-8'} | def __call__(self, environ, start_response): value = event.raise_event('call', self, environ, start_response) if value is not event.Continue: status, headers, app_iter = value start_response(status, headers) return app_iter self.environ = environ self.config = self.environ['paste.config'] if self.config.get('app_name')... | 846cafa7a1a72b8503daa8e5d09afeedd5fc5087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/846cafa7a1a72b8503daa8e5d09afeedd5fc5087/servlet.py |
return self.__class__.__name__ | return self._title or self.__class__.__name__ | def title__get(self): return self.__class__.__name__ | 846cafa7a1a72b8503daa8e5d09afeedd5fc5087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/846cafa7a1a72b8503daa8e5d09afeedd5fc5087/servlet.py |
self.__dict__['title'] = value | self._title = value def html_title__get(self): return self._html_title or self.title def html_title__set(self, value): self._html_title = value | def title__set(self, value): # Get rid of the property: self.__dict__['title'] = value | 846cafa7a1a72b8503daa8e5d09afeedd5fc5087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/846cafa7a1a72b8503daa8e5d09afeedd5fc5087/servlet.py |
return_error = error_template('', error_message, '') | return_error = error_template('', msg, '') | 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, simple_html_error=False, ): """ For exception handling outside of a... | 5156901afef9e1b094efb93b3891d0a4f254471d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/5156901afef9e1b094efb93b3891d0a4f254471d/errormiddleware.py |
error = int(error.split(None, 1)) | error = int(error.split(None, 1)[0]) | def __init__(self, applications, catch=(404,)): self.apps = applications self.catch_codes = {} self.catch_exceptions = [] for error in catch: if isinstance(error, str): error = int(error.split(None, 1)) if isinstance(error, httpexceptions.HTTPException): exc = error code = error.code else: exc = httpexceptions.get_exce... | b83c69e90f4e9cec9e18b696bb0cd0ee9aed8c40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b83c69e90f4e9cec9e18b696bb0cd0ee9aed8c40/cascade.py |
"http://belnet.dl.sourceforge.net/sourceforge/zpt/ZopePageTemplates-1.4.0.tgz") | "http://easynews.dl.sourceforge.net/sourceforge/zpt/ZopePageTemplates-1.4.0.tgz") | def installer(name): mkdirs(THIRD + "/" + name +"-files") cmd = '%s setup.py install -f --install-lib="%s/%s-files" --install-scripts="%s/%s-files/scripts" --no-compile' % (sys.executable, THIRD, name, THIRD, name) print cmd os.system(cmd) | 29bf4ddaab19b025a044abb25c0ac813e413ef29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/29bf4ddaab19b025a044abb25c0ac813e413ef29/build-pkg.py |
field = self.fields.get(name) | field = fields.get(name) | def _parse_fields(self): in_select = None in_textarea = None fields = {} for match in self._tag_re.finditer(self.text): end = match.group(1) == '/' tag = match.group(2).lower() if tag not in ('input', 'select', 'option', 'textarea', 'button'): continue if tag == 'select' and end: assert in_select, ( '%r without startin... | 03bf64c259b577b956f1d1819f38f02a79cada16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/03bf64c259b577b956f1d1819f38f02a79cada16/fixture.py |
headers=[('location', url)]) | headers={'location', url}) | def add_slash(self, environ, start_response): """ This happens when you try to get to a directory without a trailing / """ url = request.construct_url(environ, with_query_string=False) url += '/' if environ.get('QUERY_STRING'): url += '?' + environ['QUERY_STRING'] exc = httpexceptions.HTTPMovedPermanently( 'The resourc... | fc605e07d5ee5c78907221560536057f6f6ce0c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/fc605e07d5ee5c78907221560536057f6f6ce0c7/urlparser.py |
headers=[('location', url)]) | headers={'location', url}) | def add_slash(self, environ, start_response): """ This happens when you try to get to a directory without a trailing / """ url = request.construct_url(environ, with_query_string=False) url += '/' if environ.get('QUERY_STRING'): url += '?' + environ['QUERY_STRING'] exc = httpexceptions.HTTPMovedPermanently( 'The resourc... | fc605e07d5ee5c78907221560536057f6f6ce0c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/fc605e07d5ee5c78907221560536057f6f6ce0c7/urlparser.py |
old_query_string = environ['QUERY_STRING'] | old_query_string = environ.get('QUERY_STRING','') | def parse_formvars(environ, include_get_vars=True): """Parses the request, returning a MultiDict of form variables. If ``include_get_vars`` is true then GET (query string) variables will also be folded into the MultiDict. All values should be strings, except for file uploads which are left as FieldStorage instances. ... | 73da204175f96d18d46aca536d0eae2a834feaaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/73da204175f96d18d46aca536d0eae2a834feaaf/request.py |
name, self.template_description().splitlines()[0]) | name, self.template_description(dir).splitlines()[0]) | def command(self): any = False app_template_dir = os.path.join(os.path.dirname(__file__), 'app_templates') for name in os.listdir(app_template_dir): dir = os.path.join(app_template_dir, name) if not os.path.exists(os.path.join(dir, 'description.txt')): if self.options.verbose >= 2: print 'Skipping %s (no description.tx... | 70b9f24913825d044637f53c0e835174337f6c02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/70b9f24913825d044637f53c0e835174337f6c02/app_setup.py |
self.name, self.template_description()) | self.name, self.template_description(dir)) | def command(self): any = False app_template_dir = os.path.join(os.path.dirname(__file__), 'app_templates') for name in os.listdir(app_template_dir): dir = os.path.join(app_template_dir, name) if not os.path.exists(os.path.join(dir, 'description.txt')): if self.options.verbose >= 2: print 'Skipping %s (no description.tx... | 70b9f24913825d044637f53c0e835174337f6c02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/70b9f24913825d044637f53c0e835174337f6c02/app_setup.py |
def template_description(self): f = open(os.path.join(self.template_dir, 'description.txt')) | def template_description(self, dir): f = open(os.path.join(dir, 'description.txt')) | def template_description(self): f = open(os.path.join(self.template_dir, 'description.txt')) content = f.read().strip() f.close() return content | 70b9f24913825d044637f53c0e835174337f6c02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/70b9f24913825d044637f53c0e835174337f6c02/app_setup.py |
body = "<html><body>simple</body></html>" start_response("200 OK",[('Content-Type','text/html'), ('Content-Length',len(body))]) | length = environ.get('CONTENT_LENGTH', 0) if length and int(length) > self.threshold: self.monitor.append(environ) environ[ENVIRON_RECEIVED] = 0 environ[REQUEST_STARTED] = time.time() environ[REQUEST_FINISHED] = None environ['wsgi.input'] = \ _ProgressFile(environ, environ['wsgi.input']) def finalizer(exc_info=None): ... | def __call__(self, environ, start_response): body = "<html><body>simple</body></html>" start_response("200 OK",[('Content-Type','text/html'), ('Content-Length',len(body))]) return [body] | dc894ac722676e3fe8d537e2a3ab6e790ae1c1d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/dc894ac722676e3fe8d537e2a3ab6e790ae1c1d9/progress.py |
class SlowConsumer: """ Consumes an upload slowly... NOTE: This should use the iterator form of ``wsgi.input``, but it isn't implemented in paste.httpserver. """ def __init__(self, chunk_size = 4096, delay = 1, progress = True): self.chunk_size = chunk_size self.delay = delay self.progress = True def __call__(self, e... | __all__ = ['UploadProgressMonitor','UploadProgressReporter'] if "__main__" == __name__: import doctest doctest.testmod(optionflags=doctest.ELLIPSIS) | def __call__(self, environ, start_response): body = "<html><body>simple</body></html>" start_response("200 OK",[('Content-Type','text/html'), ('Content-Length',len(body))]) return [body] | dc894ac722676e3fe8d537e2a3ab6e790ae1c1d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/dc894ac722676e3fe8d537e2a3ab6e790ae1c1d9/progress.py |
return self.catching_iter(app_iter, environ) | try: return_iter = list(app_iter) return return_iter finally: if hasattr(app_iter, 'close'): app_iter.close() | def detect_start_response(status, headers, exc_info=None): try: return start_response(status, headers, exc_info) except: raise else: started.append(True) | ee281af26cd9188d23f4d7f751921519cb469670 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ee281af26cd9188d23f4d7f751921519cb469670/middleware.py |
Example usage: | Example usage:: | def / name | 0c355755a16754a878c57de60c6029657c6b239e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0c355755a16754a878c57de60c6029657c6b239e/PySourceColor.py |
""" | doc = """ | def Usage(): """ ----------------------------------------------------------------------------- PySourceColor.py ver: %s ----------------------------------------------------------------------------- Module summary: This module is designed to colorize python source code. Input--->python source Output-->colorized (html, h... | 0c355755a16754a878c57de60c6029657c6b239e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0c355755a16754a878c57de60c6029657c6b239e/PySourceColor.py |
print Usage.__doc__% (__version__) | print doc % (__version__) | def Usage(): """ ----------------------------------------------------------------------------- PySourceColor.py ver: %s ----------------------------------------------------------------------------- Module summary: This module is designed to colorize python source code. Input--->python source Output-->colorized (html, h... | 0c355755a16754a878c57de60c6029657c6b239e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0c355755a16754a878c57de60c6029657c6b239e/PySourceColor.py |
def _doXHTMLEnd(self): self._doCSSEnd() | 0c355755a16754a878c57de60c6029657c6b239e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0c355755a16754a878c57de60c6029657c6b239e/PySourceColor.py | ||
newhead = '-'.join(x.capitalize() for x in \ key.replace("_","-").split("-")) | newhead = '-'.join([x.capitalize() for x in \ key.replace("_","-").split("-")]) | def normalize_headers(response_headers, strict=True): """ sort headers as suggested by RFC 2616 This alters the underlying response_headers to use the common name for each header; as well as sorting them with general headers first, followed by request/response headers, then entity headers, and unknown headers last. "... | 2bd7a5d077ef8c9312a9d7fd67a653b0383e0119 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/2bd7a5d077ef8c9312a9d7fd67a653b0383e0119/httpheaders.py |
else: del self.close | def next(self): try: return self.app_iter.next() except StopIteration: if self.ok_callback: self.ok_callback() raise except self.catch: if hasattr(self.app_iterable, 'close'): try: self.app_iterable.close() except: # @@: Print to wsgi.errors? pass new_app_iterable = self.error_callback_app( self.environ, self.start_res... | 0e33cee53efb869e4016725d1dd499352cdfea20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0e33cee53efb869e4016725d1dd499352cdfea20/wsgilib.py | |
'<a href="http://localhost/view" onclick="return prompt("\'Really?\'")">goto</a>' | '<a href="http://localhost/view" onclick="return prompt(\'Really?\')">goto</a>' | def _add_positional(self, args): raise NotImplementedError | 4da9ca1743657f83d661c34395210e4cb29d1e87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/4da9ca1743657f83d661c34395210e4cb29d1e87/url.py |
attrs.append(('onclick', 'return prompt(%r)' | attrs.append(('onclick', 'return prompt(%s)' | def _html_attrs(self): attrs = self.attrs.items() attrs.insert(0, ('href', self.href)) if self.params.get('confirm'): attrs.append(('onclick', 'return prompt(%r)' % js_repr(self.params['confirm']))) return attrs | 4da9ca1743657f83d661c34395210e4cb29d1e87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/4da9ca1743657f83d661c34395210e4cb29d1e87/url.py |
return 'location.href=%r; return false' % js_repr(self.href) | return 'location.href=%s; return false' % js_repr(self.href) | def onclick_goto__get(self): return 'location.href=%r; return false' % js_repr(self.href) | 4da9ca1743657f83d661c34395210e4cb29d1e87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/4da9ca1743657f83d661c34395210e4cb29d1e87/url.py |
print " from paste.cgiserver import run_with_cgi" print " run_with_cgi(app)" | print " from paste.servers.cgi_wsgi import run_with_cgi" print " run_with_cgi(app, redirect_stdout=True)" | def serve(conf, app): replacements = {} replacements['default_config_fn'] = os.path.abspath( server.default_config_fn) # Ideally, other_conf should be any options that came from the # command-line. # @@: This assumes too much about the ordering of namespaces. other_conf = dict(conf.namespaces[-2]) # Not a good idea to... | 64896ca3630dcf49070216e992498830037614bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/64896ca3630dcf49070216e992498830037614bf/cgi_server.py |
scgi_server.SCGIServer(SCGIAppHandler, port=port).serve() | kwargs = dict(handler_class=SCGIAppHandler) for kwarg in ('host', 'port', 'max_children'): if locals()[kwarg] is not None: kwargs[kwarg] = locals()[kwarg] scgi_server.SCGIServer(**kwargs).serve() | def __init__ (self, *args, **kwargs): self.prefix = prefix self.app_obj = application SWAP.__init__(self, *args, **kwargs) | 9faa38136f15f366ecee7d8471019410c0656c91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9faa38136f15f366ecee7d8471019410c0656c91/scgiserver.py |
if '?' in self.script: assert query_string is None, ( "You cannot have '?' in your script name (%r) and also " "give a query_string (%r)" % (self.script, query_string)) self.script, query_string = self.script.split('?', 1) | def __init__(self, script, path=None, include_os_environ=True, query_string=None): self.script_filename = script if isinstance(path, (str, unicode)): path = [path] if path is None: path = os.environ.get('PATH', '').split(':') self.path = path if os.path.abspath(script) != script: # relative path for path_dir in self.pa... | 22ea9a8bc503d9e0301483cb73605e014ea6e50a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/22ea9a8bc503d9e0301483cb73605e014ea6e50a/cgiapp.py | |
stdout=CGIWriter(environ, start_response), | stdout=writer, | 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... | 22ea9a8bc503d9e0301483cb73605e014ea6e50a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/22ea9a8bc503d9e0301483cb73605e014ea6e50a/cgiapp.py |
if var_value is not None: | if var_value is not None and var_value is not False: | def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None): """ Define a cookie to be sent via the outgoing HTTP headers """ self.cookies[key] = value for var_name, var_value in [ ('max_age', max_age), ('path', path), ('domain', domain), ('secure', secure), ('expires', expires)]... | 8f803009ec20ab226561ce8602f91894e631d63d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/8f803009ec20ab226561ce8602f91894e631d63d/wsgiwrappers.py |
'instead', DeprecationWarning, 1) | 'instead', DeprecationWarning, 2) | def error_body_response(error_code, message, __warn=True): """ Returns a standard HTML response page for an HTTP error. **Note:** Deprecated """ if __warn: warnings.warn( 'wsgilib.error_body_response is deprecated; use the ' 'wsgi_application method on an HTTPException object ' 'instead', DeprecationWarning, 1) return ... | b56c60ecfbea2c7c6d1b98972fd887d1bacd84d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b56c60ecfbea2c7c6d1b98972fd887d1bacd84d2/response.py |
'instead', DeprecationWarning, 1) | 'instead', DeprecationWarning, 2) | def error_response(environ, error_code, message, debug_message=None, __warn=True): """ Returns the status, headers, and body of an error response. Use like:: status, headers, body = wsgilib.error_response( '301 Moved Permanently', 'Moved to <a href="%s">%s</a>' % (url, url)) start_response(status, headers) return [bo... | b56c60ecfbea2c7c6d1b98972fd887d1bacd84d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b56c60ecfbea2c7c6d1b98972fd887d1bacd84d2/response.py |
return StaticURLParser(document_root, **kw) | return StaticURLParser( document_root, cache_max_age=cache_max_age) | def make_static(global_conf, document_root, cache_max_age=None): """ Return a WSGI application that serves a directory (configured with document_root) max_cache_age - integer specifies CACHE_CONTROL max_age in seconds """ if cache_max_age is not None: cache_max_age = int(cache_max_age) return StaticURLParser(document_... | c532e6754c366fd643f27a226b8812b252aea8f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/c532e6754c366fd643f27a226b8812b252aea8f2/urlparser.py |
list(app_iter) | def change_response(status, headers, exc_info=None): status_code = status.split(' ') try: code = int(status_code[0]) except ValueError, TypeError: raise Exception( 'StatusBasedForward middleware ' 'received an invalid status code %s'%repr(status_code[0]) ) message = ' '.join(status_code[1:]) new_url = self.mapper( cod... | 2476741eff1920c9216c32de8b4c82867f573da9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/2476741eff1920c9216c32de8b4c82867f573da9/errordocument.py | |
if self.debug: environ['wsgi.errors'].write( '=> paste.errordocuments: -> %r\n'%url[0][0] ) | def change_response(status, headers, exc_info=None): status_code = status.split(' ') try: code = int(status_code[0]) except ValueError, TypeError: raise Exception( 'StatusBasedForward middleware ' 'received an invalid status code %s'%repr(status_code[0]) ) message = ' '.join(status_code[1:]) new_url = self.mapper( cod... | 2476741eff1920c9216c32de8b4c82867f573da9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/2476741eff1920c9216c32de8b4c82867f573da9/errordocument.py | |
files = files or [] | if files is None: files = [] | def get_data_files(relpath, files=None): files = files or [] for name in os.listdir(os.path.join(BASEDIR, relpath)): if name.startswith("."): continue fn = os.path.join(relpath, name) if os.path.isdir(os.path.join(BASEDIR, fn)): get_data_files(fn, files) elif os.path.isfile(os.path.join(BASEDIR, fn)): files.append(fn) ... | 64bcaa6104b02f97c374c9e23ab1ae4fa9125ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/64bcaa6104b02f97c374c9e23ab1ae4fa9125ec1/setup.py |
def get_data_files(relpath, files=None): files = files or [] for name in os.listdir(os.path.join(BASEDIR, relpath)): if name.startswith("."): continue fn = os.path.join(relpath, name) if os.path.isdir(os.path.join(BASEDIR, fn)): get_data_files(fn, files) elif os.path.isfile(os.path.join(BASEDIR, fn)): files.append(fn) ... | 64bcaa6104b02f97c374c9e23ab1ae4fa9125ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/64bcaa6104b02f97c374c9e23ab1ae4fa9125ec1/setup.py | ||
self.headers = None | self.content_length = None | def __init__(self, start_response, compress_level): self.start_response = start_response self.compress_level = compress_level self.buffer = StringIO() self.compressible = False self.headers = None | e15dac39ee85511d92f0ed20179b501e859c0412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e15dac39ee85511d92f0ed20179b501e859c0412/gzipper.py |
return self.start_response(status, headers, exc_info) | remove_header(headers, 'content-length') self.headers = headers self.status = status return self.buffer.write | def gzip_start_response(self, status, headers, exc_info=None): self.headers = headers ct = header_value(headers,'content-type') ce = header_value(headers,'content-encoding') self.compressible = False if (ct.startswith('text') or ct.startswith('application')) \ and not 'z' in ct: self.compressible = True if ce: self.com... | e15dac39ee85511d92f0ed20179b501e859c0412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e15dac39ee85511d92f0ed20179b501e859c0412/gzipper.py |
if self.compressible and self.headers is not None: CONTENT_LENGTH.update(self.headers, str(len(s))) | def write(self): out = self.buffer out.seek(0) s = out.getvalue() out.close() if self.compressible and self.headers is not None: CONTENT_LENGTH.update(self.headers, str(len(s))) return [s] | e15dac39ee85511d92f0ed20179b501e859c0412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e15dac39ee85511d92f0ed20179b501e859c0412/gzipper.py | |
prefix = conf.get('scgi_prefix', '/') | prefix = conf.get('root_url', '') while prefix.endswith('/'): prefix = prefix[:-1] | def serve(conf, app): prefix = conf.get('scgi_prefix', '/') serve_application(app, prefix, port=int(conf.get('port', 4000))) | f2ab3ba8658a518976b34352a094aafc0e0348bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/f2ab3ba8658a518976b34352a094aafc0e0348bf/__init__.py |
setattr(self.current_obj(), name, value) | setattr(self.current_obj(), attr, value) | def __setattr__(self, attr, value): setattr(self.current_obj(), name, value) | fe2db6aaf64ce1085749123e690377ca5a993d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/fe2db6aaf64ce1085749123e690377ca5a993d5e/registry.py |
response = IncludedResponse | response = IncludedResponse() | def activate(self, environ): response = IncludedResponse def start_response(status, headers, exc_info=None): if exc_info: raise exc_info[0], exc_info[1], exc_info[2] response.status = status response.headers = headers return response.write app_iter = self.application(environ, start_response) try: for s in app_iter: res... | 767dc45a6585a8b9780a8e0936ab28e08e122e9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/767dc45a6585a8b9780a8e0936ab28e08e122e9b/recursive.py |
def write(self): | def write(self, s): | def write(self): assert self.output is not None, ( "This response has already been closed and no further data " "can be written.") self.output.write() | 767dc45a6585a8b9780a8e0936ab28e08e122e9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/767dc45a6585a8b9780a8e0936ab28e08e122e9b/recursive.py |
self.output.write() | self.output.write(s) | def write(self): assert self.output is not None, ( "This response has already been closed and no further data " "can be written.") self.output.write() | 767dc45a6585a8b9780a8e0936ab28e08e122e9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/767dc45a6585a8b9780a8e0936ab28e08e122e9b/recursive.py |
def forward(app, codes): for code in codes: if not isinstance(code, int): raise TypeError('All status codes should be type int. ' '%s is not valid'%repr(code)) def error_codes_mapper(code, message, environ, global_conf, codes): if codes.has_key(code): return codes[code] else: return None return custom_forward(app, erro... | def forward(app, codes): for code in codes: if not isinstance(code, int): raise TypeError('All status codes should be type int. ' '%s is not valid'%repr(code)) def error_codes_mapper(code, message, environ, global_conf, codes): if codes.has_key(code): return codes[code] else: return None return custom_forward(app, erro... | def forward(app, codes): for code in codes: if not isinstance(code, int): raise TypeError('All status codes should be type int. ' '%s is not valid'%repr(code)) def error_codes_mapper(code, message, environ, global_conf, codes): if codes.has_key(code): return codes[code] else: return None return custom_forward(app, erro... | 3e3fdd50bf8ecaa59f1aaba9d48581ae96b25d08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3e3fdd50bf8ecaa59f1aaba9d48581ae96b25d08/errordocument.py |
status, headers, body = capture_output( | status, headers, body = intercept_output( | def replacement_app(environ, start_response): status, headers, body = capture_output( environ, application, lambda s, h: header_value(headers, 'content-type').startswith('text/html'), start_response) if status is None: return body body = re.sub(r'<.*?>', '', body) return [body] | bf01f30f02cb313d69d20915b89677570be8f7be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/bf01f30f02cb313d69d20915b89677570be8f7be/wsgilib.py |
return self.environ.get('X-Requested-With', '') == 'XMLHttpRequest' | return self.environ.get('HTTP_X-Requested-With', '') == 'XMLHttpRequest' | def is_xhr(self): """Returns a boolean if X-Requested-With is present and a XMLHttpRequest""" return self.environ.get('X-Requested-With', '') == 'XMLHttpRequest' | 1467b13bf0decf227e7d7a2d0e55f9cb49eafe1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/1467b13bf0decf227e7d7a2d0e55f9cb49eafe1e/wsgiwrappers.py |
_start_re = re.compile(r'<div class=".*?" id="contents">') _end_re = re.compile(r'</div>[ \n]*</div>[ \n]*</body>') | _start_re = re.compile(r'<body>[ \n]*(?:<div.*?>[ \n]*)?<h1.*?>.*?</h1>') _end_re = re.compile(r'(?:</div>[ \n]*)?</div>[ \n]*</body>') | def read_properties(self): props = self.properties = {} m = self._title_re.search(self.html) if m: props['title'] = m.group(1) else: print 'No title in %s' % self.filename props['title'] = '' | 3add258f7f7efc57efe255e15b3fdd7dd2f73105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3add258f7f7efc57efe255e15b3fdd7dd2f73105/gensite.py |
self.not_found_application = self.not_found_app | if not not_found_app: not_found_app = self.not_found_app self.not_found_application = not_found_app | def __init__(self, not_found_app=None): self.applications = [] self.not_found_application = self.not_found_app | 6d85a0ed7c0da7ebdc2da58d7e9b53f872537eab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/6d85a0ed7c0da7ebdc2da58d7e9b53f872537eab/urlmap.py |
for header, value in res.getheaders(): | for full_header in res.msg.headers: header, value = full_header.split(':', 1) value = value.strip() | def __call__(self, environ, start_response): if (self.allowed_request_methods and environ['REQUEST_METHOD'].lower() not in self.allowed_request_methods): return httpexceptions.HTTPBadRequest("Disallowed")(environ, start_response) | 0ca93d70f7a558f7c4026c1e40326b7b29552838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ca93d70f7a558f7c4026c1e40326b7b29552838/proxy.py |
for header, value in res.getheaders(): | for full_header in res.msg.headers: header, value = full_header.split(':', 1) value = value.strip() | def __call__(self, environ, start_response): scheme = environ['wsgi.url_scheme'] if self.force_host is None: conn_scheme = scheme else: conn_scheme = self.force_scheme if conn_scheme == 'http': ConnClass = httplib.HTTPConnection elif conn_scheme == 'https': ConnClass = httplib.HTTPSConnection else: raise ValueError( "U... | 0ca93d70f7a558f7c4026c1e40326b7b29552838 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0ca93d70f7a558f7c4026c1e40326b7b29552838/proxy.py |
headertable = someheaderdict | headertable = {} | def headers(self): """Access to incoming headers""" # @@ Just needs a header table object headertable = someheaderdict for key in self.environ.keys(): if key.startswith('HTTP'): headertable.add(key[5:], self.environ[key]) return headertable | 749cf50573644039d6ab53524d2791c71bfb944c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/749cf50573644039d6ab53524d2791c71bfb944c/request.py |
headertable.add(key[5:], self.environ[key]) | headertable[key[5:]] = self.environ[key] | def headers(self): """Access to incoming headers""" # @@ Just needs a header table object headertable = someheaderdict for key in self.environ.keys(): if key.startswith('HTTP'): headertable.add(key[5:], self.environ[key]) return headertable | 749cf50573644039d6ab53524d2791c71bfb944c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/749cf50573644039d6ab53524d2791c71bfb944c/request.py |
headers = property(headers, doc=headers.__doc__) | headers = property(LazyCache(headers), doc=headers.__doc__) | def headers(self): """Access to incoming headers""" # @@ Just needs a header table object headertable = someheaderdict for key in self.environ.keys(): if key.startswith('HTTP'): headertable.add(key[5:], self.environ[key]) return headertable | 749cf50573644039d6ab53524d2791c71bfb944c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/749cf50573644039d6ab53524d2791c71bfb944c/request.py |
attrs.get('selected'))) | 'selected' in attrs)) | def _parse_fields(self): in_select = None in_textarea = None fields = {} for match in self._tag_re.finditer(self.text): end = match.group(1) == '/' tag = match.group(2).lower() if tag not in ('input', 'select', 'option', 'textarea', 'button'): continue if tag == 'select' and end: assert in_select, ( '%r without startin... | 432911801f6818ab713efb8f31e3d3411a6cd046 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/432911801f6818ab713efb8f31e3d3411a6cd046/fixture.py |
attrs.get('checked'))) | 'checked' in attrs)) | def _parse_fields(self): in_select = None in_textarea = None fields = {} for match in self._tag_re.finditer(self.text): end = match.group(1) == '/' tag = match.group(2).lower() if tag not in ('input', 'select', 'option', 'textarea', 'button'): continue if tag == 'select' and end: assert in_select, ( '%r without startin... | 432911801f6818ab713efb8f31e3d3411a6cd046 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/432911801f6818ab713efb8f31e3d3411a6cd046/fixture.py |
_attr_re = re.compile(r'([^= \n\r\t]*)[ \n\r\t]*=[ \n\r\t]*(?:"([^"]*)"|([^"][^ \n\r\t>]*))', re.S) | _attr_re = re.compile(r'([^= \n\r\t]+)[ \n\r\t]*(?:=[ \n\r\t]*(?:"([^"]*)"|([^"][^ \n\r\t>]*)))?', re.S) | def submit_fields(self, name=None, index=None): """ Return a list of ``[(name, value), ...]`` for the current state of the form. """ submit = [] if name is not None: field = self.get(name, index=index) submit.append((field.name, field.value_if_submitted())) for name, fields in self.fields.items(): for field in fields: ... | 432911801f6818ab713efb8f31e3d3411a6cd046 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/432911801f6818ab713efb8f31e3d3411a6cd046/fixture.py |
self.checked = attrs.get('checked') is not None | self.checked = 'checked' in attrs | def __init__(self, *args, **attrs): super(Checkbox, self).__init__(*args, **attrs) self.checked = attrs.get('checked') is not None | 432911801f6818ab713efb8f31e3d3411a6cd046 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/432911801f6818ab713efb8f31e3d3411a6cd046/fixture.py |
session_class=None, **session_class_kw): | session_class=None, expiration=60*12, **session_class_kw): | def __init__(self, environ, cookie_name='_SID_', session_class=None, **session_class_kw): self.created = False self.used = False self.environ = environ self.cookie_name = cookie_name self.session = None self.session_class = session_class or FileSession self.session_class_kw = session_class_kw | 9850a35c5a615ada79edb0729a32c6b8143cbb85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9850a35c5a615ada79edb0729a32c6b8143cbb85/session.py |
def close(self): if self.session is not None: self.session.close() | 9850a35c5a615ada79edb0729a32c6b8143cbb85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9850a35c5a615ada79edb0729a32c6b8143cbb85/session.py | ||
chmod=None): | chmod=None, expiration=2880, ): | def __init__(self, sid, create=False, session_file_path='/tmp', chmod=None): if chmod and isinstance(chmod, basestring): chmod = int(chmod, 8) self.chmod = chmod if not sid: # Invalid... raise KeyError self.session_file_path = session_file_path self.sid = sid if not create: if not os.path.exists(self.filename()): raise... | 9850a35c5a615ada79edb0729a32c6b8143cbb85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9850a35c5a615ada79edb0729a32c6b8143cbb85/session.py |
def __init__(self, address): | def __init__(self, address, allowed_request_methods=()): | def __init__(self, address): self.address = address self.parsed = urlparse.urlsplit(address) self.scheme = self.parsed[0].lower() self.host = self.parsed[1] | 222ffdc3fdf784e3e377e349eac992766d5831d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/222ffdc3fdf784e3e377e349eac992766d5831d8/proxy.py |
print (environ['REQUEST_METHOD'], environ['PATH_INFO'], body, headers) | if self.path: request_path = environ['PATH_INFO'] if request_path[0] == '/': request_path = request_path[1:] path = urlparse.urljoin(self.path, request_path) else: path = environ['PATH_INFO'] | def __call__(self, environ, start_response): if self.scheme == 'http': ConnClass = httplib.HTTPConnection elif self.scheme == 'https': ConnClass = httplib.HTTPSConnection else: raise ValueError( "Unknown scheme for %r: %r" % (self.address, self.scheme)) conn = ConnClass(self.host) headers = {} for key, value in environ... | 222ffdc3fdf784e3e377e349eac992766d5831d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/222ffdc3fdf784e3e377e349eac992766d5831d8/proxy.py |
environ['PATH_INFO'], | path, | def __call__(self, environ, start_response): if self.scheme == 'http': ConnClass = httplib.HTTPConnection elif self.scheme == 'https': ConnClass = httplib.HTTPSConnection else: raise ValueError( "Unknown scheme for %r: %r" % (self.address, self.scheme)) conn = ConnClass(self.host) headers = {} for key, value in environ... | 222ffdc3fdf784e3e377e349eac992766d5831d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/222ffdc3fdf784e3e377e349eac992766d5831d8/proxy.py |
headers_out = res.getheaders() | headers_out = [] for header, value in res.getheaders(): if header.lower() not in filtered_headers: headers_out.append((header, value)) | def __call__(self, environ, start_response): if self.scheme == 'http': ConnClass = httplib.HTTPConnection elif self.scheme == 'https': ConnClass = httplib.HTTPSConnection else: raise ValueError( "Unknown scheme for %r: %r" % (self.address, self.scheme)) conn = ConnClass(self.host) headers = {} for key, value in environ... | 222ffdc3fdf784e3e377e349eac992766d5831d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/222ffdc3fdf784e3e377e349eac992766d5831d8/proxy.py |
body = res.read(int(length)) | if length is not None: body = res.read(int(length)) else: body = res.read() | def __call__(self, environ, start_response): if self.scheme == 'http': ConnClass = httplib.HTTPConnection elif self.scheme == 'https': ConnClass = httplib.HTTPSConnection else: raise ValueError( "Unknown scheme for %r: %r" % (self.address, self.scheme)) conn = ConnClass(self.host) headers = {} for key, value in environ... | 222ffdc3fdf784e3e377e349eac992766d5831d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/222ffdc3fdf784e3e377e349eac992766d5831d8/proxy.py |
if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING'): | if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING', ''): | def __call__(self, environ, start_response): if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING'): # nothing for us to do, so this middleware will # be a no-op: return self.application(environ, start_response) response = GzipResponse(start_response, self.compress_level) app_iter = self.application(environ, response.gzi... | b122f389283fa3b627d3c4d1bc51706be175567a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b122f389283fa3b627d3c4d1bc51706be175567a/gzipper.py |
def update(self, dict): if isinstance(dct, UserDict): self.data.update(dict.data) elif isinstance(dict, type(self.data)): self.data.update(dict) else: for k, v in dict.items(): if self.has_key(k) and isinstance(v, list): self[k].extend(v) elif self.has_key(k): self[k].append(v) elif not isinstance(v, list): self[k] = [... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def get_cookies(environ): """ Gets a cookie object (which is a dictionary-like object) from the request environment; caches this value in case get_cookies is called again for the same request. """ header = environ.get('HTTP_COOKIE', '') if environ.has_key('paste.cookies'): cookies, check_header = environ['paste.cookie... | 314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/314228f7a3afa0fe6c1e4bba47a296bf3ad1a4bd/request.py | ||
def parse_querystring(environ): """ Parses a query string into a list like ``[(name, value)]``. Caches this value in case parse_querystring is called again for the same request. You can pass the result to ``dict()``, but be aware that keys that appear multiple times will be lost (only the last value will be preserved)... | 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_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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.