rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
for pl in ['socket','strip','repl_memory']: | for pl in ['socket','strip','repl_memory','linestack_file','repl_none']: | def upgrade(self): # Throw out obsolete modules for pl in ['socket','strip','repl_memory']: if self.plugins.has_key(pl): self.plugins.pop(pl) | 09a23d662c9d2a4c16abd33d30033525155059b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10542/09a23d662c9d2a4c16abd33d30033525155059b1/upgrade.py |
You may need to add Options ExecCGI on "<Directory />" for this to work. | You may need to add Options ExecCGI on "<Directory />" and your cgi-bin directory for this to work. | def createfile(pretend, fname, contents): if pretend: print "cat >%(fname)s <__EOF__\n%(contents)s__EOF__" % vars() else: f = open(fname, "w") f.write(contents) f.close() | c68c72238173d350e42d4c96cf5d7d92b2a30e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12503/c68c72238173d350e42d4c96cf5d7d92b2a30e6e/zope-install.py |
print '\t-d\tdirectory for CGIs, defaults to %s' % cgidir | print '\t-c\tdirectory for CGIs, defaults to %s' % cgidir | def usage(): print 'usage: zope-install [-n] [-p perms] [-u user] [-g group] [-d dir] [-c cgidir] instancename' print print '\t-n\tshow what would be done, but don\'t actually do it' print '\t-p\tmanager permissions, in the form' print '\t\tusername:plaintextpassword[:domain-restrinction]' print '\t\teg: "root:mypass" ... | 6403954cfb4d34ae7b2b4169aff1265fcbba2445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12503/6403954cfb4d34ae7b2b4169aff1265fcbba2445/zope-install.py |
optlist, args = getopt.getopt(sys.argv[1:], 'np:u:g:d:') | optlist, args = getopt.getopt(sys.argv[1:], 'np:u:g:d:c:') | def createfile(pretend, fname, contents): if pretend: print "cat >%(fname)s <__EOF__\n%(contents)s__EOF__" % vars() else: f = open(fname, "w") f.write(contents) f.close() | 6403954cfb4d34ae7b2b4169aff1265fcbba2445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12503/6403954cfb4d34ae7b2b4169aff1265fcbba2445/zope-install.py |
RewriteRule ^/%(instance)s/(.*) %(cgidir)s/%(instance)s.cgi/$1 [e=HTTP_CGI_AUTHORIZATION:%%1,t=application/x-httpd-cgi,l] | RewriteRule ^/%(instance)s($|/)(.*) %(cgidir)s/%(instance)s.cgi/$2 [e=HTTP_CGI_AUTHORIZATION:%%1,t=application/x-httpd-cgi,l] | def createfile(pretend, fname, contents): if pretend: print "cat >%(fname)s <__EOF__\n%(contents)s__EOF__" % vars() else: f = open(fname, "w") f.write(contents) f.close() | 6403954cfb4d34ae7b2b4169aff1265fcbba2445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12503/6403954cfb4d34ae7b2b4169aff1265fcbba2445/zope-install.py |
self.aps = 15 | self.aps = 40 | def __init__(self, distance, callback, is_angle): self.callback = callback #distance in m*10 self.distance = distance self.is_angle = is_angle #meters per second self.mps = 1 #amount of angles turned per second self.aps = 15 | 7a0ddd099fada0a3f6e4fed9ca330783b2a45ec2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5698/7a0ddd099fada0a3f6e4fed9ca330783b2a45ec2/motor_queue_proc.py |
result = re.search("blx.*0x.*",data) | result = re.search("bl.*0x.*",data) | def callplt(data): resplt = dict(zip(plt.values(),plt.keys())) result = re.search("blx.*0x.*",data) if result : addr = result.group().split("0x")[1] addr = "0x" + addr if addr in resplt: return data[:-1] + " <" + resplt[addr] + ">\n" return data else : return data | 6604e18769874e4f5406afe00f5c108511a0c7aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4308/6604e18769874e4f5406afe00f5c108511a0c7aa/pwngdb.py |
def __init__(self, x, y, width, height, **kwargs): | def __init__(self, x, y, width, height, line_width, **kwargs): | def __init__(self, x, y, width, height, **kwargs): CustomItem.__init__(self, **kwargs) self.x = x self.y = y self.width = width self.height = height | 4ebd037627cae41a7841daa03fca80813a63c078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/4ebd037627cae41a7841daa03fca80813a63c078/custom.py |
self.bounds.x1 = float(self.x) self.bounds.y1 = float(self.y) self.bounds.x2 = float(self.x + self.width) self.bounds.y2 = float(self.y + self.height) | half_lw = self.line_width/2 self.bounds.x1 = float(self.x - half_lw) self.bounds.y1 = float(self.y - half_lw) self.bounds.x2 = float(self.x + self.width + half_lw) self.bounds.y2 = float(self.y + self.height + half_lw) | def do_update(self, entire_tree, cr): self.bounds.x1 = float(self.x) self.bounds.y1 = float(self.y) self.bounds.x2 = float(self.x + self.width) self.bounds.y2 = float(self.y + self.height) return self.bounds | 4ebd037627cae41a7841daa03fca80813a63c078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/4ebd037627cae41a7841daa03fca80813a63c078/custom.py |
cr.set_line_width(self.width/20) | cr.set_line_width(self.line_width) cr.set_source_rgb(0, 0, 0) | def do_paint(self, cr, bounds, scale): cr.rectangle(self.x, self.y, self.width, self.height) cr.set_line_width(self.width/20) cr.stroke() return self.bounds | 4ebd037627cae41a7841daa03fca80813a63c078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/4ebd037627cae41a7841daa03fca80813a63c078/custom.py |
item = CustomRectItem(x=100, y=100, width=400, height=400) | item = CustomRectItem(x=100, y=100, width=400, height=400, line_width=20) | def create_canvas_model(): canvas_model = goocanvas.CanvasModelSimple() root = canvas_model.get_root_item() item = CustomRectItem(x=100, y=100, width=400, height=400) root.add_child(item) item = goocanvas.Text(text="Hello World", x=300, y=300, anchor=gtk.ANCHOR_CENTER, font="Sans 24") root.add_child(item) item.rotate(4... | 4ebd037627cae41a7841daa03fca80813a63c078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/4ebd037627cae41a7841daa03fca80813a63c078/custom.py |
info.varlist.add('PyObject', '*py_' + pname) info.add_parselist('O!', ['&PyGooCanvasBounds_Type', '&py_'+pname], [pname]) info.arglist.append("&((PyGooCanvasBounds *) py_%s)->bounds" % (pname,)) | if pdflt: info.varlist.add('PyObject', '*py_' + pname + " = " + pdflt) else: info.varlist.add('PyObject', '*py_' + pname) if pnull: info.add_parselist('O', ['&py_'+pname], [pname]) info.codebefore.append( ' if (!(py_%(name)s == NULL || py_%(name)s == Py_None || \n' ' PyObject_IsInstance(py_%(name)s, (PyObject... | def write_param(self, ptype, pname, pdflt, pnull, info): info.varlist.add('PyObject', '*py_' + pname) info.add_parselist('O!', ['&PyGooCanvasBounds_Type', '&py_'+pname], [pname]) info.arglist.append("&((PyGooCanvasBounds *) py_%s)->bounds" % (pname,)) | 22660d0cbe8d3525ee02868a075753eda5a83279 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/22660d0cbe8d3525ee02868a075753eda5a83279/arg-types.py |
item = gobject.new(goocanvas.CanvasRect, | item = gobject.new(goocanvas.Rect, | def create_canvas_model(): canvas_model = goocanvas.CanvasModelSimple() root = canvas_model.get_root_item() ## Add a few simple items. item = gobject.new(goocanvas.CanvasRect, x=100, y=100, width=400, height=400, line_width=10.0, radius_x=20.0, radius_y=10.0, stroke_color="yellow", fill_color="red") root.add_child(it... | c3d8974263b4ebd29f7c86d8da7528de2920b91b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/c3d8974263b4ebd29f7c86d8da7528de2920b91b/simple-demo.py |
item = gobject.new(goocanvas.CanvasText, text="Hello World", | item = gobject.new(goocanvas.Text, text="Hello World", | def create_canvas_model(): canvas_model = goocanvas.CanvasModelSimple() root = canvas_model.get_root_item() ## Add a few simple items. item = gobject.new(goocanvas.CanvasRect, x=100, y=100, width=400, height=400, line_width=10.0, radius_x=20.0, radius_y=10.0, stroke_color="yellow", fill_color="red") root.add_child(it... | c3d8974263b4ebd29f7c86d8da7528de2920b91b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/c3d8974263b4ebd29f7c86d8da7528de2920b91b/simple-demo.py |
if isinstance(item, goocanvas.CanvasRect): | if isinstance(item, goocanvas.Rect): | def on_item_view_created (view, item_view, item): if isinstance(item, goocanvas.CanvasRect): item_view.connect("button_press_event", on_rect_button_press) | c3d8974263b4ebd29f7c86d8da7528de2920b91b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/c3d8974263b4ebd29f7c86d8da7528de2920b91b/simple-demo.py |
code=('py_%s = PycairoContext_FromContext(%s, NULL, NULL);' % | code=('py_%s = PycairoContext_FromContext(cairo_reference(%s), NULL, NULL);' % | def convert_c2py(self): self.wrapper.add_declaration("PyObject *py_%s;" % self.name) self.wrapper.write_code( code=('py_%s = PycairoContext_FromContext(%s, NULL, NULL);' % (self.name, self.name)), cleanup=("Py_DECREF(py_%s);" % self.name)) self.wrapper.add_pyargv_item("py_%s" % self.name) | 772027f66f7bd8c296b3a521d97e4fac5790fde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2475/772027f66f7bd8c296b3a521d97e4fac5790fde3/arg-types.py |
def setUp(self): td.setThreadCount(1) if len(asyncore.socket_map) != 1: # Let sockets die off. # TODO tests should be more careful to clear the socket map. asyncore.poll(0.1) self.orig_map_size = len(asyncore.socket_map) self.hook_asyncore_error() | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py | ||
def setUp(self): td.setThreadCount(1) if len(asyncore.socket_map) != 1: # Let sockets die off. # TODO tests should be more careful to clear the socket map. asyncore.poll(0.1) self.orig_map_size = len(asyncore.socket_map) self.hook_asyncore_error() | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py | ||
timeout = time() + 2 | timeout = time.time() + 2 | def tearDown(self): self.run_loop = 0 self.thread.join() td.shutdown() self.server.close() # Make sure all sockets get closed by asyncore normally. timeout = time() + 2 while 1: if len(asyncore.socket_map) == self.orig_map_size: # Clean! break if time() >= timeout: self.fail('Leaked a socket: %s' % `asyncore.socket_map... | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
if time() >= timeout: | if time.time() >= timeout: | def tearDown(self): self.run_loop = 0 self.thread.join() td.shutdown() self.server.close() # Make sure all sockets get closed by asyncore normally. timeout = time() + 2 while 1: if len(asyncore.socket_map) == self.orig_map_size: # Clean! break if time() >= timeout: self.fail('Leaked a socket: %s' % `asyncore.socket_map... | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
def loop(self): self.thread_started.set() import select from errno import EBADF while self.run_loop: self.counter = self.counter + 1 # Note that it isn't acceptable to fail out of # this loop. That will likely make the tests hang. try: asyncore.poll(0.1) continue except select.error, data: print "EXCEPTION POLLING IN L... | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py | ||
def execute(self, commands, login=1): ftp = self.getFTPConnection(login) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py | ||
return result.split('\r\n')[0] | return result | def execute(self, commands, login=1): ftp = self.getFTPConnection(login) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('ABOR', 1), | self.assertEqual(self.execute('ABOR', 1).rstrip(), | def testABOR(self): self.assertEqual(self.execute('ABOR', 1), status_messages['TRANSFER_ABORTED']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute(('CWD test', 'CDUP'), 1), | self.execute('CWD test', 1) self.assertEqual(self.execute('CDUP', 1).rstrip(), | def testCDUP(self): self.assertEqual(self.execute(('CWD test', 'CDUP'), 1), status_messages['SUCCESS_250'] %'CDUP') self.assertEqual(self.execute('CDUP', 1), status_messages['SUCCESS_250'] %'CDUP') | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('CDUP', 1), | self.assertEqual(self.execute('CDUP', 1).rstrip(), | def testCDUP(self): self.assertEqual(self.execute(('CWD test', 'CDUP'), 1), status_messages['SUCCESS_250'] %'CDUP') self.assertEqual(self.execute('CDUP', 1), status_messages['SUCCESS_250'] %'CDUP') | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('CWD test', 1), | self.assertEqual(self.execute('CWD test', 1).rstrip(), | def testCWD(self): self.assertEqual(self.execute('CWD test', 1), status_messages['SUCCESS_250'] %'CWD') self.assertEqual(self.execute('CWD foo', 1), status_messages['ERR_NO_DIR'] %'/foo') | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('CWD foo', 1), | self.assertEqual(self.execute('CWD foo', 1).rstrip(), | def testCWD(self): self.assertEqual(self.execute('CWD test', 1), status_messages['SUCCESS_250'] %'CWD') self.assertEqual(self.execute('CWD foo', 1), status_messages['ERR_NO_DIR'] %'/foo') | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('DELE test/existing', 1), | self.assertEqual(self.execute('DELE test/existing', 1).rstrip(), | def testDELE(self): self.assertEqual(self.execute('DELE test/existing', 1), status_messages['SUCCESS_250'] %'DELE') res = self.execute('DELE bar', 1).split()[0] self.assertEqual(res, '550') self.assertEqual(self.execute('DELE', 1), status_messages['ERR_ARGS']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('DELE', 1), | self.assertEqual(self.execute('DELE', 1).rstrip(), | def testDELE(self): self.assertEqual(self.execute('DELE test/existing', 1), status_messages['SUCCESS_250'] %'DELE') res = self.execute('DELE bar', 1).split()[0] self.assertEqual(res, '550') self.assertEqual(self.execute('DELE', 1), status_messages['ERR_ARGS']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
def XXXtestHELP(self): | def testHELP(self): | def XXXtestHELP(self): # TODO This test doesn't work. I think it is because execute() # doesn't read the whole reply. The execeute() helper # function should be fixed, but that's for another day. result = status_messages['HELP_START'] + '\r\n' result += 'Help goes here somewhen.\r\n' result += status_messag... | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
result += status_messages['HELP_END'] | result += status_messages['HELP_END'] + '\r\n' | def XXXtestHELP(self): # TODO This test doesn't work. I think it is because execute() # doesn't read the whole reply. The execeute() helper # function should be fixed, but that's for another day. result = status_messages['HELP_START'] + '\r\n' result += 'Help goes here somewhen.\r\n' result += status_messag... | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('NOOP', 0), | self.assertEqual(self.execute('NOOP', 0).rstrip(), | def testNOOP(self): self.assertEqual(self.execute('NOOP', 0), status_messages['SUCCESS_200'] %'NOOP') self.assertEqual(self.execute('NOOP', 1), status_messages['SUCCESS_200'] %'NOOP') | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('NOOP', 1), | self.assertEqual(self.execute('NOOP', 1).rstrip(), | def testNOOP(self): self.assertEqual(self.execute('NOOP', 0), status_messages['SUCCESS_200'] %'NOOP') self.assertEqual(self.execute('NOOP', 1), status_messages['SUCCESS_200'] %'NOOP') | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('PASS', 0), | self.assertEqual(self.execute('PASS', 0).rstrip(), | def testPASS(self): self.assertEqual(self.execute('PASS', 0), status_messages['LOGIN_MISMATCH']) self.assertEqual(self.execute(('USER blah', 'PASS bar'), 0), status_messages['LOGIN_MISMATCH']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute(('USER blah', 'PASS bar'), 0), | self.execute('USER blah', 0) self.assertEqual(self.execute('PASS bar', 0).rstrip(), | def testPASS(self): self.assertEqual(self.execute('PASS', 0), status_messages['LOGIN_MISMATCH']) self.assertEqual(self.execute(('USER blah', 'PASS bar'), 0), status_messages['LOGIN_MISMATCH']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('QUIT', 0), | self.assertEqual(self.execute('QUIT', 0).rstrip(), | def testQUIT(self): self.assertEqual(self.execute('QUIT', 0), status_messages['GOODBYE']) self.assertEqual(self.execute('QUIT', 1), status_messages['GOODBYE']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('QUIT', 1), | self.assertEqual(self.execute('QUIT', 1).rstrip(), | def testQUIT(self): self.assertEqual(self.execute('QUIT', 0), status_messages['GOODBYE']) self.assertEqual(self.execute('QUIT', 1), status_messages['GOODBYE']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('USER foo', 0), | self.assertEqual(self.execute('USER foo', 0).rstrip(), | def testUSER(self): self.assertEqual(self.execute('USER foo', 0), status_messages['PASS_REQUIRED']) self.assertEqual(self.execute('USER', 0), status_messages['ERR_ARGS']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
self.assertEqual(self.execute('USER', 0), | self.assertEqual(self.execute('USER', 0).rstrip(), | def testUSER(self): self.assertEqual(self.execute('USER foo', 0), status_messages['PASS_REQUIRED']) self.assertEqual(self.execute('USER', 0), status_messages['ERR_ARGS']) | 90d04321f031c84ce099735d79abab9afd55bb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/90d04321f031c84ce099735d79abab9afd55bb34/test_ftpserver.py |
pdb.post_mortem(sys.exc_info()[2]) raise | zope.security.management.restoreInteraction() try: pdb.post_mortem(sys.exc_info()[2]) raise finally: zope.security.management.endInteraction() | def executeRequest(self, task): """Overrides HTTPServer.executeRequest().""" env = task.getCGIEnvironment() instream = task.request_data.getBodyStream() | 29dfeca0f75ea508bb5c818f64a2b4e3b1969e02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/29dfeca0f75ea508bb5c818f64a2b4e3b1969e02/publisherhttpserver.py |
def loop(self): self.thread_started.set() import select from errno import EBADF while self.run_loop: self.counter = self.counter + 1 # print 'loop', self.counter try: asyncore.poll(0.1) except select.error, data: if data[0] == EBADF: print "exception polling in loop(): ", data else: raise | 5574691b6f81413e38c6e78333793a5ba2cee7b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/5574691b6f81413e38c6e78333793a5ba2cee7b5/test_ftpserver.py | ||
print "exception polling in loop(): ", data | nerr += 1 if nerr > 100: for socket in asyncore.socket_map.values(): if not isinstance(socket, trigger): try: socket.close() except: pass break | def loop(self): self.thread_started.set() import select from errno import EBADF while self.run_loop: self.counter = self.counter + 1 # print 'loop', self.counter try: asyncore.poll(0.1) except select.error, data: if data[0] == EBADF: print "exception polling in loop(): ", data else: raise | 5574691b6f81413e38c6e78333793a5ba2cee7b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/5574691b6f81413e38c6e78333793a5ba2cee7b5/test_ftpserver.py |
opts, args = getopt(args.split(), 'lad') | opts, args = getopt(args.split(), 'Llad') | def cmd_list(self, args, long=1): 'See IFTPCommandHandler' opts = () if args.strip().startswith('-'): try: opts, args = getopt(args.split(), 'lad') except GetoptError: self.reply('ERR_ARGS') return if len(args) > 1: self.reply('ERR_ARGS') return args = args and args[0] or '' | f3af88297f12ad9c8a43ec54c2d8985f15722390 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/f3af88297f12ad9c8a43ec54c2d8985f15722390/server.py |
"""An error occured, but we are still trying to fix it. | """An error occurred, but we are still trying to fix it. | def handle_error(): """An error occured, but we are still trying to fix it. """ | a01a868358925bf13564d314019843a6e6c6a48c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/a01a868358925bf13564d314019843a6e6c6a48c/__init__.py |
asyncore.poll(0.1) | poll(0.1) | def setUp(self): td.setThreadCount(4) if len(socket_map) != 1: # Let sockets die off. # XXX tests should be more careful to clear the socket map. asyncore.poll(0.1) self.orig_map_size = len(socket_map) self.hook_asyncore_error() self.server = EchoHTTPServer(LOCALHOST, SERVER_PORT, task_dispatcher=td, adj=my_adj) if CON... | b87411bec907c243011be3a92f56b6099d9ff01c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9635/b87411bec907c243011be3a92f56b6099d9ff01c/test_httpserver.py |
unittest.deferredResult(factory.deferred) self.assertEquals(factory.status, '200') self.assert_(factory.version.startswith('HTTP/')) self.assertEquals(factory.message, 'OK') self.assertEquals(factory.response_headers['content-length'][0], '10') | return factory.deferred.addCallback(self._cbFactoryInfo, factory) | def testFactoryInfo(self): url = self.getURL('file') scheme, host, port, path = client._parse(url) factory = client.HTTPClientFactory(url) reactor.connectSSL(host, port, factory, ssl.ClientContextFactory()) unittest.deferredResult(factory.deferred) self.assertEquals(factory.status, '200') self.assert_(factory.version.s... | 60726ead410a7bda89f85958b7518c30bf949fc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60726ead410a7bda89f85958b7518c30bf949fc0/test_webclient.py |
self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("one"))), "FOUND IT!") | return client.getPage(self.getHTTP("one") ).addCallback(self.assertEquals, "FOUND IT!" ) | def testHoppingAround(self): self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("one"))), "FOUND IT!") | 60726ead410a7bda89f85958b7518c30bf949fc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60726ead410a7bda89f85958b7518c30bf949fc0/test_webclient.py |
self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("cookiemirror"))), "[]") | return client.getPage(self.getHTTP("cookiemirror") ).addCallback(self.assertEquals, "[]" ) | def testNoCookies(self): self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("cookiemirror"))), "[]") | 60726ead410a7bda89f85958b7518c30bf949fc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60726ead410a7bda89f85958b7518c30bf949fc0/test_webclient.py |
self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("cookiemirror"), cookies={'foo': 'bar', 'baz': 'quux'})), "[('baz', 'quux'), ('foo', 'bar')]") | cookies = {'foo': 'bar', 'baz': 'quux'} return client.getPage(self.getHTTP("cookiemirror"), cookies=cookies ).addCallback(self.assertEquals, "[('baz', 'quux'), ('foo', 'bar')]" ) | def testSomeCookies(self): self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("cookiemirror"), cookies={'foo': 'bar', 'baz': 'quux'})), "[('baz', 'quux'), ('foo', 'bar')]") | 60726ead410a7bda89f85958b7518c30bf949fc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60726ead410a7bda89f85958b7518c30bf949fc0/test_webclient.py |
self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("rawcookiemirror"))), "None") | return client.getPage(self.getHTTP("rawcookiemirror") ).addCallback(self.assertEquals, "None" ) | def testRawNoCookies(self): self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("rawcookiemirror"))), "None") | 60726ead410a7bda89f85958b7518c30bf949fc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60726ead410a7bda89f85958b7518c30bf949fc0/test_webclient.py |
self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("rawcookiemirror"), cookies={'foo': 'bar', 'baz': 'quux'})), "'foo=bar; baz=quux'") | cookies = {'foo': 'bar', 'baz': 'quux'} return client.getPage(self.getHTTP("rawcookiemirror"), cookies=cookies ).addCallback(self.assertEquals, "'foo=bar; baz=quux'" ) | def testRawSomeCookies(self): self.assertEquals(unittest.deferredResult(client.getPage(self.getHTTP("rawcookiemirror"), cookies={'foo': 'bar', 'baz': 'quux'})), "'foo=bar; baz=quux'") | 60726ead410a7bda89f85958b7518c30bf949fc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/60726ead410a7bda89f85958b7518c30bf949fc0/test_webclient.py |
x['__class__'] = 'twisted.web.server.Request' | def getStateToCopyFor(self, issuer): # This is for distrib compatibility x = {} | 9bce3b882e42ce3e1d4be9360a0e26cf7c3a0f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9bce3b882e42ce3e1d4be9360a0e26cf7c3a0f33/compat.py | |
try: from twisted.web import distrib except ImportError: pass else: pb.setCopierForClass(OldRequestAdapter, distrib.Request) | def renderHTTP(self, ctx): request = iweb.IOldRequest(ctx) result = defer.maybeDeferred(self.original.render, request).addCallback( self._handle_NOT_DONE_YET, request) return result | 9bce3b882e42ce3e1d4be9360a0e26cf7c3a0f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9bce3b882e42ce3e1d4be9360a0e26cf7c3a0f33/compat.py | |
return static.File(os.path.join(pw_dir, self.userDirName)) | path = os.path.join(pw_dir, self.userDirName) if not os.path.exists(path): return error.NoResource() return static.File(path) | def getChild(self, name, request): if name == '': return self | 84d6aa16decd063e0f6268889335e54b3482fd4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/84d6aa16decd063e0f6268889335e54b3482fd4e/distrib.py |
protocol.makeConnection(transport, self) | protocol.makeConnection(transport) | def doRead(self): """Called when my socket is ready for reading. | eed197abd27ed8ad4e48323990e729e6eed49cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eed197abd27ed8ad4e48323990e729e6eed49cba/ssl.py |
def getChild(self, path, request): | def getChildWithDefault(self, path, request): | def getChild(self, path, request): res = ResourceScript(self.path, self.registry) return res.getChild(path, request) | e56188189e23ab296c708d7dbdd27a68b8ae7205 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e56188189e23ab296c708d7dbdd27a68b8ae7205/script.py |
return res.getChild(path, request) | return res.getChildWithDefault(path, request) | def getChild(self, path, request): res = ResourceScript(self.path, self.registry) return res.getChild(path, request) | e56188189e23ab296c708d7dbdd27a68b8ae7205 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e56188189e23ab296c708d7dbdd27a68b8ae7205/script.py |
def __str__(self, width=None): if not width: width = int(os.environ.get('COLUMNS', '80')) if hasattr(self, 'subCommands'): cmdDicts = [] for (cmd, short, parser, desc) in self.subCommands: cmdDicts.append( {'long': cmd, 'short': short, 'doc': desc, 'optType': 'command', 'default': None }) chunks = docMakeChunks(cmdDic... | e918dc21657a6b7e984033080f5eb15e61861263 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e918dc21657a6b7e984033080f5eb15e61861263/usage.py | ||
self._helo = (None, self.transport.getPeer().host) | peer = self.transport.getPeer() try: host = peer.host except AttributeError: host = str(peer) self._helo = (None, host) | def connectionMade(self): # Ensure user-code always gets something sane for _helo self._helo = (None, self.transport.getPeer().host) self.sendCode(220, self.greeting()) self.setTimeout(self.timeout) | 5afc748c1da4dadd8f09a9528bf1b615f9e8486d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5afc748c1da4dadd8f09a9528bf1b615f9e8486d/smtp.py |
peer = self.transport.getPeer().host self._helo = (rest, peer) | peer = self.transport.getPeer() try: host = peer.host except AttributeError: host = str(peer) self._helo = (rest, host) | def do_HELO(self, rest): peer = self.transport.getPeer().host self._helo = (rest, peer) self._from = None self._to = [] self.sendCode(250, '%s Hello %s, nice to meet you' % (self.host, peer)) | 5afc748c1da4dadd8f09a9528bf1b615f9e8486d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5afc748c1da4dadd8f09a9528bf1b615f9e8486d/smtp.py |
for e in log.flushErrors(): | for e in twisted.python.log.flushErrors(): | def _runTearDown(self, ignored=None): cleanupDeferred = 0 try: d = self.tearDown() if d is not None and isinstance(d, defer.Deferred): d.addErrback(self.deferredError) d.addBoth(self.cleanup) cleanupDeferred = 1 except: testResult.addError(self, self._exc_info()) for e in log.flushErrors(): self.testResult.addError(sel... | 7bc8f9d76b0e495d6867d9fc98d06d7db2d04f5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7bc8f9d76b0e495d6867d9fc98d06d7db2d04f5b/unittest.py |
return self.errorModelFactory(request.args, outDict, err.value) | mf = self.errorModelFactory(request.args, outDict, err.value) return self.errback(mf) | def _ebModel(err): if err.trap(formmethod.FormException): return self.errorModelFactory(request.args, outDict, err.value) raise err | f96906f92d681a57c05353e4f6ec0a491a43b53f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f96906f92d681a57c05353e4f6ec0a491a43b53f/form.py |
return tapestry._ChildJuggler(outObj) | return tapestry._ChildJuggler(outObj).render(request) | def _ebModel(err): if err.trap(formmethod.FormException): return self.errorModelFactory(request.args, outDict, err.value) raise err | f96906f92d681a57c05353e4f6ec0a491a43b53f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f96906f92d681a57c05353e4f6ec0a491a43b53f/form.py |
del reapProcessHandlers[pid] | unregisterReapProcessHandler(pid, self) | def reapProcess(self): """Try to reap a process (without blocking) via waitpid. | e1a61ee5676ecb7ee8a427aa0d8ec5e93d80ed3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e1a61ee5676ecb7ee8a427aa0d8ec5e93d80ed3f/process.py |
exitCode = os.WEXITSTATUS(self.status) | exitCode = os.WEXITSTATUS(self.status) | def maybeCallProcessEnded(self): # we don't call ProcessProtocol.processEnded until: # the child has terminated, AND # all writers have indicated an error status, AND # all readers have indicated EOF # This insures that we've gathered all output from the process. | e1a61ee5676ecb7ee8a427aa0d8ec5e93d80ed3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e1a61ee5676ecb7ee8a427aa0d8ec5e93d80ed3f/process.py |
del reapProcessHandlers[pid] | unregisterReapProcessHandler(self.pid, self) | def reapProcess(self): """Try to reap a process (without blocking) via waitpid. | e1a61ee5676ecb7ee8a427aa0d8ec5e93d80ed3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e1a61ee5676ecb7ee8a427aa0d8ec5e93d80ed3f/process.py |
def findAGoodName(x): return getattr(x, 'tapname', getattr(x, 'name', getattr(x, 'module'))) | return tapLookup | def findAGoodName(x): return getattr(x, 'tapname', getattr(x, 'name', getattr(x, 'module'))) | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
def getModule(type): | def getModule(tapLookup, type): | def getModule(type): try: mod = tapLookup[type].load() return mod except KeyError: print """Please select one of: %s""" % string.join(tapMods) sys.exit(2) | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
print """Please select one of: %s""" % string.join(tapMods) | print """Please select one of: %s""" % string.join(tapLookup.keys()) | def getModule(type): try: mod = tapLookup[type].load() return mod except KeyError: print """Please select one of: %s""" % string.join(tapMods) sys.exit(2) | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
['append', 'a', None, "An existing .tap file to append the plugin to, rather than creating a new one."], | ['append', 'a', None, "An existing .tap file to append the plugin to, rather than creating a new one."], | def getModule(type): try: mod = tapLookup[type].load() return mod except KeyError: print """Please select one of: %s""" % string.join(tapMods) sys.exit(2) | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
optFlags = [['xml', 'x', "DEPRECATED: same as --type=xml"], ['source', 's', "DEPRECATED: same as --type=source"], ['encrypted', 'e', "Encrypt file before writing"]] | optFlags = [['xml', 'x', "DEPRECATED: same as --type=xml"], ['source', 's', "DEPRECATED: same as --type=source"], ['encrypted', 'e', "Encrypt file before writing"], ['progress', 'p', "Show progress of plugin loading"], ['debug', 'd', "Show debug information for plugin loading"]] | def getModule(type): try: mod = tapLookup[type].load() return mod except KeyError: print """Please select one of: %s""" % string.join(tapMods) sys.exit(2) | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
subCommands = [ [x, None, (lambda obj = y: obj.load().Options()), getattr(y, 'description', '')] for (x, y) in tapLookup.items() ] subCommands.sort() | def __init__(self, tapLookup): usage.Options.__init__(self) self.subCommands = [] for (x, y) in tapLookup.items(): self.subCommands.append( [x, None, (lambda obj = y: obj.load().Options()), getattr(y, 'description', '')] ) self.subCommands.sort() self['help'] = 0 | def getModule(type): try: mod = tapLookup[type].load() return mod except KeyError: print """Please select one of: %s""" % string.join(tapMods) sys.exit(2) | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
def __init__(self): usage.Options.__init__(self) self['help'] = 0 | def __init__(self): usage.Options.__init__(self) self['help'] = 0 # default | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py | |
options = GeneralOptions() | tapLookup = loadPlugins() options = GeneralOptions(tapLookup) | def run(): options = GeneralOptions() if hasattr(os, 'getgid'): options['uid'] = os.getuid() options['gid'] = os.getgid() try: options.parseOptions(sys.argv[1:]) except Exception, e: # XXX: While developing, I find myself frequently disabling # this except block when I want to see what screwed up code # caused my updat... | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
mod = getModule(options.subCommand) | mod = getModule(tapLookup, options.subCommand) | def run(): options = GeneralOptions() if hasattr(os, 'getgid'): options['uid'] = os.getuid() options['gid'] = os.getgid() try: options.parseOptions(sys.argv[1:]) except Exception, e: # XXX: While developing, I find myself frequently disabling # this except block when I want to see what screwed up code # caused my updat... | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py |
def run(): options = GeneralOptions() if hasattr(os, 'getgid'): options['uid'] = os.getuid() options['gid'] = os.getgid() try: options.parseOptions(sys.argv[1:]) except Exception, e: # XXX: While developing, I find myself frequently disabling # this except block when I want to see what screwed up code # caused my updat... | 65a70796f6fda77dd59f199e2703a3efc83a3b84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/65a70796f6fda77dd59f199e2703a3efc83a3b84/mktap.py | ||
usage.Options.parseOptions(self, options or sys.argv[1:] or ["--help"]) | if options is None: options = sys.argv[1:] or ["--help"] usage.Options.parseOptions(self, options) | def parseOptions(self, options=None): usage.Options.parseOptions(self, options or sys.argv[1:] or ["--help"]) | b8798ca5637dfb04aa2915ec0004ad79f5711b41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/b8798ca5637dfb04aa2915ec0004ad79f5711b41/app.py |
self.reactor.addEvent(self.hProcess, self, self.inConnectionLost) | self.reactor.addEvent(self.hProcess, self, 'inConnectionLost') | def __init__(self, reactor, protocol, command, args, environment, path): self.reactor = reactor self.protocol = protocol | bb1575a356a7ab4d6ff125dcbdaf4eb29fe806ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/bb1575a356a7ab4d6ff125dcbdaf4eb29fe806ac/win32eventreactor.py |
def install(self): | def install(): | def install(self): threadable.init(1) # change when we redo process stuff - process is probably # borked anyway. process.Process = Process r = Win32Reactor() import main main.installReactor(r) | ccf3106635058457329a15f30e168ed4ab6470fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ccf3106635058457329a15f30e168ed4ab6470fd/win32.py |
addEvent(self.hProcess, self, self.connectionLostNotify) | from twisted.internet import reactor reactor.addEvent(self.hProcess, self, self.connectionLostNotify) | def __init__(self, command, args, environment, path): # security attributes for pipes sAttrs = win32security.SECURITY_ATTRIBUTES() sAttrs.bInheritHandle = 1 | ccf3106635058457329a15f30e168ed4ab6470fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ccf3106635058457329a15f30e168ed4ab6470fd/win32.py |
def install(): reactor = Win32Reactor() reactor.install() __all__ = ["Win32Reactor"] | __all__ = ["Win32Reactor", "install"] | def install(): reactor = Win32Reactor() reactor.install() | ccf3106635058457329a15f30e168ed4ab6470fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ccf3106635058457329a15f30e168ed4ab6470fd/win32.py |
server supports the STARTTLS capability and our transport support | server supports the STARTTLS capability and our transport supports | def login(self, username, password): """Authenticate with the server using a username and password | 1405262c36de4e604a83c0d116c526285625b54f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1405262c36de4e604a83c0d116c526285625b54f/imap4.py |
pass | """Called when the server has sent us a greeting. @type caps: C{dict} @param caps: Capabilities the server advertised in its greeting. """ | def serverGreeting(self, caps): pass | 1405262c36de4e604a83c0d116c526285625b54f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1405262c36de4e604a83c0d116c526285625b54f/imap4.py |
channelOpenData = packOpen_direct_tcpip(self.hostport, addr) | addrTuple = (addr.host, addr.port) channelOpenData = packOpen_direct_tcpip(self.hostport, addrTuple) | def buildProtocol(self, addr): channel = self.klass(conn = self.conn) client = SSHForwardingClient(channel) channel.client = client channelOpenData = packOpen_direct_tcpip(self.hostport, addr) self.conn.openChannel(channel, channelOpenData) return client | 342d11a77844329ff680d99f6fd97c24fdbb64cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/342d11a77844329ff680d99f6fd97c24fdbb64cf/forwarding.py |
self.length = self.length * (10**len(m.group(1))) + int(m.group(1)) | self.length = self.length * (10**len(m.group(1))) + long(m.group(1)) | def doLength(self): m = NUMBER.match(self.__data) if not m.end(): if DEBUG: raise NetstringParseError(repr(self.__data)) else: raise NetstringParseError self.__data = self.__data[m.end():] if m.group(1): self.length = self.length * (10**len(m.group(1))) + int(m.group(1)) if m.group(2): self.__buffer = '' self.mode = DA... | 86c585b8fefc05ad91f994028ebd14b62837fa6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/86c585b8fefc05ad91f994028ebd14b62837fa6b/basic.py |
resp = http.Response(responsecode.UNAUTHORIZED) authHeaders = [] for factory in self.factories.itervalues(): authHeaders.append((factory.scheme, factory.getChallenge(req.remoteAddr))) resp.headers.setHeader('www-authenticate', authHeaders) return resp | return UnauthorizedResponse(self.factories, req.remoteAddr) | def render(self, req): resp = http.Response(responsecode.UNAUTHORIZED) | 850ad8c756e27e41d4691b6d62b8953359d28acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/850ad8c756e27e41d4691b6d62b8953359d28acd/wrapper.py |
self.fail("Incorrect content-type for PROPFIND response (%s != %s)" % (response.code, responsecode.MULTI_STATUS)) | self.fail("Incorrect content-type for PROPFIND response (%r not in %r)" % (content_type, (MimeType("text", "xml"), MimeType("application", "xml")))) | def check_result(response): response = IResponse(response) | 6554fadb02bdcfb091a06546480d31265db18bba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6554fadb02bdcfb091a06546480d31265db18bba/test_prop.py |
print "SR DEBUG:", se.args[0], EWOULDBLOCK, EALREADY, EINPROGRESS | def doConnect(self): """I connect the socket. Then, call the protocol's makeConnection, and start waiting for data. """ try: self.socket.connect(self.addr) except socket.error, se: print "SR DEBUG:", se.args[0], EWOULDBLOCK, EALREADY, EINPROGRESS if se.args[0] == EMYSTERY: self.startWriting() elif se.args[0] in (EWOUL... | a6b07320e3f6e231b166101f95d3d91b61285a09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a6b07320e3f6e231b166101f95d3d91b61285a09/tcp.py | |
self.writer('\\begin{center}\\raisebox{1ex}[1ex]{%s --- ' '\\begin{em}%s\\end{em}}\\end{center}' | self.writer('\parbox[b]{\linewidth}{\\begin{center}%s --- ' '\\begin{em}%s\\end{em}\\end{center}}' | def visitNode_a_listing(self, node): fileName = os.path.join(self.currDir, node.getAttribute('href')) self.writer('\\begin{verbatim}\n') lines = map(string.rstrip, open(fileName).readlines()) lines = lines[int(node.getAttribute('skipLines', 0)):] self.writer(text.removeLeadingTrailingBlanks('\n'.join(lines))) self.writ... | c10d203fa44406cd5e4c0a3e13a76f9ef55955d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c10d203fa44406cd5e4c0a3e13a76f9ef55955d7/latex.py |
start_title = end_title = end_body = start_body = start_html = None | end_title = end_body = start_body = start_html = None | def visitNode_title(self, node): self.visitNodeDefault(node) self.writer('\\label{%s}}\n' % os.path.basename(self.filename)) | c10d203fa44406cd5e4c0a3e13a76f9ef55955d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c10d203fa44406cd5e4c0a3e13a76f9ef55955d7/latex.py |
def getIO(self): return sys.stdout.getvalue() + sys.stderr.getvalue() | def getIO(self): return sys.stdout.getvalue() + sys.stderr.getvalue() | e9ca215c92f5792d6a1fe1c71650a26522d30412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e9ca215c92f5792d6a1fe1c71650a26522d30412/test_trial.py | |
"""please ignore the following warnings, we're testing method-level warning suppression""" | def testSuppressMethod(self): """please ignore the following warnings, we're testing method-level warning suppression""" self.suite.run(self.loader.loadMethod( suppression.TestSuppression.testSuppressMethod)) assertNotSubstring(suppression.METHOD_WARNING_MSG, self.getIO()) assertSubstring(suppression.CLASS_WARNING_MSG,... | e9ca215c92f5792d6a1fe1c71650a26522d30412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e9ca215c92f5792d6a1fe1c71650a26522d30412/test_trial.py | |
"""please ignore the following warnings, we're testing class-level warning suppression""" | def testSuppressClass(self): """please ignore the following warnings, we're testing class-level warning suppression""" self.suite.run(self.loader.loadMethod( suppression.TestSuppression.testSuppressClass)) assertSubstring(suppression.METHOD_WARNING_MSG, self.getIO()) assertNotSubstring(suppression.CLASS_WARNING_MSG, se... | e9ca215c92f5792d6a1fe1c71650a26522d30412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e9ca215c92f5792d6a1fe1c71650a26522d30412/test_trial.py | |
"""please ignore the following warnings, we're testing module-level warning suppression""" | def testSuppressModule(self): """please ignore the following warnings, we're testing module-level warning suppression""" self.suite.run(self.loader.loadMethod( suppression.TestSuppression2.testSuppressModule)) assertSubstring(suppression.METHOD_WARNING_MSG, self.getIO()) assertSubstring(suppression.CLASS_WARNING_MSG, s... | e9ca215c92f5792d6a1fe1c71650a26522d30412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e9ca215c92f5792d6a1fe1c71650a26522d30412/test_trial.py | |
"""please ignore the following warnings, we're testing override of warning suppression""" | def testOverrideSuppressClass(self): """please ignore the following warnings, we're testing override of warning suppression""" self.suite.run(self.loader.loadMethod( suppression.TestSuppression.testOverrideSuppressClass)) assertSubstring(suppression.CLASS_WARNING_MSG, self.getIO()) assertSubstring(suppression.MODULE_WA... | e9ca215c92f5792d6a1fe1c71650a26522d30412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e9ca215c92f5792d6a1fe1c71650a26522d30412/test_trial.py | |
return utils.getProcessOutput(getTrialPath(), args=args, errortoo=1, | params = [ '-c', 'from twisted.scripts.trial import run; run()' ] params.extend(args) return utils.getProcessOutput(sys.executable, args=params, errortoo=1, | def runTrialWithEnv(env, *args): return utils.getProcessOutput(getTrialPath(), args=args, errortoo=1, env=env) | 385bb0fcea4b2de5eb215b831ad577f7f549b7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/385bb0fcea4b2de5eb215b831ad577f7f549b7e0/test_output.py |
path = self._getMockPath() | def _getMockEnvironment(self): path = self._getMockPath() env = os.environ.copy() if not env.has_key('PYTHONPATH'): env['PYTHONPATH'] = path else: env['PYTHONPATH'] += os.pathsep + path return env | 385bb0fcea4b2de5eb215b831ad577f7f549b7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/385bb0fcea4b2de5eb215b831ad577f7f549b7e0/test_output.py | |
if not env.has_key('PYTHONPATH'): env['PYTHONPATH'] = path else: env['PYTHONPATH'] += os.pathsep + path | path = [self._getMockPath()] + sys.path env['PYTHONPATH'] = os.pathsep.join(path) | def _getMockEnvironment(self): path = self._getMockPath() env = os.environ.copy() if not env.has_key('PYTHONPATH'): env['PYTHONPATH'] = path else: env['PYTHONPATH'] += os.pathsep + path return env | 385bb0fcea4b2de5eb215b831ad577f7f549b7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/385bb0fcea4b2de5eb215b831ad577f7f549b7e0/test_output.py |
return self._runTrial(os.environ, *args) | env = os.environ.copy() env['PYTHONPATH'] = os.pathsep.join(sys.path) return self._runTrial(env, *args) | def runTrialPure(self, *args): return self._runTrial(os.environ, *args) | 385bb0fcea4b2de5eb215b831ad577f7f549b7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/385bb0fcea4b2de5eb215b831ad577f7f549b7e0/test_output.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.