rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
e.set_lk_detect(db.DB_LOCK_DEFAULT)
def _openDBEnv(cachesize): e = db.DBEnv() if cachesize is not None: if cachesize >= 20480: e.set_cachesize(0, cachesize) else: raise error, "cachesize must be >= 20480" e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) e.set_lk_detect(db.DB_LOCK_DEFAULT) return e
afe73700fc6a8e743bfef145462aa280cb4d3af2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/afe73700fc6a8e743bfef145462aa280cb4d3af2/__init__.py
import sys
def test_main(verbose=None): import sys from test import test_sets test_classes = ( TestSet, TestSetSubclass, TestFrozenSet, TestFrozenSetSubclass, TestSetOfSets, TestExceptionPropagation, TestBasicOpsEmpty, TestBasicOpsSingleton, TestBasicOpsTuple, TestBasicOpsTriple, TestBinaryOps, TestUpdateOps, TestMutate, TestSubs...
b3f448b537586e03a5a84f46b797e8441fb4c16d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b3f448b537586e03a5a84f46b797e8441fb4c16d/test_set.py
if ((template_exists and template_newer) or self.force_manifest or self.manifest_only):
if ((template_exists and (template_newer or setup_newer)) or self.force_manifest or self.manifest_only):
def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.files'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the stat...
84151ec6bcdc76b2451a7c6ea4254678ee68941a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/84151ec6bcdc76b2451a7c6ea4254678ee68941a/sdist.py
print>>sys.__stderr__, "** __file__: ", __file__
def view_readme(self, event=None): print>>sys.__stderr__, "** __file__: ", __file__ fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'README.txt') textView.TextViewer(self.top,'IDLEfork - README',fn)
b4b1a74c699f286683f9897e8f9d03de4c808231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b4b1a74c699f286683f9897e8f9d03de4c808231/EditorWindow.py
if kind[0] == 'f' and not re.search('\$IN\b', cmd):
if kind[0] == 'f' and not re.search(r'\$IN\b', cmd):
def append(self, cmd, kind): """t.append(cmd, kind) adds a new step at the end.""" if type(cmd) is not type(''): raise TypeError, \ 'Template.append: cmd must be a string' if kind not in stepkinds: raise ValueError, \ 'Template.append: bad kind ' + `kind` if kind == SOURCE: raise ValueError, \ 'Template.append: SOURCE ...
4f12096d449bfe738757bbbb669119dc6efadc7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f12096d449bfe738757bbbb669119dc6efadc7b/pipes.py
if kind[1] == 'f' and not re.search('\$OUT\b', cmd):
if kind[1] == 'f' and not re.search(r'\$OUT\b', cmd):
def append(self, cmd, kind): """t.append(cmd, kind) adds a new step at the end.""" if type(cmd) is not type(''): raise TypeError, \ 'Template.append: cmd must be a string' if kind not in stepkinds: raise ValueError, \ 'Template.append: bad kind ' + `kind` if kind == SOURCE: raise ValueError, \ 'Template.append: SOURCE ...
4f12096d449bfe738757bbbb669119dc6efadc7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f12096d449bfe738757bbbb669119dc6efadc7b/pipes.py
if kind[0] == 'f' and not re.search('\$IN\b', cmd):
if kind[0] == 'f' and not re.search(r'\$IN\b', cmd):
def prepend(self, cmd, kind): """t.prepend(cmd, kind) adds a new step at the front.""" if type(cmd) is not type(''): raise TypeError, \ 'Template.prepend: cmd must be a string' if kind not in stepkinds: raise ValueError, \ 'Template.prepend: bad kind ' + `kind` if kind == SINK: raise ValueError, \ 'Template.prepend: SI...
4f12096d449bfe738757bbbb669119dc6efadc7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f12096d449bfe738757bbbb669119dc6efadc7b/pipes.py
if kind[1] == 'f' and not re.search('\$OUT\b', cmd):
if kind[1] == 'f' and not re.search(r'\$OUT\b', cmd):
def prepend(self, cmd, kind): """t.prepend(cmd, kind) adds a new step at the front.""" if type(cmd) is not type(''): raise TypeError, \ 'Template.prepend: cmd must be a string' if kind not in stepkinds: raise ValueError, \ 'Template.prepend: bad kind ' + `kind` if kind == SINK: raise ValueError, \ 'Template.prepend: SI...
4f12096d449bfe738757bbbb669119dc6efadc7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4f12096d449bfe738757bbbb669119dc6efadc7b/pipes.py
version_number = float(version.split('/', 1)[1]) except ValueError:
base_version_number = version.split('/', 1)[1] version_number = base_version_number.split(".") if len(version_number) != 2: raise ValueError version_number = int(version_number[0]), int(version_number[1]) except (ValueError, IndexError):
def parse_request(self): """Parse a request (internal).
d835450bb4c442ddab91483a51b75807078d6f6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d835450bb4c442ddab91483a51b75807078d6f6e/BaseHTTPServer.py
if version_number >= 1.1 and self.protocol_version >= "HTTP/1.1":
if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1":
def parse_request(self): """Parse a request (internal).
d835450bb4c442ddab91483a51b75807078d6f6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d835450bb4c442ddab91483a51b75807078d6f6e/BaseHTTPServer.py
if version_number >= 2.0:
if version_number >= (2, 0):
def parse_request(self): """Parse a request (internal).
d835450bb4c442ddab91483a51b75807078d6f6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d835450bb4c442ddab91483a51b75807078d6f6e/BaseHTTPServer.py
"Invalid HTTP Version (%f)" % version_number)
"Invalid HTTP Version (%s)" % base_version_number)
def parse_request(self): """Parse a request (internal).
d835450bb4c442ddab91483a51b75807078d6f6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d835450bb4c442ddab91483a51b75807078d6f6e/BaseHTTPServer.py
else:
elif (i + 1) < n:
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: match = self.interesting.search(rawdata, i) # < or & if match: j = match.start() else: j = n if i < j: self.handle_data(rawdata[i:j]) i = self.updatepos(i, j) if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): # < ...
e1f1b158a9a19e3889890db85d5e537716820815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1f1b158a9a19e3889890db85d5e537716820815/HTMLParser.py
elif rawdata[i] == '&':
elif rawdata[i:i+2] == "&
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: match = self.interesting.search(rawdata, i) # < or & if match: j = match.start() else: j = n if i < j: self.handle_data(rawdata[i:j]) i = self.updatepos(i, j) if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): # < ...
e1f1b158a9a19e3889890db85d5e537716820815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1f1b158a9a19e3889890db85d5e537716820815/HTMLParser.py
if end and rest != "&" and match.group() == rest:
if end and match.group() == rest:
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: match = self.interesting.search(rawdata, i) # < or & if match: j = match.start() else: j = n if i < j: self.handle_data(rawdata[i:j]) i = self.updatepos(i, j) if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): # < ...
e1f1b158a9a19e3889890db85d5e537716820815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1f1b158a9a19e3889890db85d5e537716820815/HTMLParser.py
return -1 self.handle_data("&") i = self.updatepos(i, i + 1)
break elif (i + 1) < n: self.handle_data("&") i = self.updatepos(i, i + 1) else: break
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: match = self.interesting.search(rawdata, i) # < or & if match: j = match.start() else: j = n if i < j: self.handle_data(rawdata[i:j]) i = self.updatepos(i, j) if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): # < ...
e1f1b158a9a19e3889890db85d5e537716820815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1f1b158a9a19e3889890db85d5e537716820815/HTMLParser.py
def parse_comment(self, i):
def parse_comment(self, i, report=1):
def parse_comment(self, i): rawdata = self.rawdata assert rawdata[i:i+4] == '<!--', 'unexpected call to parse_comment()' match = commentclose.search(rawdata, i+4) if not match: return -1 j = match.start() self.handle_comment(rawdata[i+4: j]) j = match.end() return j
e1f1b158a9a19e3889890db85d5e537716820815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1f1b158a9a19e3889890db85d5e537716820815/HTMLParser.py
j = match.start() self.handle_comment(rawdata[i+4: j])
if report: j = match.start() self.handle_comment(rawdata[i+4: j])
def parse_comment(self, i): rawdata = self.rawdata assert rawdata[i:i+4] == '<!--', 'unexpected call to parse_comment()' match = commentclose.search(rawdata, i+4) if not match: return -1 j = match.start() self.handle_comment(rawdata[i+4: j]) j = match.end() return j
e1f1b158a9a19e3889890db85d5e537716820815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1f1b158a9a19e3889890db85d5e537716820815/HTMLParser.py
self.handle_decl(rawdata[i+2:j])
data = rawdata[i+2:j] if decltype == "doctype": self.handle_decl(data) else: self.unknown_decl(data)
def parse_declaration(self, i): # This is some sort of declaration; in "HTML as # deployed," this should only be the document type # declaration ("<!DOCTYPE html...>"). rawdata = self.rawdata j = i + 2 assert rawdata[i:j] == "<!", "unexpected call to parse_declaration" if rawdata[j:j+1] in ("-", ""): # Start of comment...
e1f1b158a9a19e3889890db85d5e537716820815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1f1b158a9a19e3889890db85d5e537716820815/HTMLParser.py
window.do_activate(modifiers & 1, event)
window.do_activate(message & 1, event)
def do_suspendresume(self, event): (what, message, when, where, modifiers) = event wid = FrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] window.do_activate(modifiers & 1, event)
17b338afc283d7ff7289b75fa7e8329c43a561d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/17b338afc283d7ff7289b75fa7e8329c43a561d3/FrameWork.py
if (sld.lower() in ( "co", "ac", "com", "edu", "org", "net", "gov", "mil", "int") and len(tld) == 2):
if sld.lower() in ("co", "ac", "com", "edu", "org", "net", "gov", "mil", "int", "aero", "biz", "cat", "coop", "info", "jobs", "mobi", "museum", "name", "pro", "travel", "eu") and len(tld) == 2:
def set_ok_domain(self, cookie, request): if self.is_blocked(cookie.domain): debug(" domain %s is in user block-list", cookie.domain) return False if self.is_not_allowed(cookie.domain): debug(" domain %s is not in user allow-list", cookie.domain) return False if cookie.domain_specified: req_host, erhn = eff_request...
788bbe0990f652227ea8b9f197c52ec55259b2cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/788bbe0990f652227ea8b9f197c52ec55259b2cf/cookielib.py
return addinfo(fp, headers)
return addinfourl(fp, headers, self.openedurl)
def open_http(self, url): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'http': realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_p...
2ef371cc555b6d6b747bc517ed82705a38e0b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ef371cc555b6d6b747bc517ed82705a38e0b8d2/urllib.py
return addinfo(fp, noheaders())
return addinfourl(fp, noheaders(), self.openedurl)
def open_gopher(self, url): import gopherlib host, selector = splithost(url) if not host: raise IOError, ('gopher error', 'no host given') type, selector = splitgophertype(selector) selector, query = splitquery(selector) selector = unquote(selector) if query: query = unquote(query) fp = gopherlib.send_query(selector, q...
2ef371cc555b6d6b747bc517ed82705a38e0b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ef371cc555b6d6b747bc517ed82705a38e0b8d2/urllib.py
if not host: return addinfo(open(url2pathname(file), 'r'), noheaders())
if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl)
def open_local_file(self, url): host, file = splithost(url) if not host: return addinfo(open(url2pathname(file), 'r'), noheaders()) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfo(open(url2pathname(file), 'r'), noheaders()) raise...
2ef371cc555b6d6b747bc517ed82705a38e0b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ef371cc555b6d6b747bc517ed82705a38e0b8d2/urllib.py
return addinfo(open(url2pathname(file), 'r'), noheaders())
return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl)
def open_local_file(self, url): host, file = splithost(url) if not host: return addinfo(open(url2pathname(file), 'r'), noheaders()) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfo(open(url2pathname(file), 'r'), noheaders()) raise...
2ef371cc555b6d6b747bc517ed82705a38e0b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ef371cc555b6d6b747bc517ed82705a38e0b8d2/urllib.py
return addinfo(self.ftpcache[key].retrfile(file, type), noheaders())
return addinfourl(self.ftpcache[key].retrfile(file, type), noheaders(), self.openedurl)
def open_ftp(self, url): host, path = splithost(url) if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) user, host = splituser(host) if user: user, passwd = splitpasswd(user) else: passwd = None host = socket.gethostbyname(host) if not port: import ftplib port = ftplib.FTP_PORT path...
2ef371cc555b6d6b747bc517ed82705a38e0b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ef371cc555b6d6b747bc517ed82705a38e0b8d2/urllib.py
return addinfo(fp, headers)
return addinfourl(fp, headers, self.openedurl)
def http_error_default(self, url, fp, errcode, errmsg, headers): return addinfo(fp, headers)
2ef371cc555b6d6b747bc517ed82705a38e0b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ef371cc555b6d6b747bc517ed82705a38e0b8d2/urllib.py
print '%s.%s%s =? %s... ' % (repr(input), method, args, output),
print '%s.%s%s =? %s... ' % (repr(input), method, args, repr(output)),
def test(method, input, output, *args): if verbose: print '%s.%s%s =? %s... ' % (repr(input), method, args, output), try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value != output: if verbose: print 'no' print '*',f, `input`, `output`, `v...
a403dac0d3e02f0c4b019936e66f78b10e3709c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a403dac0d3e02f0c4b019936e66f78b10e3709c5/test_unicode.py
if value != output:
if value != output or type(value) is not type(output):
def test(method, input, output, *args): if verbose: print '%s.%s%s =? %s... ' % (repr(input), method, args, output), try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value != output: if verbose: print 'no' print '*',f, `input`, `output`, `v...
a403dac0d3e02f0c4b019936e66f78b10e3709c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a403dac0d3e02f0c4b019936e66f78b10e3709c5/test_unicode.py
def __init__(self): self.seq = 'wxyz'
def __init__(self, seq): self.seq = seq
def __init__(self): self.seq = 'wxyz'
a403dac0d3e02f0c4b019936e66f78b10e3709c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a403dac0d3e02f0c4b019936e66f78b10e3709c5/test_unicode.py
test('join', u' ', u'w x y z', Sequence())
test('join', u' ', u'w x y z', Sequence('wxyz'))
def __getitem__(self, i): return self.seq[i]
a403dac0d3e02f0c4b019936e66f78b10e3709c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a403dac0d3e02f0c4b019936e66f78b10e3709c5/test_unicode.py
class BadSeq(Sequence): def __init__(self): self.seq = [7, u'hello', 123L] test('join', u' ', TypeError, BadSeq())
test('join', u' ', TypeError, Sequence([7, u'hello', 123L])) test('join', ' ', u'a b c d', [u'a', u'b', u'c', u'd']) test('join', ' ', u'a b c d', ['a', 'b', u'c', u'd']) test('join', '', u'abcd', (u'a', u'b', u'c', u'd')) test('join', ' ', u'w x y z', Sequence(u'wxyz')) test('join', ' ', TypeError, 7)
def __getitem__(self, i): return self.seq[i]
a403dac0d3e02f0c4b019936e66f78b10e3709c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a403dac0d3e02f0c4b019936e66f78b10e3709c5/test_unicode.py
self.assert_(len(read) == 1024, "Error performing sendall.") read = filter(lambda x: x == 'f', read) self.assert_(len(read) == 1024, "Error performing sendall.")
msg += read self.assertEqual(msg, 'f' * 2048)
def testSendAll(self): # Testing sendall() with a 2048 byte string over TCP while 1: read = self.cli_conn.recv(1024) if not read: break self.assert_(len(read) == 1024, "Error performing sendall.") read = filter(lambda x: x == 'f', read) self.assert_(len(read) == 1024, "Error performing sendall.")
db6ab53a1cad7d8189803d57a98a23cd21c64724 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6ab53a1cad7d8189803d57a98a23cd21c64724/test_socket.py
return filename
components = string.split(filename, ':') for i in range(1, len(components)): if components[i] == '..': components[i] = '' return string.join(components, ':')
def _filename_to_abs(self, filename): # Some filenames seem to be unix-like. Convert to Mac names.
526e0c6f0b1191522dd1a3b28ec13ac2686906cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/526e0c6f0b1191522dd1a3b28ec13ac2686906cd/mwerkscompiler.py
def writexml(self, writer): writer.write("<" + self.tagName)
def writexml(self, writer, indent="", addindent="", newl=""): writer.write(indent+"<" + self.tagName)
def writexml(self, writer): writer.write("<" + self.tagName)
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
writer.write(">")
writer.write(">%s"%(newl))
def writexml(self, writer): writer.write("<" + self.tagName)
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
node.writexml(writer) writer.write("</%s>" % self.tagName) else: writer.write("/>")
node.writexml(writer,indent+addindent,addindent,newl) writer.write("%s</%s>%s" % (indent,self.tagName,newl)) else: writer.write("/>%s"%(newl))
def writexml(self, writer): writer.write("<" + self.tagName)
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
def writexml(self, writer): writer.write("<!--%s-->" % self.data)
def writexml(self, writer, indent="", addindent="", newl=""): writer.write("%s<!--%s-->%s" % (indent,self.data,newl))
def writexml(self, writer): writer.write("<!--%s-->" % self.data)
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
def writexml(self, writer): writer.write("<?%s %s?>" % (self.target, self.data))
def writexml(self, writer, indent="", addindent="", newl=""): writer.write("%s<?%s %s?>%s" % (indent,self.target, self.data, newl))
def writexml(self, writer): writer.write("<?%s %s?>" % (self.target, self.data))
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
def writexml(self, writer): _write_data(writer, self.data)
def writexml(self, writer, indent="", addindent="", newl=""): _write_data(writer, "%s%s%s"%(indent, self.data, newl))
def writexml(self, writer): _write_data(writer, self.data)
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
def writexml(self, writer):
def writexml(self, writer, indent="", addindent="", newl=""):
def writexml(self, writer): writer.write('<?xml version="1.0" ?>\n') for node in self.childNodes: node.writexml(writer)
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
node.writexml(writer)
node.writexml(writer, indent, addindent, newl)
def writexml(self, writer): writer.write('<?xml version="1.0" ?>\n') for node in self.childNodes: node.writexml(writer)
285ed3c7ae8ea988a1c52e6518da14f1d21e7e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/285ed3c7ae8ea988a1c52e6518da14f1d21e7e83/minidom.py
stats = os.stat(localname)
try: stats = os.stat(localname) except OSError, e: raise IOError(e.errno, e.strerror, e.filename)
def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, rfc822, StringIO host, file = splithost(url) localname = url2pathname(file) stats = os.stat(localname) size = stats.st_size modified = rfc822.formatdate(stats.st_mtime) mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(Str...
434bef36ce33c7a72b6011a91d8d491bc9a2ff04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/434bef36ce33c7a72b6011a91d8d491bc9a2ff04/urllib.py
if sys.platform in ['unixware7']: testit('atan2(0, 1)', math.atan2(0, 1), math.pi) else: testit('atan2(0, 1)', math.atan2(0, 1), 0)
testit('atan2(0, 1)', math.atan2(0, 1), 0)
def testit(name, value, expected): if abs(value-expected) > eps: raise TestFailed, '%s returned %f, expected %f'%\ (name, value, expected)
52dc55fbaba1567593048d686af7e435cc1af4d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/52dc55fbaba1567593048d686af7e435cc1af4d9/test_math.py
self.bytebuffer = ""
self.buffer = ""
def reset(self): IncrementalDecoder.reset(self) self.bytebuffer = ""
5e10b9a66bac1770ad4d4d16bd0976140d9963c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5e10b9a66bac1770ad4d4d16bd0976140d9963c2/codecs.py
suite.addTest(unittest.makeSuite(BasicUDPTest))
if sys.platform != 'mac': suite.addTest(unittest.makeSuite(BasicUDPTest))
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(GeneralModuleTests)) suite.addTest(unittest.makeSuite(BasicTCPTest)) suite.addTest(unittest.makeSuite(BasicUDPTest)) suite.addTest(unittest.makeSuite(NonBlockingTCPTests)) suite.addTest(unittest.makeSuite(FileObjectClassTestCase)) suite.addT...
35c64d4ce6933fdc1ef940ec01f66f3af451a8b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/35c64d4ce6933fdc1ef940ec01f66f3af451a8b3/test_socket.py
if inspect.isroutine(object): returnself.docroutine(*args)
if inspect.isroutine(object): return self.docroutine(*args)
def document(self, object, name=None, *args): """Generate documentation for an object.""" args = (object, name) + args if inspect.ismodule(object): return self.docmodule(*args) if inspect.isclass(object): return self.docclass(*args) if inspect.isroutine(object): returnself.docroutine(*args) return self.docother(*args)
b47666ec97002f3117aa19c4e117aea8cdc7475a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b47666ec97002f3117aa19c4e117aea8cdc7475a/pydoc.py
This is the normal interface: it return a stripped
This is the normal interface: it returns a stripped
def getheader(self, name, default=None): """Get the header value for a name. This is the normal interface: it return a stripped version of the header value for a given header name, or None if it doesn't exist. This uses the dictionary version which finds the *last* such header. """ try: return self.dict[string.lower(...
0064cc31104b5c37e4fdd4ada59ac5eca4f0e17e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0064cc31104b5c37e4fdd4ada59ac5eca4f0e17e/rfc822.py
def f(): for i in range(1000): yield i
00e975d4b0aa683c266519e3004acc53f8c69dbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00e975d4b0aa683c266519e3004acc53f8c69dbc/test_types.py
vereq(iter(T()).next(), '0!!!')
vereq(iter(T((1,2))).next(), 1)
def __getitem__(self, key): return str(key) + '!!!'
00e975d4b0aa683c266519e3004acc53f8c69dbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00e975d4b0aa683c266519e3004acc53f8c69dbc/test_types.py
def selfmodifyingComparison(x,y): z.append(1) return cmp(x, y)
00e975d4b0aa683c266519e3004acc53f8c69dbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00e975d4b0aa683c266519e3004acc53f8c69dbc/test_types.py
vereq(iter(L()).next(), '0!!!')
vereq(iter(L([1,2])).next(), 1)
def __getitem__(self, key): return str(key) + '!!!'
00e975d4b0aa683c266519e3004acc53f8c69dbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00e975d4b0aa683c266519e3004acc53f8c69dbc/test_types.py
self.sock.send(data)
bytes = len(data) while bytes > 0: sent = self.sock.send(data) if sent == bytes: break data = data[sent:] bytes = bytes - sent
def send(self, data): """Send data to remote.""" self.sock.send(data)
4e0bf798ab26ecfa2caddbf91da75376ca7b38ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e0bf798ab26ecfa2caddbf91da75376ca7b38ef/imaplib.py
if '\n' in text: if string.find(text, '\r\n') >= 0: self._eoln = '\r\n' else: self._eoln = '\n' text = string.replace(text, self._eoln, '\r') change = 0 else: change = 0 self._eoln = '\r'
def __init__(self, path = "", title = ""): defaultfontsettings, defaulttabsettings, defaultwindowsize = geteditorprefs() global _scriptuntitledcounter if not path: if title: self.title = title else: self.title = "Untitled Script " + `_scriptuntitledcounter` _scriptuntitledcounter = _scriptuntitledcounter + 1 text = "" ...
23336dc4985ce42aabdee8f9a4da0cf2186ee528 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/23336dc4985ce42aabdee8f9a4da0cf2186ee528/PyEdit.py
if change > 0: self.editgroup.editor.textchanged()
def __init__(self, path = "", title = ""): defaultfontsettings, defaulttabsettings, defaultwindowsize = geteditorprefs() global _scriptuntitledcounter if not path: if title: self.title = title else: self.title = "Untitled Script " + `_scriptuntitledcounter` _scriptuntitledcounter = _scriptuntitledcounter + 1 text = "" ...
23336dc4985ce42aabdee8f9a4da0cf2186ee528 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/23336dc4985ce42aabdee8f9a4da0cf2186ee528/PyEdit.py
print dir(tas)
print fixdir(dir(tas))
def runtest(hier, code): root = tempfile.mktemp() mkhier(root, hier) savepath = sys.path[:] codefile = tempfile.mktemp() f = open(codefile, "w") f.write(code) f.close() try: sys.path.insert(0, root) if verbose: print "sys.path =", sys.path try: execfile(codefile, globals(), {}) except: traceback.print_exc(file=sys.stdo...
49b5eaaee495b23d0fd97c60191161945b017aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49b5eaaee495b23d0fd97c60191161945b017aa3/test_pkg.py
print dir(subpar)
print fixdir(dir(subpar))
def runtest(hier, code): root = tempfile.mktemp() mkhier(root, hier) savepath = sys.path[:] codefile = tempfile.mktemp() f = open(codefile, "w") f.write(code) f.close() try: sys.path.insert(0, root) if verbose: print "sys.path =", sys.path try: execfile(codefile, globals(), {}) except: traceback.print_exc(file=sys.stdo...
49b5eaaee495b23d0fd97c60191161945b017aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49b5eaaee495b23d0fd97c60191161945b017aa3/test_pkg.py
print dir(subsubsub)
print fixdir(dir(subsubsub))
def runtest(hier, code): root = tempfile.mktemp() mkhier(root, hier) savepath = sys.path[:] codefile = tempfile.mktemp() f = open(codefile, "w") f.write(code) f.close() try: sys.path.insert(0, root) if verbose: print "sys.path =", sys.path try: execfile(codefile, globals(), {}) except: traceback.print_exc(file=sys.stdo...
49b5eaaee495b23d0fd97c60191161945b017aa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49b5eaaee495b23d0fd97c60191161945b017aa3/test_pkg.py
if _os.name == "nt":
if _os.name in ("nt", "ce"):
def wstring_at(ptr, size=0): """wstring_at(addr[, size]) -> string
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
result = -2147221231
def DllGetClassObject(rclsid, riid, ppv): # First ask ctypes.com.server than comtypes.server for the # class object.
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
ctcom = __import__("ctypes.com.server", globals(), locals(), ['*'])
ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
def DllGetClassObject(rclsid, riid, ppv): # First ask ctypes.com.server than comtypes.server for the # class object.
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
pass
return -2147221231
def DllGetClassObject(rclsid, riid, ppv): # First ask ctypes.com.server than comtypes.server for the # class object.
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
result = ctcom.DllGetClassObject(rclsid, riid, ppv) if result == -2147221231: try: ccom = __import__("comtypes.server", globals(), locals(), ['*']) except ImportError: pass else: result = ccom.DllGetClassObject(rclsid, riid, ppv) return result
return ccom.DllGetClassObject(rclsid, riid, ppv)
def DllGetClassObject(rclsid, riid, ppv): # First ask ctypes.com.server than comtypes.server for the # class object.
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
result = 0
def DllCanUnloadNow(): # First ask ctypes.com.server than comtypes.server if we can unload or not. # trick py2exe by doing dynamic imports result = 0 # S_OK try: ctcom = __import__("ctypes.com.server", globals(), locals(), ['*']) except ImportError: pass else: result = ctcom.DllCanUnloadNow() if result != 0: # != S_OK ...
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
ctcom = __import__("ctypes.com.server", globals(), locals(), ['*'])
ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
def DllCanUnloadNow(): # First ask ctypes.com.server than comtypes.server if we can unload or not. # trick py2exe by doing dynamic imports result = 0 # S_OK try: ctcom = __import__("ctypes.com.server", globals(), locals(), ['*']) except ImportError: pass else: result = ctcom.DllCanUnloadNow() if result != 0: # != S_OK ...
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
pass else: result = ctcom.DllCanUnloadNow() if result != 0: return result try: ccom = __import__("comtypes.server", globals(), locals(), ['*']) except ImportError: return result try: return ccom.DllCanUnloadNow() except AttributeError: pass return result
return 0 return ccom.DllCanUnloadNow()
def DllCanUnloadNow(): # First ask ctypes.com.server than comtypes.server if we can unload or not. # trick py2exe by doing dynamic imports result = 0 # S_OK try: ctcom = __import__("ctypes.com.server", globals(), locals(), ['*']) except ImportError: pass else: result = ctcom.DllCanUnloadNow() if result != 0: # != S_OK ...
80f9f5c16d81936875e8e0bd489075580d0dafd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80f9f5c16d81936875e8e0bd489075580d0dafd6/__init__.py
pat = r'''-..x..x..x
pat = r'''[l-]..x..x..x
def test_getstatus(self): # This pattern should match 'ls -ld /bin/ls' on any posix # system, however perversely configured. pat = r'''-..x..x..x # It is executable. \s+\d+ # It has some number of links. \s+\w+\s+\w+ # It has a user and group, which may # be named anything. [^/]* # Skip the date. /bi...
802e81e21da4a37363c054d2f2155b24ca02ffc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/802e81e21da4a37363c054d2f2155b24ca02ffc3/test_commands.py
def test(fn = 'f:just samples:just.aif'):
def test():
def test(fn = 'f:just samples:just.aif'): import aifc af = aifc.open(fn, 'r') print af.getparams() p = Play_Audio_mac() p.setoutrate(af.getframerate()) p.setsampwidth(af.getsampwidth()) p.setnchannels(af.getnchannels()) BUFSIZ = 10000 while 1: data = af.readframes(BUFSIZ) if not data: break p.writeframes(data) p.wait()...
a14e1cfe82dc3839dd57c099cc00f15aed3125fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a14e1cfe82dc3839dd57c099cc00f15aed3125fe/Audio_mac.py
print "Breakpoint in", filename, "at", lineno
def set_break(self, filename, lineno, temporary=0, cond = None): filename = self.canonic(filename) import linecache # Import as late as possible line = linecache.getline(filename, lineno) if not line: return 'Line %s:%d does not exist' % (filename, lineno) if not self.breaks.has_key(filename): self.breaks[filename] = [...
6c500e53391ae0febda8e0e2dd201372f6ba876f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6c500e53391ae0febda8e0e2dd201372f6ba876f/bdb.py
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
def genrange(*a): """Function to implement 'range' as a generator""" start, stop, step = handleargs(a) value = start while value < stop: yield value value += step
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
Done using the old way (pre-iterators; __len__ and __getitem__) to have an object be used by a 'for' loop.
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
class Range:
"""
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
def __init__(self, start, stop, step): if step == 0: raise ValueError, 'range() called with zero step' self.start = start self.stop = stop self.step = step self.len = max(0, int((self.stop - self.start) / self.step))
def __init__(self, *a): """ Initialize start, stop, and step values along with calculating the nubmer of values (what __len__ will return) in the range""" self.start, self.stop, self.step = handleargs(a) self.len = max(0, (self.stop - self.start) // self.step)
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
def __init__(self, start, stop, step): if step == 0: raise ValueError, 'range() called with zero step' self.start = start self.stop = stop self.step = step self.len = max(0, int((self.stop - self.start) / self.step))
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
def __repr__(self): return 'range(%r, %r, %r)' % (self.start, self.stop, self.step)
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
def __len__(self): return self.len
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
if 0 <= i < self.len:
"""implement x[i]""" if 0 <= i <= self.len:
def __getitem__(self, i): if 0 <= i < self.len: return self.start + self.step * i else: raise IndexError, 'range[i] index out of range'
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
def __getitem__(self, i): if 0 <= i < self.len: return self.start + self.step * i else: raise IndexError, 'range[i] index out of range'
e558fb2c2409bd05c365ae64a4e156242207dbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e558fb2c2409bd05c365ae64a4e156242207dbc1/Range.py
def get_python_inc(plat_specific=0):
def get_python_inc(plat_specific=0, prefix=None):
def get_python_inc(plat_specific=0): """Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely config.h). """ pr...
cd699377d64688fb208260fcb603d31e3a41e4b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd699377d64688fb208260fcb603d31e3a41e4b4/sysconfig.py
prefix = (plat_specific and EXEC_PREFIX or PREFIX)
if prefix is None: prefix = (plat_specific and EXEC_PREFIX or PREFIX)
def get_python_inc(plat_specific=0): """Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely config.h). """ pr...
cd699377d64688fb208260fcb603d31e3a41e4b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd699377d64688fb208260fcb603d31e3a41e4b4/sysconfig.py
def get_python_lib(plat_specific=0, standard_lib=0):
def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
def get_python_lib(plat_specific=0, standard_lib=0): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shar...
cd699377d64688fb208260fcb603d31e3a41e4b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd699377d64688fb208260fcb603d31e3a41e4b4/sysconfig.py
prefix = (plat_specific and EXEC_PREFIX or PREFIX)
if prefix is None: prefix = (plat_specific and EXEC_PREFIX or PREFIX)
def get_python_lib(plat_specific=0, standard_lib=0): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shar...
cd699377d64688fb208260fcb603d31e3a41e4b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd699377d64688fb208260fcb603d31e3a41e4b4/sysconfig.py
_safechars = string.letters + string.digits + '!@%_-+=:,./'
_safechars = string.ascii_letters + string.digits + '!@%_-+=:,./'
def makepipeline(infile, steps, outfile): # Build a list with for each command: # [input filename or '', command string, kind, output filename or ''] list = [] for cmd, kind in steps: list.append(['', cmd, kind, '']) # # Make sure there is at least one step # if not list: list.append(['', 'cat', '--', '']) # # Take ca...
f73b80cf41498db2b98ec9b16ebbd38e047548c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f73b80cf41498db2b98ec9b16ebbd38e047548c6/pipes.py
self.flag = 0
self.flags[flag] = 0
def clear_flags(self): """Reset all flags to zero""" for flag in self.flags: self.flag = 0
3f6258ce077734d972c2dcb6d4fed8a591cac2a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3f6258ce077734d972c2dcb6d4fed8a591cac2a9/decimal.py
format = ' %' + directive
format = '%' + directive strf_output = time.strftime(format, tt)
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed...
0d7f3c37bbe6fda7bb44d3fed4ed123b35efc7c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0d7f3c37bbe6fda7bb44d3fed4ed123b35efc7c2/test_time.py
time.strptime(time.strftime(format, tt), format)
time.strptime(strf_output, format)
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed...
0d7f3c37bbe6fda7bb44d3fed4ed123b35efc7c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0d7f3c37bbe6fda7bb44d3fed4ed123b35efc7c2/test_time.py
self.fail('conversion specifier: %r failed.' % format)
self.fail("conversion specifier %r failed with '%s' input." % (format, strf_output))
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed...
0d7f3c37bbe6fda7bb44d3fed4ed123b35efc7c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0d7f3c37bbe6fda7bb44d3fed4ed123b35efc7c2/test_time.py
elif compiler[:3] == "gcc" or compiler[:3] == "g++": return "-Wl,-R" + dir
elif sys.platform[:5] == "hp-ux": return "+s -L" + dir elif compiler[:3] == "gcc" or compiler[:3] == "g++": return "-Wl,-R" + dir
def runtime_library_dir_option(self, dir): # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # d...
8f31ad01ca98f5b8516b9536a5c01249068f0649 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8f31ad01ca98f5b8516b9536a5c01249068f0649/unixccompiler.py
wrapper = os.path.join(sys.exec_prefix, ":Mac:Tools:CGI:PythonCGISlave.py")
wrapper = "PythonCGISlave.py" if not os.path.exists("PythonCGISlave.py"): wrapper = os.path.join(sys.exec_prefix, ":Mac:Tools:CGI", wrapper)
def buildcgiapplet(): buildtools.DEBUG=1 # Find the template # (there's no point in proceeding if we can't find it) template = buildtools.findtemplate() wrapper = os.path.join(sys.exec_prefix, ":Mac:Tools:CGI:PythonCGISlave.py") # Ask for source text if not specified in sys.argv[1:] if not sys.argv[1:]: srcfss, ok =...
11921f22e5f56863293c15a8a2878e8da1bb489d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11921f22e5f56863293c15a8a2878e8da1bb489d/BuildCGIApplet.py
def makeconfig(infp, outfp, modules):
def makeconfig(infp, outfp, modules, with_ifdef=0):
def makeconfig(infp, outfp, modules): m1 = regex.compile('-- ADDMODULE MARKER 1 --') m2 = regex.compile('-- ADDMODULE MARKER 2 --') while 1: line = infp.readline() if not line: break outfp.write(line) if m1 and m1.search(line) >= 0: m1 = None for mod in modules: if mod in never: continue outfp.write('extern void init%s...
1278a3a5fbbcecb2bd81c5a1dcec2d2e3bbb5cba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1278a3a5fbbcecb2bd81c5a1dcec2d2e3bbb5cba/makeconfig.py
return pos, (val)
return (pos, len(val))
def _setval(self, pos, val): f = _open(self._datfile, 'rb+') f.seek(pos) f.write(val) f.close() return pos, (val)
d8bae50c4c96e750e72ca9ab58f365357f58145b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8bae50c4c96e750e72ca9ab58f365357f58145b/dumbdbm.py
raise socket.error, err
raise socket.error, (err, errorcode[err])
def connect(self, address): self.connected = False err = self.socket.connect_ex(address) # XXX Should interpret Winsock return values if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): return if err in (0, EISCONN): self.addr = address self.connected = True self.handle_connect() else: raise socket.error, err
21e4f83d02d889fa0487a0802c0498bae2611c0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/21e4f83d02d889fa0487a0802c0498bae2611c0c/asyncore.py
raise socket.error, why
raise
def accept(self): # XXX can return either an address pair or None try: conn, addr = self.socket.accept() return conn, addr except socket.error, why: if why[0] == EWOULDBLOCK: pass else: raise socket.error, why
21e4f83d02d889fa0487a0802c0498bae2611c0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/21e4f83d02d889fa0487a0802c0498bae2611c0c/asyncore.py
raise socket.error, why
raise
def send(self, data): try: result = self.socket.send(data) return result except socket.error, why: if why[0] == EWOULDBLOCK: return 0 else: raise socket.error, why return 0
21e4f83d02d889fa0487a0802c0498bae2611c0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/21e4f83d02d889fa0487a0802c0498bae2611c0c/asyncore.py
raise socket.error, why
raise
def recv(self, buffer_size): try: data = self.socket.recv(buffer_size) if not data: # a closed connection is indicated by signaling # a read condition, and having recv() return 0. self.handle_close() return '' else: return data except socket.error, why: # winsock sometimes throws ENOTCONN if why[0] in [ECONNRESET, ENOT...
21e4f83d02d889fa0487a0802c0498bae2611c0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/21e4f83d02d889fa0487a0802c0498bae2611c0c/asyncore.py
sectname = "formatter_%s" % form
sectname = "formatter_%s" % string.strip(form)
def _create_formatters(cp): """Create and return formatters""" flist = cp.get("formatters", "keys") if not len(flist): return {} flist = string.split(flist, ",") formatters = {} for form in flist: sectname = "formatter_%s" % form opts = cp.options(sectname) if "format" in opts: fs = cp.get(sectname, "format", 1) else: ...
2d5c058ac52657a9315c0e130b4789b70f4305f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2d5c058ac52657a9315c0e130b4789b70f4305f6/config.py
sectname = "handler_%s" % hand
sectname = "handler_%s" % string.strip(hand)
def _install_handlers(cp, formatters): """Install and return handlers""" hlist = cp.get("handlers", "keys") if not len(hlist): return {} hlist = string.split(hlist, ",") handlers = {} fixups = [] #for inter-handler references for hand in hlist: sectname = "handler_%s" % hand klass = cp.get(sectname, "class") opts = cp....
2d5c058ac52657a9315c0e130b4789b70f4305f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2d5c058ac52657a9315c0e130b4789b70f4305f6/config.py
log.addHandler(handlers[hand])
log.addHandler(handlers[string.strip(hand)])
def _install_loggers(cp, handlers): """Create and install loggers""" # configure the root first llist = cp.get("loggers", "keys") llist = string.split(llist, ",") llist.remove("root") sectname = "logger_root" root = logging.root log = root opts = cp.options(sectname) if "level" in opts: level = cp.get(sectname, "level...
2d5c058ac52657a9315c0e130b4789b70f4305f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2d5c058ac52657a9315c0e130b4789b70f4305f6/config.py
logger.addHandler(handlers[hand])
logger.addHandler(handlers[string.strip(hand)])
def _install_loggers(cp, handlers): """Create and install loggers""" # configure the root first llist = cp.get("loggers", "keys") llist = string.split(llist, ",") llist.remove("root") sectname = "logger_root" root = logging.root log = root opts = cp.options(sectname) if "level" in opts: level = cp.get(sectname, "level...
2d5c058ac52657a9315c0e130b4789b70f4305f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2d5c058ac52657a9315c0e130b4789b70f4305f6/config.py
if module not in save_modules:
if module not in save_modules and module.startswith("test."):
def main(tests=None, testdir=None): """Execute a test suite. This also parses command-line options and modifies its behaviour accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly w...
1c074b8305a819c7d644e4135813ee67127149d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1c074b8305a819c7d644e4135813ee67127149d4/regrtest.py