rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
self._out.write('<?xml version="1.0" encoding="iso-8859-1"?>\n') | self._out.write('<?xml version="1.0" encoding="%s"?>\n' % self._encoding) | def startDocument(self): self._out.write('<?xml version="1.0" encoding="iso-8859-1"?>\n') | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py |
pass | self._ns_contexts.append(self._current_context.copy()) self._current_context[uri] = prefix | def startPrefixMapping(self, prefix, uri): pass | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py |
pass | del self._current_context[-1] | def endPrefixMapping(self, prefix): pass | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py |
if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname) | def startElement(self, name, attrs): if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname) self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>') | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py | |
def startElement(self, name, attrs): if type(name) is type(()): uri, localname, prefix = name name = "%s:%s"%(prefix,localname) self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s="%s"' % (name, escape(value))) self._out.write('>') | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py | ||
def endElement(self, name): # FIXME: not namespace friendly yet self._out.write('</%s>' % name) | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py | ||
def endElement(self, name, qname): self._cont_handler.endElement(name, qname) | def endElement(self, name): self._cont_handler.endElement(name) def startElementNS(self, name, qname, attrs): self._cont_handler.startElement(name, attrs) def endElementNS(self, name, qname): self._cont_handler.endElementNS(name, qname) | def endElement(self, name, qname): self._cont_handler.endElement(name, qname) | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py |
last.data = string.rstrip(last.data) + "\n " | last.data = last.data.rstrip() + "\n " | def rewrite_descriptor(doc, descriptor): # # Do these things: # 1. Add an "index='no'" attribute to the element if the tagName # ends in 'ni', removing the 'ni' from the name. # 2. Create a <signature> from the name attribute # 2a.Create an <args> if it appears to be available. # 3. Create additional <sign... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
and not string.strip(nodes[0].data): | and not nodes[0].data.strip(): | def handle_appendix(doc, fragment): # must be called after simplfy() if document is multi-rooted to begin with docelem = get_documentElement(fragment) toplevel = docelem.tagName == "manual" and "chapter" or "section" appendices = 0 nodes = [] for node in docelem.childNodes: if appendices: nodes.append(node) elif node.n... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
children[-1].data = string.rstrip(children[-1].data) def fixup_trailing_whitespace(doc, wsmap): queue = [doc] | children[-1].data = children[-1].data.rstrip() def fixup_trailing_whitespace(doc, fragment, wsmap): queue = [fragment] fixups = [] | def handle_labels(doc, fragment): for label in find_all_elements(fragment, "label"): id = label.getAttribute("id") if not id: continue parent = label.parentNode parentTagName = parent.tagName if parentTagName == "title": parent.parentNode.setAttribute("id", id) else: parent.setAttribute("id", id) # now, remove <label i... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
ws = wsmap[node.tagName] children = node.childNodes children.reverse() if children[0].nodeType == TEXT: data = string.rstrip(children[0].data) + ws children[0].data = data children.reverse() if node.tagName == "title" \ and node.parentNode.firstChild.nodeType == ELEMENT: node.parentNode.insertBefore(doc.createText("\n... | fixups.append(node) | def fixup_trailing_whitespace(doc, wsmap): queue = [doc] while queue: node = queue[0] del queue[0] if wsmap.has_key(node.nodeName): ws = wsmap[node.tagName] children = node.childNodes children.reverse() if children[0].nodeType == TEXT: data = string.rstrip(children[0].data) + ws children[0].data = data children.reverse... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
first_data.data = string.lstrip(first_data.data[4:]) | first_data.data = first_data.data[4:].lstrip() | def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return set_tagName(node, "synopsis") lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_elem... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
if len(string.lstrip(data)) < (len(data) - 4): nextnode.data = "\n\n\n" + string.lstrip(data) | s = data.lstrip() if len(s) < (len(data) - 4): nextnode.data = "\n\n\n" + s | def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return set_tagName(node, "synopsis") lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_elem... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
if string.strip(child.data): | if child.data.strip(): | def fixup_table(doc, table): # create the table head thead = doc.createElement("thead") row = doc.createElement("row") move_elements_by_name(doc, table, row, "entry") thead.appendChild(doc.createTextNode("\n ")) thead.appendChild(row) thead.appendChild(doc.createTextNode("\n ")) # create the table body tbody = do... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
pos = string.find(child.data, "\n\n") | pos = child.data.find("\n\n") | def build_para(doc, parent, start, i): children = parent.childNodes after = start + 1 have_last = 0 BREAK_ELEMENTS = PARA_LEVEL_ELEMENTS + RECURSE_INTO_PARA_CONTAINERS # Collect all children until \n\n+ is found in a text node or a # member of BREAK_ELEMENTS is found. for j in range(start, i): after = j + 1 child = chi... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
if string.rstrip(data) != data: | if data.rstrip() != data: | def build_para(doc, parent, start, i): children = parent.childNodes after = start + 1 have_last = 0 BREAK_ELEMENTS = PARA_LEVEL_ELEMENTS + RECURSE_INTO_PARA_CONTAINERS # Collect all children until \n\n+ is found in a text node or a # member of BREAK_ELEMENTS is found. for j in range(start, i): after = j + 1 child = chi... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
child.splitText(len(string.rstrip(data))) | child.splitText(len(data.rstrip())) | def build_para(doc, parent, start, i): children = parent.childNodes after = start + 1 have_last = 0 BREAK_ELEMENTS = PARA_LEVEL_ELEMENTS + RECURSE_INTO_PARA_CONTAINERS # Collect all children until \n\n+ is found in a text node or a # member of BREAK_ELEMENTS is found. for j in range(start, i): after = j + 1 child = chi... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
shortened = string.lstrip(data) | shortened = data.lstrip() | def skip_leading_nodes(children, start=0): """Return index into children of a node at which paragraph building should begin or a recursive call to fixup_paras_helper() should be made (for subsections, etc.). When the return value >= len(children), we've built all the paras we can from this list of children. """ i = le... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
and string.lstrip(child.data)[:3] == ">>>": | and child.data.lstrip().startswith(">>>"): | def fixup_verbatims(doc): for verbatim in find_all_elements(doc, "verbatim"): child = verbatim.childNodes[0] if child.nodeType == TEXT \ and string.lstrip(child.data)[:3] == ">>>": set_tagName(verbatim, "interactive-session") | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
fixup_trailing_whitespace(doc, { "abstract": "\n", "title": "", "chapter": "\n\n", "section": "\n\n", "subsection": "\n\n", "subsubsection": "\n\n", "paragraph": "\n\n", "subparagraph": "\n\n", | fixup_trailing_whitespace(doc, fragment, { "abstract": ("\n", "\n"), "title": ("", "\n"), "chapter": ("\n", "\n\n\n"), "section": ("\n", "\n\n\n"), "subsection": ("\n", "\n\n"), "subsubsection": ("\n", "\n\n"), "paragraph": ("\n", "\n\n"), "subparagraph": ("\n", "\n\n"), "enumeration": ("\n", "\n\n"), | def convert(ifp, ofp): events = esistools.parse(ifp) toktype, doc = events.getEvent() fragment = doc.createDocumentFragment() events.expandNode(fragment) normalize(fragment) simplify(doc, fragment) handle_labels(doc, fragment) handle_appendix(doc, fragment) fixup_trailing_whitespace(doc, { "abstract": "\n", "title": "... | e1e96851d480a7d1acf8fd96abaeb00c195ae7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1e96851d480a7d1acf8fd96abaeb00c195ae7b1/docfixer.py |
self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqdn, repr(all_host_names))) | self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names))) | def testHostnameRes(self): # Testing hostname resolution mechanisms hostname = socket.gethostname() try: ip = socket.gethostbyname(hostname) except socket.error: # Probably name lookup wasn't set up right; skip this test return self.assert_(ip.find('.') >= 0, "Error resolving host to ip.") try: hname, aliases, ipaddrs ... | 25ef499164c7e4e4119f1b5a7517b746b71a01a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/25ef499164c7e4e4119f1b5a7517b746b71a01a2/test_socket.py |
macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) | do_copy = 0 if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: try: import Dlg rv = Dlg.CautionAlert(ALERT_NONBOOT, None) if rv == ALERT_NONBOOT_COPY: do_copy = 1 except ImportError: pass if do_copy: macostools.copy(os.path.join(sys.exec_prefix, src), dst) else: macostools.mkalias(os.path.join(sys.exec_prefix, src),... | def mkcorealias(src, altsrc): import string import macostools version = string.split(sys.version)[0] dst = getextensiondirfile(src+ ' ' + version) if not os.path.exists(os.path.join(sys.exec_prefix, src)): if not os.path.exists(os.path.join(sys.exec_prefix, altsrc)): if verbose: print '*', src, 'not found' return 0 sr... | 004b26b02e96db8f33797b0b8f09ee4848e33a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/004b26b02e96db8f33797b0b8f09ee4848e33a11/ConfigurePython.py |
print items[i]; i+=1 | b = items[i]; i+=1 | def tightloop_example(): items = range(0, 3) try: i = 0 while 1: print items[i]; i+=1 except IndexError: pass | a6afedc3ad0dabc629733ae27db699c9428b52d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a6afedc3ad0dabc629733ae27db699c9428b52d6/test_trace.py |
'Expected:\n%s\nbut got:\n%s' % ( self.show(result), self.show(expect))) | 'expected:\n%s\nbut got:\n%s' % ( self.show(expect), self.show(result))) | def check(self, result, expect): self.assertEquals(result, expect, 'Expected:\n%s\nbut got:\n%s' % ( self.show(result), self.show(expect))) | c8c8493fe62b16aaf2efac2a4fd3fce0e7a390ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c8c8493fe62b16aaf2efac2a4fd3fce0e7a390ae/test_textwrap.py |
out.write(" | out.write(" | typedef struct | 4345da482e1be84b5663fb351690cc1ba7106857 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4345da482e1be84b5663fb351690cc1ba7106857/GenUCNHash.py |
f.write('z') f.seek(0) f.seek(size) f.write('a') f.flush() if test_support.verbose: print 'check file size with os.fstat' expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1) f.close() | try: f.write('z') f.seek(0) f.seek(size) f.write('a') f.flush() if test_support.verbose: print 'check file size with os.fstat' expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1) finally: f.close() | def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82/test_largefile.py |
expect(f.tell(), 0) expect(f.read(1), 'z') expect(f.tell(), 1) f.seek(0) expect(f.tell(), 0) f.seek(0, 0) expect(f.tell(), 0) f.seek(42) expect(f.tell(), 42) f.seek(42, 0) expect(f.tell(), 42) f.seek(42, 1) expect(f.tell(), 84) f.seek(0, 1) expect(f.tell(), 84) f.seek(0, 2) expect(f.tell(), size + 1 + 0) f.seek(-10, 2)... | try: expect(f.tell(), 0) expect(f.read(1), 'z') expect(f.tell(), 1) f.seek(0) expect(f.tell(), 0) f.seek(0, 0) expect(f.tell(), 0) f.seek(42) expect(f.tell(), 42) f.seek(42, 0) expect(f.tell(), 42) f.seek(42, 1) expect(f.tell(), 84) f.seek(0, 1) expect(f.tell(), 84) f.seek(0, 2) expect(f.tell(), size + 1 + 0) f.seek(-1... | def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82/test_largefile.py |
expect(os.lseek(f.fileno(), 0, 0), 0) expect(os.lseek(f.fileno(), 42, 0), 42) expect(os.lseek(f.fileno(), 42, 1), 84) expect(os.lseek(f.fileno(), 0, 1), 84) expect(os.lseek(f.fileno(), 0, 2), size+1+0) expect(os.lseek(f.fileno(), -10, 2), size+1-10) expect(os.lseek(f.fileno(), -size-1, 2), 0) expect(os.lseek(f.fileno()... | try: expect(os.lseek(f.fileno(), 0, 0), 0) expect(os.lseek(f.fileno(), 42, 0), 42) expect(os.lseek(f.fileno(), 42, 1), 84) expect(os.lseek(f.fileno(), 0, 1), 84) expect(os.lseek(f.fileno(), 0, 2), size+1+0) expect(os.lseek(f.fileno(), -10, 2), size+1-10) expect(os.lseek(f.fileno(), -size-1, 2), 0) expect(os.lseek(f.fil... | def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82/test_largefile.py |
f.seek(0, 2) expect(f.tell(), size+1) newsize = size - 10 f.seek(newsize) f.truncate() expect(f.tell(), newsize) f.seek(0, 2) expect(f.tell(), newsize) newsize -= 1 f.seek(42) f.truncate(newsize) expect(f.tell(), 42) f.seek(0, 2) expect(f.tell(), newsize) | try: f.seek(0, 2) expect(f.tell(), size+1) newsize = size - 10 f.seek(newsize) f.truncate() expect(f.tell(), newsize) f.seek(0, 2) expect(f.tell(), newsize) newsize -= 1 f.seek(42) f.truncate(newsize) expect(f.tell(), 42) f.seek(0, 2) expect(f.tell(), newsize) | def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82/test_largefile.py |
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82/test_largefile.py | ||
f.seek(0) f.truncate(1) expect(f.tell(), 0) expect(len(f.read()), 1) | f.seek(0) f.truncate(1) expect(f.tell(), 0) expect(len(f.read()), 1) | def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82/test_largefile.py |
f.close() | finally: f.close() | def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes' | ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff103ab74a6a7ae0cf2554d09fd494b02b8d8a82/test_largefile.py |
self.assertEqual(binascii.a2b_qp("= "), "") | self.assertEqual(binascii.a2b_qp("= "), "= ") | def test_qp(self): # A test for SF bug 534347 (segfaults without the proper fix) try: binascii.a2b_qp("", **{1:1}) except TypeError: pass else: self.fail("binascii.a2b_qp(**{1:1}) didn't raise TypeError") self.assertEqual(binascii.a2b_qp("= "), "") self.assertEqual(binascii.a2b_qp("=="), "=") self.assertEqual(binascii.... | 78b254d4629d9e4abca56ad8a5a5295b804a9d04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/78b254d4629d9e4abca56ad8a5a5295b804a9d04/test_binascii.py |
l.grid(row=self.row, col=0, sticky="nw") | l.grid(row=self.row, column=0, sticky="nw") | def make_entry(self, label, var): l = Label(self.top, text=label) l.grid(row=self.row, col=0, sticky="nw") e = Entry(self.top, textvariable=var, exportselection=0) e.grid(row=self.row, col=1, sticky="nwe") self.row = self.row + 1 return e | 2f2e3d01f1ead265363b6a7c9316d64e07abbdfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2f2e3d01f1ead265363b6a7c9316d64e07abbdfc/SearchDialogBase.py |
e.grid(row=self.row, col=1, sticky="nwe") | e.grid(row=self.row, column=1, sticky="nwe") | def make_entry(self, label, var): l = Label(self.top, text=label) l.grid(row=self.row, col=0, sticky="nw") e = Entry(self.top, textvariable=var, exportselection=0) e.grid(row=self.row, col=1, sticky="nwe") self.row = self.row + 1 return e | 2f2e3d01f1ead265363b6a7c9316d64e07abbdfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2f2e3d01f1ead265363b6a7c9316d64e07abbdfc/SearchDialogBase.py |
l.grid(row=self.row, col=0, sticky="nw") | l.grid(row=self.row, column=0, sticky="nw") | def make_frame(self,labeltext=None): if labeltext: l = Label(self.top, text=labeltext) l.grid(row=self.row, col=0, sticky="nw") f = Frame(self.top) f.grid(row=self.row, col=1, columnspan=1, sticky="nwe") self.row = self.row + 1 return f | 2f2e3d01f1ead265363b6a7c9316d64e07abbdfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2f2e3d01f1ead265363b6a7c9316d64e07abbdfc/SearchDialogBase.py |
f.grid(row=self.row, col=1, columnspan=1, sticky="nwe") | f.grid(row=self.row, column=1, columnspan=1, sticky="nwe") | def make_frame(self,labeltext=None): if labeltext: l = Label(self.top, text=labeltext) l.grid(row=self.row, col=0, sticky="nw") f = Frame(self.top) f.grid(row=self.row, col=1, columnspan=1, sticky="nwe") self.row = self.row + 1 return f | 2f2e3d01f1ead265363b6a7c9316d64e07abbdfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2f2e3d01f1ead265363b6a7c9316d64e07abbdfc/SearchDialogBase.py |
f.grid(row=0,col=2,padx=2,pady=2,ipadx=2,ipady=2) | f.grid(row=0,column=2,padx=2,pady=2,ipadx=2,ipady=2) | def create_command_buttons(self): # # place button frame on the right f = self.buttonframe = Frame(self.top) f.grid(row=0,col=2,padx=2,pady=2,ipadx=2,ipady=2) | 2f2e3d01f1ead265363b6a7c9316d64e07abbdfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2f2e3d01f1ead265363b6a7c9316d64e07abbdfc/SearchDialogBase.py |
thishost = socket.getfqdn() try: if os.environ.has_key('LOGNAME'): realuser = os.environ['LOGNAME'] elif os.environ.has_key('USER'): realuser = os.environ['USER'] else: realuser = 'anonymous' except AttributeError: realuser = 'anonymous' passwd = passwd + realuser + '@' + thishost | passwd = passwd + 'anonymous@' | def login(self, user = '', passwd = '', acct = ''): '''Login, default anonymous.''' if not user: user = 'anonymous' if not passwd: passwd = '' if not acct: acct = '' if user == 'anonymous' and passwd in ('', '-'): # get fully qualified domain name of local host thishost = socket.getfqdn() try: if os.environ.has_key('LO... | d9933efa7e1551347e4f479da533d91f1bf4f481 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9933efa7e1551347e4f479da533d91f1bf4f481/ftplib.py |
self.announce('Building RPMs') rpm_args = ['rpm',] | self.announce('building RPMs') rpm_cmd = ['rpm'] | def run (self): | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
rpm_args.append('-bs') | rpm_cmd.append('-bs') | def run (self): | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
rpm_args.append('-bb') | rpm_cmd.append('-bb') | def run (self): | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
rpm_args.append('-ba') | rpm_cmd.append('-ba') | def run (self): | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
rpm_args.extend(['--define', | rpm_cmd.extend(['--define', | def run (self): | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
rpm_args.append('--clean') rpm_args.append(spec_path) self.spawn(rpm_args) | rpm_cmd.append('--clean') rpm_cmd.append(spec_path) self.spawn(rpm_cmd) | def run (self): | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
def_build = 'env CFLAGS="$RPM_OPT_FLAGS" python setup.py build' else: def_build = 'python setup.py build' | def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build | def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + se... | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
"python setup.py install " "--root=$RPM_BUILD_ROOT " "--record=INSTALLED_FILES"), | ("%s setup.py install " "--root=$RPM_BUILD_ROOT " "--record=INSTALLED_FILES") % self.python), | def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + se... | 742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/742f4c9a5d5b54c907d463255f31d9fcfa1f2ce9/bdist_rpm.py |
if (os.path.exists('Modules/_curses_panel.c') and module_enabled(exts, '_curses') and | if (module_enabled(exts, '_curses') and | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | a2da3b29c303d06ff9efc08ef57a42cf0ba658f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a2da3b29c303d06ff9efc08ef57a42cf0ba658f8/setup.py |
otherwise return - (the signal that killed it). """ | otherwise return -SIG, where SIG is the signal that killed it. """ | def spawnv(mode, file, args): """spawnv(mode, file, args) -> integer | f59a3d3a833649dc24e836f5477461f77a3b6f79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f59a3d3a833649dc24e836f5477461f77a3b6f79/os.py |
self.assertRaises(TypeError, u'hello'.count, 42) | self.assertRaises(TypeError, u'hello'.title, 42) | def test_title(self): self.checkmethod('title', u' hello ', u' Hello ') self.checkmethod('title', u'Hello ', u'Hello ') self.checkmethod('title', u'hello ', u'Hello ') self.checkmethod('title', u"fOrMaT thIs aS titLe String", u'Format This As Title String') self.checkmethod('title', u"fOrMaT,thIs-aS*titLe;String", u'Fo... | 1a96f22da87ede904d7b5dc167ad9dba6e0161cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a96f22da87ede904d7b5dc167ad9dba6e0161cb/test_unicode.py |
def writelines(self, list): self.write(''.join(list)) | def writelines(self, iterable): write = self.write for line in iterable: write(line) | def writelines(self, list): self.write(''.join(list)) | 6e4f346de768868055382c814492cdcd487d75b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e4f346de768868055382c814492cdcd487d75b6/StringIO.py |
if sys.platform == 'win32': reuse_constant = socket.SO_EXCLUSIVEADDRUSE else: reuse_constant = socket.SO_REUSEADDR | def set_reuse_addr(self): # try to re-use a server port if possible try: # Windows SO_REUSEADDR is very broken (from a unixy perspective) if sys.platform == 'win32': reuse_constant = socket.SO_EXCLUSIVEADDRUSE else: reuse_constant = socket.SO_REUSEADDR | df0cad0160fdd119e13bfe8b3ae6c6469e4f4a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df0cad0160fdd119e13bfe8b3ae6c6469e4f4a08/asyncore.py | |
socket.SOL_SOCKET, reuse_constant, | socket.SOL_SOCKET, socket.SO_REUSEADDR, | def set_reuse_addr(self): # try to re-use a server port if possible try: # Windows SO_REUSEADDR is very broken (from a unixy perspective) if sys.platform == 'win32': reuse_constant = socket.SO_EXCLUSIVEADDRUSE else: reuse_constant = socket.SO_REUSEADDR | df0cad0160fdd119e13bfe8b3ae6c6469e4f4a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df0cad0160fdd119e13bfe8b3ae6c6469e4f4a08/asyncore.py |
reuse_constant) | 1 | socket.SO_REUSEADDR) | 1 | def set_reuse_addr(self): # try to re-use a server port if possible try: # Windows SO_REUSEADDR is very broken (from a unixy perspective) if sys.platform == 'win32': reuse_constant = socket.SO_EXCLUSIVEADDRUSE else: reuse_constant = socket.SO_REUSEADDR | df0cad0160fdd119e13bfe8b3ae6c6469e4f4a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df0cad0160fdd119e13bfe8b3ae6c6469e4f4a08/asyncore.py |
global DEBUG | def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] except KeyError: con... | ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f/asyncore.py | |
r,w,e = select.select (r,w,e, timeout) | try: r,w,e = select.select (r,w,e, timeout) except select.error, err: if err[0] != EINTR: raise | def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] except KeyError: con... | ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f/asyncore.py |
r = pollster.poll (timeout) | try: r = pollster.poll (timeout) except select.error, err: if err[0] != EINTR: raise r = [] | def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.PO... | ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f/asyncore.py |
self.__dict__['socket'] = sock | self.socket = sock | def set_socket (self, sock, map=None): self.__dict__['socket'] = sock self._fileno = sock.fileno() self.add_channel (map) | ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac0aed1c3f79b76bc0826eed6ac8ae0955a0794f/asyncore.py |
if os.environ.has_key('CFLAGS'): extra_args.extend(string.split(os.environ['CFLAGS'])) | for undef in ext.undef_macros: macros.append((undef,)) | bf41dfc15395212bb4b33d495228cdc6b32d5297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf41dfc15395212bb4b33d495228cdc6b32d5297/build_ext.py | |
for undef in ext.undef_macros: macros.append((undef,)) | bf41dfc15395212bb4b33d495228cdc6b32d5297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf41dfc15395212bb4b33d495228cdc6b32d5297/build_ext.py | ||
print testtar | def path(path): return test_support.findfile(path) | 2fba3679b0d92fbc130cf51ece85a9db92dbb8c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fba3679b0d92fbc130cf51ece85a9db92dbb8c3/test_tarfile.py | |
state = [kThemeStateActive, kThemeStateInactive][not onoff] App.DrawThemeListBoxFrame(Qd.InsetRect(self._bounds, 1, 1), state) | def activate(self, onoff): self._activated = onoff if self._visible: self._list.LActivate(onoff) state = [kThemeStateActive, kThemeStateInactive][not onoff] App.DrawThemeListBoxFrame(Qd.InsetRect(self._bounds, 1, 1), state) if self._selected: self.drawselframe(onoff) | 43cea304a8f0e7986bc8f1e1feb8cc608e792c7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43cea304a8f0e7986bc8f1e1feb8cc608e792c7a/Wlists.py | |
if (not check_intermediate) or len(plist) < 2: | if not check_intermediate: | def __init__(self, master, name, destroy_physically=1, check_intermediate=1): if check_intermediate: path = master._subwidget_name(name) try: path = path[len(master._w)+1:] plist = path.split('.') except: plist = [] | 42dabb86e35d06f7e575f35def42dbf3dbec7167 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/42dabb86e35d06f7e575f35def42dbf3dbec7167/Tix.py |
self.file = self.make_file('') | self.file = self.__file = StringIO() | def read_lines(self): """Internal: read lines until EOF or outerboundary.""" self.file = self.make_file('') if self.outerboundary: self.read_lines_to_outerboundary() else: self.read_lines_to_eof() | 9f92bf9e5f618782db742393dbb8c7738b9d372c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9f92bf9e5f618782db742393dbb8c7738b9d372c/cgi.py |
self.file.write(line) | self.__write(line) | def read_lines_to_eof(self): """Internal: read lines until EOF.""" while 1: line = self.fp.readline() if not line: self.done = -1 break self.file.write(line) | 9f92bf9e5f618782db742393dbb8c7738b9d372c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9f92bf9e5f618782db742393dbb8c7738b9d372c/cgi.py |
self.file.write(odelim + line) | self.__write(odelim + line) | def read_lines_to_outerboundary(self): """Internal: read lines until outerboundary.""" next = "--" + self.outerboundary last = next + "--" delim = "" while 1: line = self.fp.readline() if not line: self.done = -1 break if line[:2] == "--": strippedline = line.strip() if strippedline == next: break if strippedline == la... | 9f92bf9e5f618782db742393dbb8c7738b9d372c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9f92bf9e5f618782db742393dbb8c7738b9d372c/cgi.py |
result = self.__class__([]) | result = self.__class__() | def copy(self): """Return a shallow copy of a set.""" result = self.__class__([]) result._data.update(self._data) return result | 18952fe218a31e2eef50fe38038baad8fa07c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18952fe218a31e2eef50fe38038baad8fa07c355/sets.py |
result = self.__class__([]) | result = self.__class__() | def __deepcopy__(self, memo): """Return a deep copy of a set; used by copy module.""" # This pre-creates the result and inserts it in the memo # early, in case the deep copy recurses into another reference # to this same set. A set can't be an element of itself, but # it can certainly contain an object that has a refe... | 18952fe218a31e2eef50fe38038baad8fa07c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18952fe218a31e2eef50fe38038baad8fa07c355/sets.py |
result = self.__class__([]) | result = self.__class__() | def __and__(self, other): """Return the intersection of two sets as a new set. | 18952fe218a31e2eef50fe38038baad8fa07c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18952fe218a31e2eef50fe38038baad8fa07c355/sets.py |
result = self.__class__([]) | result = self.__class__() | def __xor__(self, other): """Return the symmetric difference of two sets as a new set. | 18952fe218a31e2eef50fe38038baad8fa07c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18952fe218a31e2eef50fe38038baad8fa07c355/sets.py |
result = self.__class__([]) | result = self.__class__() | def __sub__(self, other): """Return the difference of two sets as a new Set. | 18952fe218a31e2eef50fe38038baad8fa07c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18952fe218a31e2eef50fe38038baad8fa07c355/sets.py |
class _TemporarilyImmutableSet(object): | class _TemporarilyImmutableSet(BaseSet): | def _as_temporarily_immutable(self): # Return self wrapped in a temporarily immutable set return _TemporarilyImmutableSet(self) | 18952fe218a31e2eef50fe38038baad8fa07c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18952fe218a31e2eef50fe38038baad8fa07c355/sets.py |
def __eq__(self, other): return self._set == other def __ne__(self, other): return self._set != other def _test(): red = Set() assert `red` == "Set([])", "Empty set: %s" % `red` green = Set((0,)) assert `green` == "Set([0])", "Unit set: %s" % `green` blue = Set([0, 1, 2]) assert blue._repr(True) == "Set([0,... | def __hash__(self): if self._hashcode is None: self._hashcode = self._set._compute_hash() return self._hashcode | 18952fe218a31e2eef50fe38038baad8fa07c355 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18952fe218a31e2eef50fe38038baad8fa07c355/sets.py | |
if n > self.maxlist: s = s + ', ...' | if n > self.maxdict: s = s + ', ...' | def repr_dictionary(self, x, level): n = len(x) if n == 0: return '{}' if level <= 0: return '{...}' s = '' keys = x.keys() keys.sort() for i in range(min(n, self.maxdict)): if s: s = s + ', ' key = keys[i] s = s + self.repr1(key, level-1) s = s + ': ' + self.repr1(x[key], level-1) if n > self.maxlist: s = s + ', ...' ... | bf26a2856c046664bc9edc6be5e16f1759bc776f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf26a2856c046664bc9edc6be5e16f1759bc776f/repr.py |
for option in options: yield (option, d[option]) | return [(option, d[option]) for option in options] | def items(self, section, raw=False, vars=None): """Return a list of tuples with (name, value) for each option in the section. | a560b850f17ed7b36e3c373b318e9462badb63a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a560b850f17ed7b36e3c373b318e9462badb63a9/ConfigParser.py |
for option in options: yield (option, self._interpolate(section, option, d[option], d)) | return [(option, self._interpolate(section, option, d[option], d)) for option in options] | def items(self, section, raw=False, vars=None): """Return a list of tuples with (name, value) for each option in the section. | a560b850f17ed7b36e3c373b318e9462badb63a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a560b850f17ed7b36e3c373b318e9462badb63a9/ConfigParser.py |
def main(): testtype('c', 'c') for type in (['b', 'h', 'i', 'l', 'f', 'd']): testtype(type, 1) unlink(TESTFN) | e810214ce1e279f9c5e7a87fdaa44ca7b3bec2d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e810214ce1e279f9c5e7a87fdaa44ca7b3bec2d0/test_array.py | ||
testtype('u', u'\u263a') | def main(): testtype('c', 'c') for type in (['b', 'h', 'i', 'l', 'f', 'd']): testtype(type, 1) unlink(TESTFN) | e810214ce1e279f9c5e7a87fdaa44ca7b3bec2d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e810214ce1e279f9c5e7a87fdaa44ca7b3bec2d0/test_array.py | |
testunicode() testsubclassing() | def main(): testtype('c', 'c') for type in (['b', 'h', 'i', 'l', 'f', 'd']): testtype(type, 1) unlink(TESTFN) | e810214ce1e279f9c5e7a87fdaa44ca7b3bec2d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e810214ce1e279f9c5e7a87fdaa44ca7b3bec2d0/test_array.py | |
def seek(self): raise IOError, 'Random access not allowed in gzip files' def tell(self): raise IOError, 'I won\'t tell() you for gzip files' | def flush(self): self.fileobj.flush() | c8facd1dc6aa2ebaaf4aef18d7bc593cec2dd675 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c8facd1dc6aa2ebaaf4aef18d7bc593cec2dd675/gzip.py | |
import string PATH = string.splitfields(envpath, pathsep) | PATH = envpath.split(pathsep) | def _execvpe(file, args, env=None): if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath import string... | e08226d768a9bdb9d47be1408ab3eab841fc2406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e08226d768a9bdb9d47be1408ab3eab841fc2406/os.py |
import string | def _execvpe(file, args, env=None): if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath import string... | e08226d768a9bdb9d47be1408ab3eab841fc2406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e08226d768a9bdb9d47be1408ab3eab841fc2406/os.py | |
upper = string.upper | def __init__(self, environ): UserDict.UserDict.__init__(self) data = self.data upper = string.upper for k, v in environ.items(): data[upper(k)] = v | e08226d768a9bdb9d47be1408ab3eab841fc2406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e08226d768a9bdb9d47be1408ab3eab841fc2406/os.py | |
data[upper(k)] = v | data[k.upper()] = v | def __init__(self, environ): UserDict.UserDict.__init__(self) data = self.data upper = string.upper for k, v in environ.items(): data[upper(k)] = v | e08226d768a9bdb9d47be1408ab3eab841fc2406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e08226d768a9bdb9d47be1408ab3eab841fc2406/os.py |
key = string.upper(key) self.data[key] = item | self.data[key.upper()] = item | def __setitem__(self, key, item): putenv(key, item) key = string.upper(key) self.data[key] = item | e08226d768a9bdb9d47be1408ab3eab841fc2406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e08226d768a9bdb9d47be1408ab3eab841fc2406/os.py |
return self.data[string.upper(key)] | return self.data[key.upper()] def __delitem__(self, key): del self.data[key.upper()] | def __getitem__(self, key): return self.data[string.upper(key)] | e08226d768a9bdb9d47be1408ab3eab841fc2406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e08226d768a9bdb9d47be1408ab3eab841fc2406/os.py |
return self.data.has_key(string.upper(key)) | return self.data.has_key(key.upper()) def get(self, key, failobj=None): return self.data.get(key.upper(), failobj) def update(self, dict): for k, v in dict.items(): self[k] = v | def has_key(self, key): return self.data.has_key(string.upper(key)) | e08226d768a9bdb9d47be1408ab3eab841fc2406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e08226d768a9bdb9d47be1408ab3eab841fc2406/os.py |
self.tk.call(self._w, 'select', 'item') | return self.tk.call(self._w, 'select', 'item') or None | def select_item(self): """Return the item which has the selection.""" self.tk.call(self._w, 'select', 'item') | c484d2b18310bdb55094db3fb2c2a950fed7512c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c484d2b18310bdb55094db3fb2c2a950fed7512c/Tkinter.py |
def wm_state(self): """Return the state of this widget as one of normal, icon, iconic (see wm_iconwindow) and withdrawn.""" return self.tk.call('wm', 'state', self._w) | def wm_state(self, newstate=None): """Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).""" return self.tk.call('wm', 'state', self._w, newstate) | def wm_state(self): """Return the state of this widget as one of normal, icon, iconic (see wm_iconwindow) and withdrawn.""" return self.tk.call('wm', 'state', self._w) | c0862ffa1aa078b395cfc792356d13590486ce0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c0862ffa1aa078b395cfc792356d13590486ce0c/Tkinter.py |
self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae') | self.assertEquals(ef.read(), '\\\xd5\n\x00\x00\xae') | def test_basic(self): f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80') ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8') self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae') | de05075bef70b68155b48f2a0d36e84a34350a72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/de05075bef70b68155b48f2a0d36e84a34350a72/test_codecs.py |
err('usage: classfix file-or-directory ...\n') | err('usage: ' + argv[0] + ' file-or-directory ...\n') | def main(): bad = 0 if not sys.argv[1:]: # No arguments err('usage: classfix file-or-directory ...\n') sys.exit(2) for arg in sys.argv[1:]: if path.isdir(arg): if recursedown(arg): bad = 1 elif path.islink(arg): err(arg + ': will not process symbolic links\n') bad = 1 else: if fix(arg): bad = 1 sys.exit(bad) | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py |
ispython = regexp.compile('^[a-zA-Z0-9_]+\.py$').match | ispythonprog = regex.compile('^[a-zA-Z0-9_]+\.py$') def ispython(name): return ispythonprog.match(name) >= 0 | def main(): bad = 0 if not sys.argv[1:]: # No arguments err('usage: classfix file-or-directory ...\n') sys.exit(2) for arg in sys.argv[1:]: if path.isdir(arg): if recursedown(arg): bad = 1 elif path.islink(arg): err(arg + ': will not process symbolic links\n') bad = 1 else: if fix(arg): bad = 1 sys.exit(bad) | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py |
if recursedown(fullname): bad = 1 | subdirs.append(fullname) | def recursedown(dirname): dbg('recursedown(' + `dirname` + ')\n') bad = 0 try: names = posix.listdir(dirname) except posix.error, msg: err(dirname + ': cannot list directory: ' + `msg` + '\n') return 1 for name in names: if name in ('.', '..'): continue fullname = path.join(dirname, name) if path.islink(fullname): pass... | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py |
classexpr = '^([ \t]*class +[a-zA-Z0-9_]+) *\( *\) *((=.*)?):' findclass = regexp.compile(classexpr).match baseexpr = '^ *(.*) *\( *\) *$' findbase = regexp.compile(baseexpr).match | def recursedown(dirname): dbg('recursedown(' + `dirname` + ')\n') bad = 0 try: names = posix.listdir(dirname) except posix.error, msg: err(dirname + ': cannot list directory: ' + `msg` + '\n') return 1 for name in names: if name in ('.', '..'): continue fullname = path.join(dirname, name) if path.islink(fullname): pass... | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py | |
dbg('fix(' + `filename` + ')\n') | def fix(filename): | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py | |
tf = None | g = None | def fix(filename): | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py |
res = findclass(line) if not res: if tf: tf.write(line) continue if not tf: try: tf = open(tempname, 'w') except IOError, msg: f.close() err(tempname+': cannot create: '+`msg`+'\n') return 1 rep(filename + ':\n') f.seek(0) continue a0, b0 = res[0] a1, b1 = res[1] a2, b2 = res[2] head = line[:b1] tail = line[b0:] if a2... | lineno = lineno + 1 while line[-2:] == '\\\n': nextline = f.readline() if not nextline: break line = line + nextline lineno = lineno + 1 newline = fixline(line) if newline != line: if g is None: try: g = open(tempname, 'w') except IOError, msg: f.close() err(tempname+': cannot create: '+\ `msg`+'\n') return 1 f.seek(0)... | def fix(filename): | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py |
if not tf: return 0 | if not g: return 0 | def fix(filename): | b84614f43186fc92896afc304f85cdb7961cf46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b84614f43186fc92896afc304f85cdb7961cf46b/classfix.py |
exts.append( Extension('pwd', ['pwdmodule.c']) ) exts.append( Extension('grp', ['grpmodule.c']) ) | if platform not in ['mac']: exts.append( Extension('pwd', ['pwdmodule.c']) ) exts.append( Extension('grp', ['grpmodule.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 081563166713aac056a0230633f21a332e43c91d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/081563166713aac056a0230633f21a332e43c91d/setup.py |
if platform not in ['atheos']: | if platform not in ['atheos', 'mac']: | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 081563166713aac056a0230633f21a332e43c91d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/081563166713aac056a0230633f21a332e43c91d/setup.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.