rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
self.widgets = gtk.glade.XML('bluetool-gui.glade', 'bt_cfg_wnd')
self.widgets = gtk.glade.XML('bluetool_gui.glade', 'bt_cfg_wnd')
def __init__(self):
bced10be3e728c7e32309f3ce16cf534869135ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/bced10be3e728c7e32309f3ce16cf534869135ca/bluetool_config.py
self.devclass_widgets = gtk.glade.XML('bluetool-gui.glade', 'bt_devclass_panel')
self.devclass_widgets = gtk.glade.XML('bluetool_gui.glade', 'bt_devclass_panel')
def __init__(self):
bced10be3e728c7e32309f3ce16cf534869135ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/bced10be3e728c7e32309f3ce16cf534869135ca/bluetool_config.py
name = dev['local_name']
name = dev['name']
def on_device_added(self,dev): addr = dev['address'] name = dev['local_name'] self.dev_liststore.append([dev.path, addr, name+"\t("+addr+")",False,False]);
bced10be3e728c7e32309f3ce16cf534869135ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/bced10be3e728c7e32309f3ce16cf534869135ca/bluetool_config.py
print "vfs_read_directory", handle, file_info, context
print "vfs_read_directory", handle, context
def vfs_read_directory(self, handle, file_info, context): print "vfs_read_directory", handle, file_info, context handle.read_dir(file_info)
d9972c47e5ea086a6442f92d1a8b4286d89ab02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/d9972c47e5ea086a6442f92d1a8b4286d89ab02b/bluetooth.py
print "vfs_get_file_info", uri, file_info, options, context
print "vfs_get_file_info", uri, options, context
def vfs_get_file_info(self, uri, file_info, options, context): print "vfs_get_file_info", uri, file_info, options, context
d9972c47e5ea086a6442f92d1a8b4286d89ab02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/d9972c47e5ea086a6442f92d1a8b4286d89ab02b/bluetooth.py
print "vfs_get_file_info_from_handle", handle, file_info, options, context
print "vfs_get_file_info_from_handle", handle, options, context
def vfs_get_file_info_from_handle(self, handle, file_info, options, context): print "vfs_get_file_info_from_handle", handle, file_info, options, context handle.get_file_info(file_info)
d9972c47e5ea086a6442f92d1a8b4286d89ab02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/d9972c47e5ea086a6442f92d1a8b4286d89ab02b/bluetooth.py
print "------------------------> vfs_open", uri
print "vfs_open", uri
def vfs_open(self, uri, mode, context): print "------------------------> vfs_open", uri
d9972c47e5ea086a6442f92d1a8b4286d89ab02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/d9972c47e5ea086a6442f92d1a8b4286d89ab02b/bluetooth.py
def vfs_open(self, uri, mode, context): print "------------------------> vfs_open", uri
d9972c47e5ea086a6442f92d1a8b4286d89ab02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/d9972c47e5ea086a6442f92d1a8b4286d89ab02b/bluetooth.py
object which is a `Registry`_ instance.
object which is a Registry instance.
def cleanup(self): """Remove all objects from all StackedObjectProxy instances that were tracked at this Registry context""" for id, val in self.reglist[-1].iteritems(): stacked, obj = val stacked.pop_object(obj) self.reglist.pop()
37e84f7424901fdc0c1a7197d6cae1e54ff38848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/37e84f7424901fdc0c1a7197d6cae1e54ff38848/registry.py
if (not self.force_content_type and (not content_type or not content_type.startswith('text/html'))):
if (removed or (not self.force_content_type and (not content_type or not content_type.startswith('text/html')))):
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...
0307c0898dd2d4c86dd34e3a585f2990b0b297a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0307c0898dd2d4c86dd34e3a585f2990b0b297a9/prints.py
output = capture_output(stats.print_stats, self.limit) output_callers = capture_output( stats.print_callers, self.limit) body += '<pre style="%s">%s\n%s</pre>' % ( self.style, cgi.escape(output), cgi.escape(output_callers))
stats.print_stats(self.limit) stats.print_callers(self.limit) output = output.getvalue() body += '<pre style="%s">%s</pre>' % ( self.style, cgi.escape(output))
def run_app(): body.extend(self.app(environ, replace_start_response))
496fca63a1e4e37e3b0b141ae2c99615873968a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/496fca63a1e4e37e3b0b141ae2c99615873968a0/profile.py
def capture_output(func, *args, **kw): out = StringIO() old_stdout = sys.stdout sys.stdout = out try: func(*args, **kw) finally: sys.stdout = old_stdout return out.getvalue()
def run_app(): body.extend(self.app(environ, replace_start_response))
496fca63a1e4e37e3b0b141ae2c99615873968a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/496fca63a1e4e37e3b0b141ae2c99615873968a0/profile.py
output = capture_output(stats.print_stats, display_limit) output_callers = capture_output( stats.print_callers, display_limit)
stats.print_stats(display_limit) stats.print_callers(display_limit)
def profile(self, func, *args, **kw): ops = self.options prof_filename = ops.get('log_filename', 'profile_data.log.tmp') prof = hotshot.Profile(prof_filename) prof.addinfo('Function Call', self.format_function(func, *args, **kw)) if ops.get('add_info'): prof.addinfo('Extra info', ops['add_info']) exc_info = None try: s...
496fca63a1e4e37e3b0b141ae2c99615873968a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/496fca63a1e4e37e3b0b141ae2c99615873968a0/profile.py
f.write(output) f.write(output_callers)
f.write(output.getvalue())
def profile(self, func, *args, **kw): ops = self.options prof_filename = ops.get('log_filename', 'profile_data.log.tmp') prof = hotshot.Profile(prof_filename) prof.addinfo('Function Call', self.format_function(func, *args, **kw)) if ops.get('add_info'): prof.addinfo('Extra info', ops['add_info']) exc_info = None try: s...
496fca63a1e4e37e3b0b141ae2c99615873968a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/496fca63a1e4e37e3b0b141ae2c99615873968a0/profile.py
self.files_created = {}
def __init__(self, test_env, args, stdin, stdout, stderr, returncode, files_before, files_after): self.test_env = test_env self.args = args self.stdin = stdin self.stdout = stdout self.stderr = stderr self.returncode = returncode self.files_before = files_before self.files_after = files_after self.files_created = {} se...
3c2a81b901475638121c9f22f974b69def62bb33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3c2a81b901475638121c9f22f974b69def62bb33/fixture.py
def __contain__(self, s):
def __contains__(self, s):
def __contain__(self, s): return s in self.bytes
3c2a81b901475638121c9f22f974b69def62bb33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3c2a81b901475638121c9f22f974b69def62bb33/fixture.py
environ)
environ, view_uri)
def detect_start_response(status, headers, exc_info=None): try: return start_response(status, headers, exc_info) except: raise else: started.append(True)
f5346d4efba60623dbe9433c977c2296040f65ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/f5346d4efba60623dbe9433c977c2296040f65ad/middleware.py
environ):
environ, view_uri):
def __init__(self, counter, exc_info, exc_data, base_path, environ): self.counter = counter self.exc_data = exc_data self.base_path = base_path self.environ = environ self.exc_type, self.exc_value, self.tb = exc_info __exception_formatter__ = 1 self.frames = [] n = 0 tb = self.tb while tb is not None and (limit is None...
f5346d4efba60623dbe9433c977c2296040f65ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/f5346d4efba60623dbe9433c977c2296040f65ad/middleware.py
def setup_config(filename): conf = Config(with_default=True) conf.load(filename) if conf.get('sys_path'): update_sys_path(conf['sys_path'], conf['verbose']) from paste import CONFIG CONFIG.push_process_config(conf) return conf def update_sys_path(paths, verbose): if isinstance(paths, (str, unicode)): paths = [paths] ...
def convert_commandline(self, value): try: return int(value) except ValueError: pass return value
82c3c9d0f7c3623302eeaa78dcccdc166e0db02a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/82c3c9d0f7c3623302eeaa78dcccdc166e0db02a/pyconfig.py
conf = self.__getconf()
conf = self.current_conf()
def __getattr__(self, attr): conf = self.__getconf() if not conf: raise AttributeError( "No configuration has been registered for this process " "or thread") return getattr(conf, attr)
82c3c9d0f7c3623302eeaa78dcccdc166e0db02a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/82c3c9d0f7c3623302eeaa78dcccdc166e0db02a/pyconfig.py
def __getconf(self): thread_configs = local_dict()[self._local_key]
def current_conf(self): thread_configs = local_dict().get(self._local_key)
def __getconf(self): thread_configs = local_dict()[self._local_key] if thread_configs: return thread_configs[-1] elif self._process_configs: return self._process_configs[-1] else: return None
82c3c9d0f7c3623302eeaa78dcccdc166e0db02a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/82c3c9d0f7c3623302eeaa78dcccdc166e0db02a/pyconfig.py
id = int(wsgilib.path_info_pop(environ))
id = int(request.path_info_pop(environ)) if id not in self.debug_infos: start_response( '500 Server Error', [('Content-type', 'text/html')]) return [ "Traceback by id %s does not exist (maybe " "the server has been restarted?)" % id]
def view(self, environ, start_response): id = int(wsgilib.path_info_pop(environ)) debug_info = self.debug_infos[id] return debug_info.wsgi_application(environ, start_response)
23e8ee954360c5dcd956fcb3b3d3cbe9f4d92852 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/23e8ee954360c5dcd956fcb3b3d3cbe9f4d92852/middleware.py
exc_data = collector.collect_exception(*exc_info) debug_info = DebugInfo(count, exc_info, exc_data, base_path, environ) assert count not in self.debug_infos self.debug_infos[count] = debug_info
def detect_start_response(status, headers, exc_info=None): try: return start_response(status, headers, exc_info) except: raise else: started.append(True)
23e8ee954360c5dcd956fcb3b3d3cbe9f4d92852 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/23e8ee954360c5dcd956fcb3b3d3cbe9f4d92852/middleware.py
required_headers = ('date',)
def location(self): for name, value in self.headers: if name.lower() == 'location': return value else: raise KeyError("No location set for %s" % self)
4409e3621ec9c4cb235da7e66fb061a9ebfc61da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/4409e3621ec9c4cb235da7e66fb061a9ebfc61da/httpexceptions.py
type = type.split(';', 1)
type = type.split(';', 1)[0]
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. ...
7cef0e2b1877e7db6bc23861dec51f8308148d47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/7cef0e2b1877e7db6bc23861dec51f8308148d47/request.py
self.wfile = start_response
self.start = start_response self.body = []
def __call__(self, environ, start_response): if environ['PATH_INFO'].startswith(self.auth_prefix): self.environ = environ self.wfile = start_response self.base_url = request.construct_url(environ) path = re.sub(auth_prefix, '', environ['PATH_INFO']) self.parsed_uri = urlparse.urlparse(path) self.query = dict(request.p...
9ec27745eca2b32846ac6d0967914e882c0b0a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9ec27745eca2b32846ac6d0967914e882c0b0a74/openid.py
self.send_response(302) self.wfile.write(response)
response_headers = [('Content-type', 'text/html')] self.start(302, response_headers) return [response]
def redirect(self, redirect_url): """Send a redirect response to the given URL to the browser.""" response = """\
9ec27745eca2b32846ac6d0967914e882c0b0a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9ec27745eca2b32846ac6d0967914e882c0b0a74/openid.py
self.send_response(status)
response_headers = [('Content-type', 'text/html')] self.start(status, response_headers)
def render(self, message=None, css_class='alert', form_contents=None, status=200, title="Python OpenID Consumer Example"): """Render a page.""" self.send_response(status) self.pageHeader(title) if message: self.wfile.write("<div class='%s'>" % (css_class,)) self.wfile.write(message) self.wfile.write("</div>") self.page...
9ec27745eca2b32846ac6d0967914e882c0b0a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9ec27745eca2b32846ac6d0967914e882c0b0a74/openid.py
self.wfile.write("<div class='%s'>" % (css_class,)) self.wfile.write(message) self.wfile.write("</div>")
self.body.append("<div class='%s'>" % (css_class,)) self.body.append(message) self.body.append("</div>")
def render(self, message=None, css_class='alert', form_contents=None, status=200, title="Python OpenID Consumer Example"): """Render a page.""" self.send_response(status) self.pageHeader(title) if message: self.wfile.write("<div class='%s'>" % (css_class,)) self.wfile.write(message) self.wfile.write("</div>") self.page...
9ec27745eca2b32846ac6d0967914e882c0b0a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9ec27745eca2b32846ac6d0967914e882c0b0a74/openid.py
self.wfile.write('''\
self.body.append('''\
def pageHeader(self, title): """Render the page header""" self.wfile.write('''\
9ec27745eca2b32846ac6d0967914e882c0b0a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9ec27745eca2b32846ac6d0967914e882c0b0a74/openid.py
self.wfile.write('''\
self.body.append('''\
def pageFooter(self, form_contents): """Render the page footer""" if not form_contents: form_contents = ''
9ec27745eca2b32846ac6d0967914e882c0b0a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9ec27745eca2b32846ac6d0967914e882c0b0a74/openid.py
def __init__(self, address, allowed_request_methods=()):
def __init__(self, address, allowed_request_methods=(), suppress_http_headers=()):
def __init__(self, address, allowed_request_methods=()): self.address = address self.parsed = urlparse.urlsplit(address) self.scheme = self.parsed[0].lower() self.host = self.parsed[1] self.path = self.parsed[2] self.allowed_request_methods = [ x.lower() for x in allowed_request_methods if x]
9186389aa7157fa80e47b513d6152b935e1ea72f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9186389aa7157fa80e47b513d6152b935e1ea72f/proxy.py
if key == 'host':
if key == 'host' or key in self.suppress_http_headers:
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)
9186389aa7157fa80e47b513d6152b935e1ea72f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9186389aa7157fa80e47b513d6152b935e1ea72f/proxy.py
def make_proxy(global_conf, address, allowed_request_methods=""):
def make_proxy(global_conf, address, allowed_request_methods="", suppress_http_headers=""):
def make_proxy(global_conf, address, allowed_request_methods=""): """ Make a WSGI application that proxies to another address -- 'address' should be the full URL ending with a trailing / 'allowed_request_methods' is a space seperated list of request methods """ from paste.deploy.converters import aslist allowed_request...
9186389aa7157fa80e47b513d6152b935e1ea72f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9186389aa7157fa80e47b513d6152b935e1ea72f/proxy.py
return Proxy(address, allowed_request_methods=allowed_request_methods)
suppress_http_headers = aslist(suppress_http_headers) return Proxy( address, allowed_request_methods=allowed_request_methods, suppress_http_headers=suppress_http_headers)
def make_proxy(global_conf, address, allowed_request_methods=""): """ Make a WSGI application that proxies to another address -- 'address' should be the full URL ending with a trailing / 'allowed_request_methods' is a space seperated list of request methods """ from paste.deploy.converters import aslist allowed_request...
9186389aa7157fa80e47b513d6152b935e1ea72f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9186389aa7157fa80e47b513d6152b935e1ea72f/proxy.py
self.applications.remove((app_url, url))
self.applications.remove((app_url, app))
def __delitem__(self, url): url = self.normalize_url(url) for app_url, app in self.applications: if app_url == url: self.applications.remove((app_url, url)) break else: raise KeyError( "No application with the url %r" % (url,))
477a0a5bb9b5c8343f259ad6cd87a44b6e04a295 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/477a0a5bb9b5c8343f259ad6cd87a44b6e04a295/urlmap.py
global_conf,
global_conf=None,
def middleware( application, global_conf, http_login=False, http_realm='Secure Website', http_overwrite_realm=True, http_and_cookie=True, cookie_prefix='', login_page='_login/login_form', logout_page='_login/logout_form', secret=None, authenticator=None, ): """ Configuration: http_login: If true, then we'll prefer HTT...
11c0b5e9080fa549903fd37d5173921229e9f876 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/11c0b5e9080fa549903fd37d5173921229e9f876/login.py
remote_header(self.headers,'content-length')
remove_header(self.headers,'content-length')
def update(self): stat = os.stat(self.filename) if stat.st_mtime == self.st_mtime: return self.st_mtime = stat.st_mtime if stat.st_size < CACHE_SIZE: fh = open(self.filename,"rb") self.set_content(fh.read()) fh.close() return self.content = None remote_header(self.headers,'content-length') self.headers.append(('conten...
6fa5a1630a295e6b3716cde4abe9fc9e660a9b8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/6fa5a1630a295e6b3716cde4abe9fc9e660a9b8e/fileapp.py
def __call__(self, *args, **kwargs): """ converts ``values()`` into a string value This method converts the results of ``values()`` into a string value for common usage. If more than one result are found; they are comma delimited as described by section 4.2 of RFC 2616. """ results = self.values(*args, **kwargs) if ...
def __call__(self, *args, **kwargs): """ converts ``values()`` into a string value
74c8cfe93867f6b65436c8d806519ede20e99b6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/74c8cfe93867f6b65436c8d806519ede20e99b6d/httpheaders.py
whole, may be cashed; this implementation does not support the enumeration of private fields
whole, may not be cashed; this implementation does not support the enumeration of private fields
def parse(self, *args, **kwargs): """ return the time value (in seconds since 1970) """ value = self.__call__(*args, **kwargs) if value: try: return mktime_tz(parsedate_tz(value)) except TypeError: raise HTTPBadRequest(( "Received an ill-formed timestamp for %s: %s\r\n") % (self.name, value))
74c8cfe93867f6b65436c8d806519ede20e99b6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/74c8cfe93867f6b65436c8d806519ede20e99b6d/httpheaders.py
else: 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: print_exception(exc_info[0], exc_info[1], exc_info[2], file=errors) finally: # avoid dangling circular reference exc_info = None eli...
cab7a7b053e4c9d77f46217f7b9dbd4cf9b6b22b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/cab7a7b053e4c9d77f46217f7b9dbd4cf9b6b22b/wsgilib.py
result = method(*json_req['params'])
result = method(*req_data['params'])
def jsonaction(self): request_body = self.servlet().request().rawInput().read() req_data = jsonToObj(request_body) req_id = req_data['id'] try: method_name = req_data['method'] if method_name not in self.jsonMethods(): raise HTTPForbidden( "The method %s is not public" % method_name) method = getattr(self.servlet(), me...
73962900ef0ba113e5bf7c5dd22c4c73d9c76dfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/73962900ef0ba113e5bf7c5dd22c4c73d9c76dfb/jsoncomponent.py
json_res = objToJon(json_res)
json_res = objToJson(json_res)
def jsonaction(self): request_body = self.servlet().request().rawInput().read() req_data = jsonToObj(request_body) req_id = req_data['id'] try: method_name = req_data['method'] if method_name not in self.jsonMethods(): raise HTTPForbidden( "The method %s is not public" % method_name) method = getattr(self.servlet(), me...
73962900ef0ba113e5bf7c5dd22c4c73d9c76dfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/73962900ef0ba113e5bf7c5dd22c4c73d9c76dfb/jsoncomponent.py
var servlet = jsonrpc.ServiceProxy(%(here)r, %(methods)r);
var servlet = new jsonrpc.ServiceProxy(%(here)r, %(methods)r);
def jsonjs(self): env = self.servlet().request().environ() base = self.jsolaitURL lib = self.libURL here = wsgilib.construct_url(env, False) here += '?_action_=jsonaction'; if self.baseConfig: base_base = env['%s.base_url' % self.baseConfig] if not base.startswith('/'): base = base_base + '/' + base if not lib.startswi...
73962900ef0ba113e5bf7c5dd22c4c73d9c76dfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/73962900ef0ba113e5bf7c5dd22c4c73d9c76dfb/jsoncomponent.py
def get_data_files(path, files = []): l = [] for name in os.listdir(path): if name[0] == ".":
def get_data_files(relpath, files=None): files = files or [] for name in os.listdir(os.path.join(BASEDIR, relpath)): if name.startswith("."):
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...
ed34c9dd8c99bb297aad44e527b223ba489e7448 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ed34c9dd8c99bb297aad44e527b223ba489e7448/setup.py
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:] files.append((os.path.join(pref, path), l))
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)
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...
ed34c9dd8c99bb297aad44e527b223ba489e7448 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ed34c9dd8c99bb297aad44e527b223ba489e7448/setup.py
data_files=get_data_files(os.path.join("paste","app_templates")) + get_data_files(os.path.join("paste", "frameworks")) + [(os.path.join(sysconfig.get_python_lib()[len(sysconfig.PREFIX) + 1:], "paste"), [os.path.join("paste", "default_config.conf")])]
package_data={'paste': package_data},
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...
ed34c9dd8c99bb297aad44e527b223ba489e7448 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ed34c9dd8c99bb297aad44e527b223ba489e7448/setup.py
def __init__(self, default=None):
def __init__(self, default=None, name="Default"):
def __init__(self, default=None): """Create a new StackedObjectProxy If a default is given, its used in every thread if no other object has been pushed on. """ self.__dict__['local'] = threadinglocal.local() if default: self.__dict__['_default_object'] = default
31c3b9a3f2673c4f9c620ccd9479a8d51e1742a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/31c3b9a3f2673c4f9c620ccd9479a8d51e1742a9/registry.py
"No object has been registered for this thread")
"No object (Name: %s) has been registered for this \ thread" % self.__dict__['_name'])
def current_obj(self): """Returns the current active object being proxied to In the event that no object was pushed, the default object if provided will be used. Otherwise, a TypeError will be raised. """ objects = getattr(self.__dict__['local'], 'objects', None) if objects: return objects[-1] else: object = self.__d...
31c3b9a3f2673c4f9c620ccd9479a8d51e1742a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/31c3b9a3f2673c4f9c620ccd9479a8d51e1742a9/registry.py
def _repl_nbsp(match): if len(match.group(2)) == 1: return '&nbsp;' return match.group(1) + '&nbsp;' * (len(match.group(2))-1) + ' '
def _repl_nbsp(match): if len(match.group(2)) == 1: return '&nbsp;' return match.group(1) + '&nbsp;' * (len(match.group(2))-1) + ' '
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
% html_quote(out.getvalue())]
% html_quote(res)]
def simplecatcher_app(environ, start_response): try: return application(environ, start_response) except: out = StringIO() traceback.print_exc(file=out) start_response('500 Server Error', [('content-type', 'text/html')], sys.exc_info()) res = out.getvalue() return ['<h3>Error</h3><pre>%s</pre>' % html_quote(out.getvalue...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
def app_wrapper(*args):
def wsgiapp_wrapper(*args):
def app_wrapper(*args): # we get 3 args when this is a method, two when it is # a function :( if len(args) == 3: environ = args[1] start_response = args[2] args = [args[0]] else: environ, start_response = args args = [] def application(environ, start_response): form = wsgilib.parse_formvars(environ) headers = wsgilib.R...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
app_wrapper.exposed = True return app_wrapper
wsgiapp_wrapper.exposed = True return wsgiapp_wrapper
def application(environ, start_response): form = wsgilib.parse_formvars(environ) headers = wsgilib.ResponseHeaderDict( {'content-type': 'text/html', 'status': '200 OK'}) form['environ'] = environ form['headers'] = headers res = func(*args, **form) status = headers.pop('status') start_response(status, headers.headeritem...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
def replacement(self, **form):
""" A decorator (meant to be used under ``wsgiapp()``) that resolves the ``debugcount`` variable to a ``DebugInfo`` object (or gives an error if it can't be found). """ def debug_info_replacement(self, **form):
def replacement(self, **form): try: if 'debugcount' not in form: raise ValueError('You must provide a debugcount parameter') debugcount = form.pop('debugcount') try: debugcount = int(debugcount) except ValueError: raise ValueError('Bad value for debugcount') if debugcount not in self.debug_infos: raise ValueError('Debu...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
raise ValueError('Debug %s no longer found (maybe it has expired?)' % debugcount)
raise ValueError( 'Debug %s no longer found (maybe it has expired?)' % debugcount)
def replacement(self, **form): try: if 'debugcount' not in form: raise ValueError('You must provide a debugcount parameter') debugcount = form.pop('debugcount') try: debugcount = int(debugcount) except ValueError: raise ValueError('Bad value for debugcount') if debugcount not in self.debug_infos: raise ValueError('Debu...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
return replacement
return debug_info_replacement
def replacement(self, **form): try: if 'debugcount' not in form: raise ValueError('You must provide a debugcount parameter') debugcount = form.pop('debugcount') try: debugcount = int(debugcount) except ValueError: raise ValueError('Bad value for debugcount') if debugcount not in self.debug_infos: raise ValueError('Debu...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
"The EvalException middleware is not usable in a multi-process environment")
"The EvalException middleware is not usable in a " "multi-process environment")
def __call__(self, environ, start_response): assert not environ['wsgi.multiprocess'], ( "The EvalException middleware is not usable in a multi-process environment") if environ.get('PATH_INFO', '').startswith('/_debug/'): return self.debug(environ, start_response) else: return self.respond(environ, start_response)
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
return ('<script type="text/javascript" src="%s/_debug/mochikit/MochiKit.js"></script>\n' '<script type="text/javascript" src="%s/_debug/media/debug.js"></script>\n' '<script type="text/javascript">\n' 'debug_base = %r;\n' 'debug_count = %r;\n' '\n</script>\n' % (base_path, base_path, base_path, counter))
base_path += '/_debug' return ( '<script type="text/javascript" src="%s/mochikit/MochiKit.js">' '</script>\n' '<script type="text/javascript" src="%s/media/debug.js">' '</script>\n' '<script type="text/javascript">\n' 'debug_base = %r;\n' 'debug_count = %r;\n' '</script>\n' % (base_path, base_path, base_path, counter))...
def eval_javascript(self, base_path, counter): return ('<script type="text/javascript" src="%s/_debug/mochikit/MochiKit.js"></script>\n' '<script type="text/javascript" src="%s/_debug/media/debug.js"></script>\n' '<script type="text/javascript">\n' 'debug_base = %r;\n' 'debug_count = %r;\n' '\n</script>\n' % (base_path...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
value = value[:100] + '<span style="background-color:
value = value[:100] value += '<span style="background-color:
def make_table(items): if isinstance(items, dict): items = items.items() items.sort() rows = [] i = 0 for name, value in items: i += 1 out = StringIO() pprint.pprint(value, out) value = html_quote(out.getvalue()) if len(value) > 100: # @@: This can actually break the HTML :( # should I truncate before quoting? value = ...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
rows.append('<tr%s style="vertical-align: top;"><td><b>%s</b></td><td style="overflow: auto">%s<td></tr>'
rows.append('<tr%s style="vertical-align: top;"><td>' '<b>%s</b></td><td style="overflow: auto">%s<td></tr>'
def make_table(items): if isinstance(items, dict): items = items.items() items.sort() rows = [] i = 0 for name, value in items: i += 1 out = StringIO() pprint.pprint(value, out) value = html_quote(out.getvalue()) if len(value) > 100: # @@: This can actually break the HTML :( # should I truncate before quoting? value = ...
b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b5e2d6e4bc4f0a7b4a965ca5562bbb19108f83d1/middleware.py
def params(self): """Uses cascading dict to pull from the params Return a key value from the parameters, they are checked in the following order: POST, GET, URL If a key is not found in the first dict, the next is checked. As with dict.get, None will be returned if the key is not found in all three. Additional metho...
def params(): doc = """\ MultiDict of keys from POST, GET, URL dicts Return a key value from the parameters, they are checked in the following order: POST, GET, URL Additional methods supported: getlist(key) Returns a list keyed by parameter location of all the values by that key in that parameter location""" def fg...
def params(self): """Uses cascading dict to pull from the params Return a key value from the parameters, they are checked in the following order: POST, GET, URL If a key is not found in the first dict, the next is checked. As with dict.get, None will be returned if the key is not found in all three. Additional metho...
4fd9932a087ec55b1a3083cfe4feca1b77cf7e00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/4fd9932a087ec55b1a3083cfe4feca1b77cf7e00/request.py
return self.environ.get('HTTP_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('HTTP_X-Requested-With', '') == 'XMLHttpRequest'
1d362d67fa9cbfd77e57727d7cf654085d2e841d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/1d362d67fa9cbfd77e57727d7cf654085d2e841d/wsgiwrappers.py
""" This method sets the default middleware to be executed, if none of the rules apply. """
""" set default authentication method """
def set_default(self, name): """ This method sets the default middleware to be executed, if none of the rules apply. """ self.default = self.binding[name]
a6d593a7e29f59e1598efa635f05d361b7283e77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a6d593a7e29f59e1598efa635f05d361b7283e77/multi.py
""" This method indicates that the named middleware component should be executed if the given key/value pair occurs in the query args. """
""" choose authentication method based on a query argument """
def set_query_argument(self, name, key = '*authmeth', value = None): """ This method indicates that the named middleware component should be executed if the given key/value pair occurs in the query args. """ lookfor = "%s=%s" % (key, value or name) self.add_predicate(name, lambda environ: lookfor in environ.get('QUERY_...
a6d593a7e29f59e1598efa635f05d361b7283e77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/a6d593a7e29f59e1598efa635f05d361b7283e77/multi.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...
52c676dea1740dcea11d5f48a726d94b90414134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/52c676dea1740dcea11d5f48a726d94b90414134/urlparser.py
status=None):
status=None, expect_errors=False):
def get(self, url, params=None, headers={}, status=None): 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('-', '_').upper()] = value i...
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
req = TestRequest(url, environ)
req = TestRequest(url, environ, expect_errors)
def get(self, url, params=None, headers={}, status=None): 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('-', '_').upper()] = value i...
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
upload_files=None):
upload_files=None, expect_errors=False):
def post(self, url, params=None, headers={}, status=None, upload_files=None): 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( params, upload_files...
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
req = TestRequest(url, environ)
req = TestRequest(url, environ, expect_errors)
def post(self, url, params=None, headers={}, status=None, upload_files=None): 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( params, upload_files...
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
self.check_status(status, res) self.check_errors(res)
if not req.expect_errors: self.check_status(status, res) self.check_errors(res)
def do_request(self, req, status): if self.cookies: c = SimpleCookie() for name, value in self.cookies.items(): c[name] = value req.environ['HTTP_COOKIE'] = str(c).split(': ', 1)[1] app = lint.middleware(self.app) old_stdout = sys.stdout out = StringIO() try: sys.stdout = out start_time = time.time() raw_res = wsgilib....
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
if status != res.status_int:
if status != res.status:
def check_status(self, status, res): if status == '*': return if status is None: if res.status == 200 or ( res.status >= 300 and res.status < 400): return raise AppError( "Bad response: %s (not 200 OK or 3xx redirect)" % res.full_status) if status != res.status_int: raise AppError( "Bad response: %s (not %s)" % (res.fu...
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
def __init__(self, url, environ):
def __init__(self, url, environ, expect_errors=False):
def __init__(self, url, environ): self.url = url self.environ = environ if environ.get('QUERY_STRING'): self.full_url = url + '?' + environ['QUERY_STRING'] else: self.full_url = url
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
self.expect_errors = expect_errors
def __init__(self, url, environ): self.url = url self.environ = environ if environ.get('QUERY_STRING'): self.full_url = url + '?' + environ['QUERY_STRING'] else: self.full_url = url
b873ce3fd5cd9d1d0b60390670fd8815c3c64f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b873ce3fd5cd9d1d0b60390670fd8815c3c64f91/fixture.py
for name in fs.keys(): values = fs[name] if not isinstance(values, list): values = [values] for value in values: if not value.filename: value = value.value if name in formvars: if isinstance(formvars[name], list): formvars[name].append(value)
if not isinstance(fs.value, list): formvars['__body__'] = fs.value else: for name in fs.keys(): values = fs[name] if not isinstance(values, list): values = [values] for value in values: if not value.filename: value = value.value if name in formvars: if isinstance(formvars[name], list): formvars[name].append(value) el...
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,...
ebc472922b5ed87f5ab605f8120871b83519bb14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ebc472922b5ed87f5ab605f8120871b83519bb14/request.py
formvars[name] = [formvars[name], value] elif all_as_list: formvars[name] = [value] else: formvars[name] = value
formvars[name] = value
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,...
ebc472922b5ed87f5ab605f8120871b83519bb14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/ebc472922b5ed87f5ab605f8120871b83519bb14/request.py
environ.update(self.headers)
args.update(self.headers)
def html(self, environ): message = self.message args = environ.copy() if self.headers: environ.update(self.headers) message = message % args return ('<html><head><title>%(title)s</title></head>\n' '<body>\n' '<h1>%(title)s</h1>\n' '<p>%(message)s</p>\n' '<hr noshade>\n' '<div align="right">WSGI server</div>\n' '</body>...
94a56458fc3c8f75de109f4b8cdb9f3a8c5cfdbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/94a56458fc3c8f75de109f4b8cdb9f3a8c5cfdbd/httpexceptions.py
following order: POST, GET, URL
following order: POST, GET, URL
def params(self): """MultiDict of keys from POST, GET, URL dicts
afa0ee67e3bc2f70198165d2af9d2bcd6454edf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/afa0ee67e3bc2f70198165d2af9d2bcd6454edf0/wsgiwrappers.py
getlist(key)
``getlist(key)``
def params(self): """MultiDict of keys from POST, GET, URL dicts
afa0ee67e3bc2f70198165d2af9d2bcd6454edf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/afa0ee67e3bc2f70198165d2af9d2bcd6454edf0/wsgiwrappers.py
}
}
def tell(self): return len(self.content)
afa0ee67e3bc2f70198165d2af9d2bcd6454edf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/afa0ee67e3bc2f70198165d2af9d2bcd6454edf0/wsgiwrappers.py
def make_wrappable(self, html, wrap_limit=50,
def make_wrappable(self, html, wrap_limit=60,
def make_wrappable(self, html, wrap_limit=50, split_on=';?&@!$#-/\\"\''): # Currently using <wbr>, maybe should use &#8203; # http://www.cs.tut.fi/~jkorpela/html/nobr.html words = html.split() new_words = [] for word in words: for char in split_on: if char in word: word = word.replace(char, char+'<wbr>') break new_wo...
0c660537bd6d42f683f4ccfac0e1ed992c7f1324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0c660537bd6d42f683f4ccfac0e1ed992c7f1324/formatter.py
for char in split_on: if char in word: word = word.replace(char, char+'<wbr>') break new_words.append(word)
if len(word) > wrap_limit: for char in split_on: if char in word: words = [ self.make_wrappable(w, wrap_limit=wrap_limit, split_on=split_on) for w in word.split(char, 1)] new_words.append('<wbr>'.join(words)) break else: new_words.append(word)
def make_wrappable(self, html, wrap_limit=50, split_on=';?&@!$#-/\\"\''): # Currently using <wbr>, maybe should use &#8203; # http://www.cs.tut.fi/~jkorpela/html/nobr.html words = html.split() new_words = [] for word in words: for char in split_on: if char in word: word = word.replace(char, char+'<wbr>') break new_wo...
0c660537bd6d42f683f4ccfac0e1ed992c7f1324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/0c660537bd6d42f683f4ccfac0e1ed992c7f1324/formatter.py
if headers is None: headers = {}
def get(self, url, params=None, headers=None, extra_environ=None, status=None, expect_errors=False): """ Get the given url (well, actually a path like ``'/page.html'``).
b1fa7fee328d6ef13f0b6d43cc0f5b717b5a9dfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b1fa7fee328d6ef13f0b6d43cc0f5b717b5a9dfd/fixture.py
for header, value in headers.items(): if header.lower() == 'content-type': var = 'CONTENT_TYPE' elif header.lower() == 'content-length': var = 'CONTENT_LENGTH' else: var = 'HTTP_%s' % header.replace('-', '_').upper() environ[var] = value
def get(self, url, params=None, headers=None, extra_environ=None, status=None, expect_errors=False): """ Get the given url (well, actually a path like ``'/page.html'``).
b1fa7fee328d6ef13f0b6d43cc0f5b717b5a9dfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b1fa7fee328d6ef13f0b6d43cc0f5b717b5a9dfd/fixture.py
for header, value in headers.items(): environ['HTTP_%s' % header.replace('-', '_').upper()] = value
self._set_headers(headers, environ)
def post(self, url, params='', headers=None, extra_environ=None, 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.
b1fa7fee328d6ef13f0b6d43cc0f5b717b5a9dfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b1fa7fee328d6ef13f0b6d43cc0f5b717b5a9dfd/fixture.py
name = [] result = self.name.lower()
result = [] name = self.name.lower()
def values(self, *args, **kwargs): """ find/construct field-value(s) for the given header
d5e379dd482633685c861de20081b9baa8d46715 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/d5e379dd482633685c861de20081b9baa8d46715/httpheaders.py
print "all good", environ, start_response
def wsgi_application(self, environ, start_response, exc_info=None): """ This exception as a WSGI application """ if 'html' in environ.get('HTTP_ACCEPT',''): headers = {'content-type': 'text/html'} content = self.html(environ) else: headers = {'content-type': 'text/plain'} content = self.plain(environ) if self.headers: ...
1704a0aaabcba40d27a61b5713efbd8f2a42505f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/1704a0aaabcba40d27a61b5713efbd8f2a42505f/httpexceptions.py
'HTTPExceptionHandler instead',
'make_middleware or HTTPExceptionHandler instead',
def middleware(*args, **kw): import warnings # deprecated 13 dec 2005 warnings.warn('httpexceptions.middleware is deprecated; use ' 'HTTPExceptionHandler instead', DeprecationWarning, 1) return HTTPExceptionHandler(*args, **kw)
1704a0aaabcba40d27a61b5713efbd8f2a42505f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/1704a0aaabcba40d27a61b5713efbd8f2a42505f/httpexceptions.py
return HTTPExceptionHandler(*args, **kw)
return make_middleware(*args, **kw)
def middleware(*args, **kw): import warnings # deprecated 13 dec 2005 warnings.warn('httpexceptions.middleware is deprecated; use ' 'HTTPExceptionHandler instead', DeprecationWarning, 1) return HTTPExceptionHandler(*args, **kw)
1704a0aaabcba40d27a61b5713efbd8f2a42505f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/1704a0aaabcba40d27a61b5713efbd8f2a42505f/httpexceptions.py
def __init__(self, directory, root_directory=None):
def __init__(self, directory, root_directory=None, cache_max_age=None):
def __init__(self, directory, root_directory=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)
5c587ebd47ba0bbc115e095463054d8c2b24831a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/5c587ebd47ba0bbc115e095463054d8c2b24831a/urlparser.py
self.cache_max_age = cache_max_age
def __init__(self, directory, root_directory=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)
5c587ebd47ba0bbc115e095463054d8c2b24831a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/5c587ebd47ba0bbc115e095463054d8c2b24831a/urlparser.py
return self.__class__(full, root_directory=child_root)(environ,
return self.__class__(full, root_directory=child_root, cache_max_age=self.cache_max_age)(environ,
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: # Handle quoted chars (e.g. %20) filename = urllib.unquote(request.path_in...
5c587ebd47ba0bbc115e095463054d8c2b24831a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/5c587ebd47ba0bbc115e095463054d8c2b24831a/urlparser.py
return fileapp.FileApp(full)(environ, start_response)
fa = fileapp.FileApp(full) if self.cache_max_age: fa.cache_control(max_age=self.cache_max_age) return fa(environ, start_response)
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: # Handle quoted chars (e.g. %20) filename = urllib.unquote(request.path_in...
5c587ebd47ba0bbc115e095463054d8c2b24831a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/5c587ebd47ba0bbc115e095463054d8c2b24831a/urlparser.py
def make_static(global_conf, document_root):
def make_static(global_conf, document_root, cache_max_age=None):
def make_static(global_conf, document_root): """ Return a WSGI application that serves a directory (configured with document_root) """ return StaticURLParser(document_root)
5c587ebd47ba0bbc115e095463054d8c2b24831a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/5c587ebd47ba0bbc115e095463054d8c2b24831a/urlparser.py
""" return StaticURLParser(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_root, **kw)
def make_static(global_conf, document_root): """ Return a WSGI application that serves a directory (configured with document_root) """ return StaticURLParser(document_root)
5c587ebd47ba0bbc115e095463054d8c2b24831a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/5c587ebd47ba0bbc115e095463054d8c2b24831a/urlparser.py
self.add(key, value)
self.add(name, value)
def fromlist(cls, seq): self = cls() for name, value in seq: self.add(key, value) return self
38f7a1f62eae388642602ce15c3dee068a64c686 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/38f7a1f62eae388642602ce15c3dee068a64c686/response.py
self.render(request, message, css_class='error', form_contents=openid_url)
return self.render(request, message, css_class='error', form_contents=openid_url)
def do_verify(self, request): """Process the form submission, initating OpenID verification. """
d6490c4f90237b11a5ec86c175b46881ce756414 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/d6490c4f90237b11a5ec86c175b46881ce756414/open_id.py
self.environ = environ self.start = start_response self.body = [] self.base_url = request.construct_url(environ, with_path_info=False,
request = dict(environ=environ, start=start_response, body=[]) request['base_url'] = paste.request.construct_url(environ, with_path_info=False,
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
self.parsed_uri = urlparse.urlparse(path) self.query = dict(request.parse_querystring(environ))
request['parsed_uri'] = urlparse.urlparse(path) request['query'] = dict(paste.request.parse_querystring(environ))
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
path = self.parsed_uri[2]
path = request['parsed_uri'][2]
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.render()
return self.render(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