rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
if s != u'\xa0\xc2\u1234 \x11abc\xff\u1234': | if s != unicode(r'\xa0\xc2\u1234 \x11abc\xff\u1234', 'unicode-escape'): | def testunicode(): try: array.array('b', u'foo') except TypeError: pass else: raise TestFailed("creating a non-unicode array from " "a Unicode string should fail") x = array.array('u', u'\xa0\xc2\u1234') x.fromunicode(u' ') x.fromunicode(u'') x.fromunicode(u'') x.fromunicode(u'\x11abc\xff\u1234') s = x.tounicode() if s != u'\xa0\xc2\u1234 \x11abc\xff\u1234': raise TestFailed("fromunicode()/tounicode()") s = u'\x00="\'a\\b\x80\xff\u0000\u0001\u1234' a = array.array('u', s) if verbose: print "repr of type 'u' array:", repr(a) print " expected: array('u', %r)" % s | db6b399f23452fdc46f5281f0de1fff07600367f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6b399f23452fdc46f5281f0de1fff07600367f/test_array.py |
s = u'\x00="\'a\\b\x80\xff\u0000\u0001\u1234' | s = unicode(r'\x00="\'a\\b\x80\xff\u0000\u0001\u1234', 'unicode-escape') | def testunicode(): try: array.array('b', u'foo') except TypeError: pass else: raise TestFailed("creating a non-unicode array from " "a Unicode string should fail") x = array.array('u', u'\xa0\xc2\u1234') x.fromunicode(u' ') x.fromunicode(u'') x.fromunicode(u'') x.fromunicode(u'\x11abc\xff\u1234') s = x.tounicode() if s != u'\xa0\xc2\u1234 \x11abc\xff\u1234': raise TestFailed("fromunicode()/tounicode()") s = u'\x00="\'a\\b\x80\xff\u0000\u0001\u1234' a = array.array('u', s) if verbose: print "repr of type 'u' array:", repr(a) print " expected: array('u', %r)" % s | db6b399f23452fdc46f5281f0de1fff07600367f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6b399f23452fdc46f5281f0de1fff07600367f/test_array.py |
def test(): root = Tk() def doit(root=root): d = SimpleDialog(root, | if __name__ == '__main__': def test(): root = Tk() def doit(root=root): d = SimpleDialog(root, | def test(): root = Tk() def doit(root=root): d = SimpleDialog(root, text="This is a test dialog. " "Would this have been an actual dialog, " "the buttons below would have been glowing " "in soft pink light.\n" "Do you believe this?", buttons=["Yes", "No", "Cancel"], default=0, cancel=2, title="Test Dialog") print d.go() t = Button(root, text='Test', command=doit) t.pack() q = Button(root, text='Quit', command=t.quit) q.pack() t.mainloop() | 604c179b1b09c34e7464045e39a9637011692031 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/604c179b1b09c34e7464045e39a9637011692031/SimpleDialog.py |
print d.go() t = Button(root, text='Test', command=doit) t.pack() q = Button(root, text='Quit', command=t.quit) q.pack() t.mainloop() | print d.go() t = Button(root, text='Test', command=doit) t.pack() q = Button(root, text='Quit', command=t.quit) q.pack() t.mainloop() | def doit(root=root): d = SimpleDialog(root, text="This is a test dialog. " "Would this have been an actual dialog, " "the buttons below would have been glowing " "in soft pink light.\n" "Do you believe this?", buttons=["Yes", "No", "Cancel"], default=0, cancel=2, title="Test Dialog") print d.go() | 604c179b1b09c34e7464045e39a9637011692031 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/604c179b1b09c34e7464045e39a9637011692031/SimpleDialog.py |
if __name__ == '__main__': | def doit(root=root): d = SimpleDialog(root, text="This is a test dialog. " "Would this have been an actual dialog, " "the buttons below would have been glowing " "in soft pink light.\n" "Do you believe this?", buttons=["Yes", "No", "Cancel"], default=0, cancel=2, title="Test Dialog") print d.go() | 604c179b1b09c34e7464045e39a9637011692031 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/604c179b1b09c34e7464045e39a9637011692031/SimpleDialog.py |
|
args=(), kwargs={}, verbose=None): | args=(), kwargs=None, verbose=None): | def __init__(self, group=None, target=None, name=None, args=(), kwargs={}, verbose=None): assert group is None, "group argument must be None for now" _Verbose.__init__(self, verbose) self.__target = target self.__name = str(name or _newname()) self.__args = args self.__kwargs = kwargs self.__daemonic = self._set_daemon() self.__started = False self.__stopped = False self.__block = Condition(Lock()) self.__initialized = True # sys.stderr is not stored in the class like # sys.exc_info since it can be changed between instances self.__stderr = _sys.stderr | 690241df6862860aaad09dff853c4669701e0a2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/690241df6862860aaad09dff853c4669701e0a2b/threading.py |
def maybe_mutate(): global mutate if not mutate: return if random.random() < 0.5: return if random.random() < 0.5: target, keys = dict1, dict1keys else: target, keys = dict2, dict2keys if random.random() < 0.2: # Insert a new key. mutate = 0 # disable mutation until key inserted while 1: newkey = Horrid(random.randrange(100)) if newkey not in target: break target[newkey] = Horrid(random.randrange(100)) keys.append(newkey) mutate = 1 elif keys: # Delete a key at random. i = random.randrange(len(keys)) key = keys[i] del target[key] # CAUTION: don't use keys.remove(key) here. Or do <wink>. The # point is that .remove() would trigger more comparisons, and so # also more calls to this routine. We're mutating often enough # without that. del keys[i] | 95d4f6fec86d39e2a0acc5bafe09163df283195e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/95d4f6fec86d39e2a0acc5bafe09163df283195e/test_mutants.py |
||
libraries, extradirs, extraexportsymbols, outputdir) | libraries, extradirs, extraexportsymbols, outputdir, libraryflags, stdlibraryflags, prefixname) | def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir) return templatename = "template-%s" % architecture targetname = "%s.%s" % (module, architecture) dllname = "%s.%s.slb" % (module, architecture) if not project: if architecture != "ppc": project = "%s.%s.mcp"%(module, architecture) else: project = "%s.mcp"%module if not projectdir: projectdir = PROJECTDIR if not sources: sources = [module + 'module.c'] if not sourcedirs: for moduledir in MODULEDIRS: if '%' in moduledir: # For historical reasons an initial _ in the modulename # is not reflected in the folder name if module[0] == '_': modulewithout_ = module[1:] else: modulewithout_ = module moduledir = moduledir % modulewithout_ fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): moduledir, sourcefile = os.path.split(fn) sourcedirs = [relpath(projectdir, moduledir)] sources[0] = sourcefile break else: print "Warning: %s: sourcefile not found: %s"%(module, sources[0]) sourcedirs = [] if prefixname: pass elif architecture == "carbon": prefixname = "mwerks_carbonplugin_config.h" else: prefixname = "mwerks_plugin_config.h" dict = { "sysprefix" : relpath(projectdir, sys.prefix), "sources" : sources, "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, "mac_dllname" : dllname, "prefixname" : prefixname, } if libraryflags: dict['libraryflags'] = libraryflags if stdlibraryflags: dict['stdlibraryflags'] = stdlibraryflags mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename) | 736be72f8793ccab6608ce1c427e22d7e9182b29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/736be72f8793ccab6608ce1c427e22d7e9182b29/genpluginprojects.py |
libraries, extradirs, extraexportsymbols, outputdir) | libraries, extradirs, extraexportsymbols, outputdir, libraryflags, stdlibraryflags, prefixname) | def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir) return templatename = "template-%s" % architecture targetname = "%s.%s" % (module, architecture) dllname = "%s.%s.slb" % (module, architecture) if not project: if architecture != "ppc": project = "%s.%s.mcp"%(module, architecture) else: project = "%s.mcp"%module if not projectdir: projectdir = PROJECTDIR if not sources: sources = [module + 'module.c'] if not sourcedirs: for moduledir in MODULEDIRS: if '%' in moduledir: # For historical reasons an initial _ in the modulename # is not reflected in the folder name if module[0] == '_': modulewithout_ = module[1:] else: modulewithout_ = module moduledir = moduledir % modulewithout_ fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): moduledir, sourcefile = os.path.split(fn) sourcedirs = [relpath(projectdir, moduledir)] sources[0] = sourcefile break else: print "Warning: %s: sourcefile not found: %s"%(module, sources[0]) sourcedirs = [] if prefixname: pass elif architecture == "carbon": prefixname = "mwerks_carbonplugin_config.h" else: prefixname = "mwerks_plugin_config.h" dict = { "sysprefix" : relpath(projectdir, sys.prefix), "sources" : sources, "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, "mac_dllname" : dllname, "prefixname" : prefixname, } if libraryflags: dict['libraryflags'] = libraryflags if stdlibraryflags: dict['stdlibraryflags'] = stdlibraryflags mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename) | 736be72f8793ccab6608ce1c427e22d7e9182b29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/736be72f8793ccab6608ce1c427e22d7e9182b29/genpluginprojects.py |
genpluginproject("all", "_Res", outputdir="::Lib:Carbon") | genpluginproject("all", "_Res", stdlibraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") | def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload", libraryflags=None, stdlibraryflags=None, prefixname=None): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier to implement for now. genpluginproject("ppc", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir) genpluginproject("carbon", module, project, projectdir, sources, sourcedirs, libraries, extradirs, extraexportsymbols, outputdir) return templatename = "template-%s" % architecture targetname = "%s.%s" % (module, architecture) dllname = "%s.%s.slb" % (module, architecture) if not project: if architecture != "ppc": project = "%s.%s.mcp"%(module, architecture) else: project = "%s.mcp"%module if not projectdir: projectdir = PROJECTDIR if not sources: sources = [module + 'module.c'] if not sourcedirs: for moduledir in MODULEDIRS: if '%' in moduledir: # For historical reasons an initial _ in the modulename # is not reflected in the folder name if module[0] == '_': modulewithout_ = module[1:] else: modulewithout_ = module moduledir = moduledir % modulewithout_ fn = os.path.join(projectdir, os.path.join(moduledir, sources[0])) if os.path.exists(fn): moduledir, sourcefile = os.path.split(fn) sourcedirs = [relpath(projectdir, moduledir)] sources[0] = sourcefile break else: print "Warning: %s: sourcefile not found: %s"%(module, sources[0]) sourcedirs = [] if prefixname: pass elif architecture == "carbon": prefixname = "mwerks_carbonplugin_config.h" else: prefixname = "mwerks_plugin_config.h" dict = { "sysprefix" : relpath(projectdir, sys.prefix), "sources" : sources, "extrasearchdirs" : sourcedirs + extradirs, "libraries": libraries, "mac_outputdir" : outputdir, "extraexportsymbols" : extraexportsymbols, "mac_targetname" : targetname, "mac_dllname" : dllname, "prefixname" : prefixname, } if libraryflags: dict['libraryflags'] = libraryflags if stdlibraryflags: dict['stdlibraryflags'] = stdlibraryflags mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename) | 736be72f8793ccab6608ce1c427e22d7e9182b29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/736be72f8793ccab6608ce1c427e22d7e9182b29/genpluginprojects.py |
nil = fp.read() fp.close() | def http_error_302(self, req, fp, code, msg, headers): if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return nil = fp.read() fp.close() | 5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0/urllib2.py |
|
self.inf_msg + msg, headers) | self.inf_msg + msg, headers, fp) | def http_error_302(self, req, fp, code, msg, headers): if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return nil = fp.read() fp.close() | 5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0/urllib2.py |
p | def do_proxy(self, p, req): p return self.parent.open(req) | 5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0/urllib2.py |
|
passwd = HTTPPassowrdMgr() | passwd = HTTPPasswordMgr() | def __init__(self, passwd=None): if passwd is None: passwd = HTTPPassowrdMgr() self.passwd = passwd self.add_password = self.passwd.add_password self.__current_realm = None | 5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0/urllib2.py |
opener = OpenerDirectory() | opener = OpenerDirector() | def build_opener(self): opener = OpenerDirectory() for ph in self.proxy_handlers: if type(ph) == types.ClassType: ph = ph() opener.add_handler(ph) | 5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bbbd4294ac08f3fc66ccaa5a749c7ff417782f0/urllib2.py |
a[8] and b[17] match for 6 elements a[14] and b[23] match for 15 elements | a[8] and b[17] match for 21 elements | def _calculate_ratio(matches, length): if length: return 2.0 * matches / length return 1.0 | 7c9c388d5233d32b2025500c5dff79a1fc55ab98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c9c388d5233d32b2025500c5dff79a1fc55ab98/difflib.py |
equal a[8:14] b[17:23] equal a[14:29] b[23:38] | equal a[8:29] b[17:38] | def _calculate_ratio(matches, length): if length: return 2.0 * matches / length return 1.0 | 7c9c388d5233d32b2025500c5dff79a1fc55ab98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c9c388d5233d32b2025500c5dff79a1fc55ab98/difflib.py |
i and in j. | i and in j. New in Python 2.5, it's also guaranteed that if (i, j, n) and (i', j', n') are adjacent triples in the list, and the second is not the last triple in the list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe adjacent equal blocks. | def get_matching_blocks(self): """Return list of triples describing matching subsequences. | 7c9c388d5233d32b2025500c5dff79a1fc55ab98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c9c388d5233d32b2025500c5dff79a1fc55ab98/difflib.py |
self.matching_blocks = matching_blocks = [] | def get_matching_blocks(self): """Return list of triples describing matching subsequences. | 7c9c388d5233d32b2025500c5dff79a1fc55ab98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c9c388d5233d32b2025500c5dff79a1fc55ab98/difflib.py |
|
matching_blocks.append( (la, lb, 0) ) return matching_blocks | i1 = j1 = k1 = 0 non_adjacent = [] for i2, j2, k2 in matching_blocks: if i1 + k1 == i2 and j1 + k1 == j2: k1 += k2 else: if k1: non_adjacent.append((i1, j1, k1)) i1, j1, k1 = i2, j2, k2 if k1: non_adjacent.append((i1, j1, k1)) non_adjacent.append( (la, lb, 0) ) self.matching_blocks = non_adjacent return self.matching_blocks | def get_matching_blocks(self): """Return list of triples describing matching subsequences. | 7c9c388d5233d32b2025500c5dff79a1fc55ab98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c9c388d5233d32b2025500c5dff79a1fc55ab98/difflib.py |
self.msg('IAC %s %d', c == DO and 'DO' or 'DONT', ord(c)) self.sock.send(IAC + WONT + opt) | self.msg('IAC %s %d', c == DO and 'DO' or 'DONT', ord(opt)) if self.option_callback: self.option_callback(self.sock, c, opt) else: self.sock.send(IAC + WONT + opt) | def process_rawq(self): """Transfer from raw queue to cooked queue. | 74cc4ec526faf0009042444a5c11ab2ac3aa5aae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/74cc4ec526faf0009042444a5c11ab2ac3aa5aae/telnetlib.py |
c == WILL and 'WILL' or 'WONT', ord(c)) self.sock.send(IAC + DONT + opt) | c == WILL and 'WILL' or 'WONT', ord(opt)) if self.option_callback: self.option_callback(self.sock, c, opt) else: self.sock.send(IAC + DONT + opt) | def process_rawq(self): """Transfer from raw queue to cooked queue. | 74cc4ec526faf0009042444a5c11ab2ac3aa5aae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/74cc4ec526faf0009042444a5c11ab2ac3aa5aae/telnetlib.py |
self.msg('IAC %s not recognized' % `c`) | self.msg('IAC %d not recognized' % ord(opt)) | def process_rawq(self): """Transfer from raw queue to cooked queue. | 74cc4ec526faf0009042444a5c11ab2ac3aa5aae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/74cc4ec526faf0009042444a5c11ab2ac3aa5aae/telnetlib.py |
for l in text[1:]: lines.append (big_indent + l) | def generate_help (self, header=None): """Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object.""" | 5b9fd6c67e4f04c5fa9be8e421bcfae30f303bcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b9fd6c67e4f04c5fa9be8e421bcfae30f303bcc/fancy_getopt.py |
|
def putrequest(self, method, url, skip_host=0): | def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): | def putrequest(self, method, url, skip_host=0): """Send a request to the server. | 24c2750f2d068b58dcf29a18cd2cae41c07ff188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/24c2750f2d068b58dcf29a18cd2cae41c07ff188/httplib.py |
def putrequest(self, method, url, skip_host=0): """Send a request to the server. | 24c2750f2d068b58dcf29a18cd2cae41c07ff188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/24c2750f2d068b58dcf29a18cd2cae41c07ff188/httplib.py |
||
self.putheader('Accept-Encoding', 'identity') | if not skip_accept_encoding: self.putheader('Accept-Encoding', 'identity') | def putrequest(self, method, url, skip_host=0): """Send a request to the server. | 24c2750f2d068b58dcf29a18cd2cae41c07ff188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/24c2750f2d068b58dcf29a18cd2cae41c07ff188/httplib.py |
verify(float(a).__class__ is float) | def __repr__(self): return "%.*g" % (self.prec, self) | 9a6cf0303393fd29c3b95f4fa62a8b8a590d8694 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9a6cf0303393fd29c3b95f4fa62a8b8a590d8694/test_descr.py |
|
self.announce(e.msg, log.ERROR) | self.announce(str(e), log.ERROR) | def upload_file(self, command, pyversion, filename): # Sign if requested if self.sign: gpg_args = ["gpg", "--detach-sign", "-a", filename] if self.identity: gpg_args[2:2] = ["--local-user", self.identity] spawn(gpg_args, dry_run=self.dry_run) | 58ad189776930998dfece005da86eba6a7b01c5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58ad189776930998dfece005da86eba6a7b01c5e/upload.py |
except IOError: | except IOError, reason: | def main(self): | f25521a6d07c968b7f585598e43d332e4c2af3bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f25521a6d07c968b7f585598e43d332e4c2af3bb/pybench.py |
except IOError: | except IOError, reason: | def main(self): | f25521a6d07c968b7f585598e43d332e4c2af3bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f25521a6d07c968b7f585598e43d332e4c2af3bb/pybench.py |
if timeout is None: while not self.__stopped: self.__block.wait() if __debug__: self._note("%s.join(): thread stopped", self) else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else: | try: if timeout is None: while not self.__stopped: self.__block.wait() | def join(self, timeout=None): assert self.__initialized, "Thread.__init__() not called" assert self.__started, "cannot join thread before it is started" assert self is not currentThread(), "cannot join current thread" if __debug__: if not self.__stopped: self._note("%s.join(): waiting until thread stops", self) self.__block.acquire() if timeout is None: while not self.__stopped: self.__block.wait() if __debug__: self._note("%s.join(): thread stopped", self) else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else: if __debug__: self._note("%s.join(): thread stopped", self) self.__block.release() | c66948eac73f4d518ea76bb4ea45f37eaf5744cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c66948eac73f4d518ea76bb4ea45f37eaf5744cc/threading.py |
self.__block.release() | else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else: if __debug__: self._note("%s.join(): thread stopped", self) finally: self.__block.release() | def join(self, timeout=None): assert self.__initialized, "Thread.__init__() not called" assert self.__started, "cannot join thread before it is started" assert self is not currentThread(), "cannot join current thread" if __debug__: if not self.__stopped: self._note("%s.join(): waiting until thread stops", self) self.__block.acquire() if timeout is None: while not self.__stopped: self.__block.wait() if __debug__: self._note("%s.join(): thread stopped", self) else: deadline = _time() + timeout while not self.__stopped: delay = deadline - _time() if delay <= 0: if __debug__: self._note("%s.join(): timed out", self) break self.__block.wait(delay) else: if __debug__: self._note("%s.join(): thread stopped", self) self.__block.release() | c66948eac73f4d518ea76bb4ea45f37eaf5744cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c66948eac73f4d518ea76bb4ea45f37eaf5744cc/threading.py |
except pickle.UnpicklingError: | except pickle.PicklingError: | def putmessage(self, message): self.debug("putmessage:%d:" % message[0]) try: s = pickle.dumps(message) except pickle.UnpicklingError: print >>sys.__stderr__, "Cannot pickle:", `message` raise s = struct.pack("<i", len(s)) + s while len(s) > 0: try: n = self.sock.send(s) except (AttributeError, socket.error): # socket was closed raise IOError else: s = s[n:] | a59f7ae2730843e575e136e132cfcbe24a1d8b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a59f7ae2730843e575e136e132cfcbe24a1d8b59/rpc.py |
n = self.sock.send(s) | r, w, x = select.select([], [self.sock], []) n = self.sock.send(s[:BUFSIZE]) | def putmessage(self, message): self.debug("putmessage:%d:" % message[0]) try: s = pickle.dumps(message) except pickle.UnpicklingError: print >>sys.__stderr__, "Cannot pickle:", `message` raise s = struct.pack("<i", len(s)) + s while len(s) > 0: try: n = self.sock.send(s) except (AttributeError, socket.error): # socket was closed raise IOError else: s = s[n:] | a59f7ae2730843e575e136e132cfcbe24a1d8b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a59f7ae2730843e575e136e132cfcbe24a1d8b59/rpc.py |
def ioready(self, wait): r, w, x = select.select([self.sock.fileno()], [], [], wait) return len(r) | def ioready(self, wait): r, w, x = select.select([self.sock.fileno()], [], [], wait) return len(r) | a59f7ae2730843e575e136e132cfcbe24a1d8b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a59f7ae2730843e575e136e132cfcbe24a1d8b59/rpc.py |
|
if not self.ioready(wait): | r, w, x = select.select([self.sock.fileno()], [], [], wait) if len(r) == 0: | def pollpacket(self, wait): self._stage0() if len(self.buffer) < self.bufneed: if not self.ioready(wait): return None try: s = self.sock.recv(BUFSIZE) except socket.error: raise EOFError if len(s) == 0: raise EOFError self.buffer += s self._stage0() return self._stage1() | a59f7ae2730843e575e136e132cfcbe24a1d8b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a59f7ae2730843e575e136e132cfcbe24a1d8b59/rpc.py |
except: | except pickle.UnpicklingError: | def pollmessage(self, wait): packet = self.pollpacket(wait) if packet is None: return None try: message = pickle.loads(packet) except: print >>sys.__stderr__, "-----------------------" print >>sys.__stderr__, "cannot unpickle packet:", `packet` traceback.print_stack(file=sys.__stderr__) print >>sys.__stderr__, "-----------------------" raise return message | a59f7ae2730843e575e136e132cfcbe24a1d8b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a59f7ae2730843e575e136e132cfcbe24a1d8b59/rpc.py |
for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) self.outfiles.append(out) | if f[1] == []: self.outfiles.append(dir) else: for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) self.outfiles.append(out) | def run (self): self.mkpath(self.install_dir) for f in self.data_files: if type(f) == StringType: # it's a simple file, so copy it f = convert_path(f) if self.warn_dir: self.warn("setup script did not provide a directory for " "'%s' -- installing right in '%s'" % (f, self.install_dir)) (out, _) = self.copy_file(f, self.install_dir) self.outfiles.append(out) else: # it's a tuple with path to install to and a list of files dir = convert_path(f[0]) if not os.path.isabs(dir): dir = os.path.join(self.install_dir, dir) elif self.root: dir = change_root(self.root, dir) self.mkpath(dir) for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) self.outfiles.append(out) | 76ae1f54051b988220b9adba5ba190d36c3ef0de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/76ae1f54051b988220b9adba5ba190d36c3ef0de/install_data.py |
from Carbon import Qd | def close(self): if self.editgroup.editor.changed: import EasyDialogs from Carbon import Qd Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save window "%s" before closing?' % self.title, default=1, no="Don\xd5t save") if save > 0: if self.domenu_save(): return 1 elif save < 0: return 1 self.globals = None W.Window.close(self) | cc05327f1a884449e59676683450b01d0a266b10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc05327f1a884449e59676683450b01d0a266b10/PyEdit.py |
|
import Qd; Qd.InitCursor() | Qd.InitCursor() | def _run(self): if self.run_with_interpreter: if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run unsaved file" self._run_with_interpreter() elif self.run_with_cl_interpreter: # Until universal newline support if self._eoln != '\n': import EasyDialogs ok = EasyDialogs.AskYesNoCancel('Warning: "%s" does not have Unix line-endings' % self.title, 1, yes='OK', no='') if not ok: return if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run unsaved file" self._run_with_cl_interpreter() else: pytext = self.editgroup.editor.get() globals, file, modname = self.getenvironment() self.execstring(pytext, globals, globals, file, modname) | cc05327f1a884449e59676683450b01d0a266b10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc05327f1a884449e59676683450b01d0a266b10/PyEdit.py |
if self._eoln != '\n': import EasyDialogs ok = EasyDialogs.AskYesNoCancel('Warning: "%s" does not have Unix line-endings' % self.title, 1, yes='OK', no='') if not ok: return | def _run(self): if self.run_with_interpreter: if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run unsaved file" self._run_with_interpreter() elif self.run_with_cl_interpreter: # Until universal newline support if self._eoln != '\n': import EasyDialogs ok = EasyDialogs.AskYesNoCancel('Warning: "%s" does not have Unix line-endings' % self.title, 1, yes='OK', no='') if not ok: return if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run unsaved file" self._run_with_cl_interpreter() else: pytext = self.editgroup.editor.get() globals, file, modname = self.getenvironment() self.execstring(pytext, globals, globals, file, modname) | cc05327f1a884449e59676683450b01d0a266b10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc05327f1a884449e59676683450b01d0a266b10/PyEdit.py |
|
import Qd; Qd.InitCursor() | Qd.InitCursor() | def _run(self): if self.run_with_interpreter: if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run unsaved file" self._run_with_interpreter() elif self.run_with_cl_interpreter: # Until universal newline support if self._eoln != '\n': import EasyDialogs ok = EasyDialogs.AskYesNoCancel('Warning: "%s" does not have Unix line-endings' % self.title, 1, yes='OK', no='') if not ok: return if self.editgroup.editor.changed: import EasyDialogs import Qd; Qd.InitCursor() save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1) if save > 0: if self.domenu_save(): return elif save < 0: return if not self.path: raise W.AlertError, "Can't run unsaved file" self._run_with_cl_interpreter() else: pytext = self.editgroup.editor.get() globals, file, modname = self.getenvironment() self.execstring(pytext, globals, globals, file, modname) | cc05327f1a884449e59676683450b01d0a266b10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cc05327f1a884449e59676683450b01d0a266b10/PyEdit.py |
if type(value) != type([]): | if type(value) not in (type([]), type( () )): | def post_to_server(self, data, auth=None): ''' Post a query to the server, and return a string response. ''' | f94437b9b874785c3086a112b0fe140bbe66031e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f94437b9b874785c3086a112b0fe140bbe66031e/register.py |
def seek(self, pos, whence=0): if whence==1: self.pos = self.pos + pos if whence==2: self.pos = self.stop + pos else: self.pos = self.start + pos | def __init__(self, fp, factory=rfc822.Message): self.fp = fp self.seekp = 0 self.factory = factory | 8abcfe7656ab064f04db590da57f5f696b307f4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8abcfe7656ab064f04db590da57f5f696b307f4a/mailbox.py |
|
self.closed = 0 | self.closed = False | def __init__(self, buf = ''): # Force self.buf to be a string or unicode if not isinstance(buf, basestring): buf = str(buf) self.buf = buf self.len = len(buf) self.buflist = [] self.pos = 0 self.closed = 0 self.softspace = 0 | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
self.closed = 1 | self.closed = True | def close(self): """Free the memory buffer. """ if not self.closed: self.closed = 1 del self.buf, self.pos | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def isatty(self): if self.closed: raise ValueError, "I/O operation on closed file" return False | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def seek(self, pos, mode = 0): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf += ''.join(self.buflist) self.buflist = [] if mode == 1: pos += self.pos elif mode == 2: pos += self.len self.pos = max(0, pos) | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def tell(self): if self.closed: raise ValueError, "I/O operation on closed file" return self.pos | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def read(self, n = -1): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf += ''.join(self.buflist) self.buflist = [] if n < 0: newpos = self.len else: newpos = min(self.pos+n, self.len) r = self.buf[self.pos:newpos] self.pos = newpos return r | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def readline(self, length=None): if self.closed: raise ValueError, "I/O operation on closed file" if self.buflist: self.buf += ''.join(self.buflist) self.buflist = [] i = self.buf.find('\n', self.pos) if i < 0: newpos = self.len else: newpos = i+1 if length is not None: if self.pos + length < newpos: newpos = self.pos + length r = self.buf[self.pos:newpos] self.pos = newpos return r | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def truncate(self, size=None): if self.closed: raise ValueError, "I/O operation on closed file" if size is None: size = self.pos elif size < 0: raise IOError(EINVAL, "Negative size not allowed") elif size < self.pos: self.pos = size self.buf = self.getvalue()[:size] | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def write(self, s): if self.closed: raise ValueError, "I/O operation on closed file" if not s: return # Force s to be a string or unicode if not isinstance(s, basestring): s = str(s) if self.pos == self.len: self.buflist.append(s) self.len = self.pos = self.pos + len(s) return if self.pos > self.len: self.buflist.append('\0'*(self.pos - self.len)) self.len = self.pos newpos = self.pos + len(s) if self.pos < self.len: if self.buflist: self.buf += ''.join(self.buflist) self.buflist = [] self.buflist = [self.buf[:self.pos], s, self.buf[newpos:]] self.buf = '' if newpos > self.len: self.len = newpos else: self.buflist.append(s) self.len = newpos self.pos = newpos | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def flush(self): if self.closed: raise ValueError, "I/O operation on closed file" | 6542690b4188f7f53b198ea23efc9b5bbea194dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6542690b4188f7f53b198ea23efc9b5bbea194dc/StringIO.py |
except TypeError: | except (AttributeError, TypeError): | def softspace(file, newvalue): oldvalue = 0 try: oldvalue = file.softspace except AttributeError: pass try: file.softspace = newvalue except TypeError: # "attribute-less object" or "read-only attributes" pass return oldvalue | 9dd492d59a9939223645f1625527ebc0d179b44f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9dd492d59a9939223645f1625527ebc0d179b44f/code.py |
raise ValueError("time data did not match format") | raise ValueError("time data did not match format: data=%s fmt=%s" % (data_string, format)) | def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string.""" global _locale_cache global _regex_cache locale_time = _locale_cache.locale_time # If the language changes, caches are invalidated, so clear them if locale_time.lang != _getlang(): _locale_cache = TimeRE() _regex_cache.clear() format_regex = _regex_cache.get(format) if not format_regex: # Limit regex cache size to prevent major bloating of the module; # The value 5 is arbitrary if len(_regex_cache) > 5: _regex_cache.clear() format_regex = _locale_cache.compile(format) _regex_cache[format] = format_regex found = format_regex.match(data_string) if not found: raise ValueError("time data did not match format") if len(data_string) != found.end(): raise ValueError("unconverted data remains: %s" % data_string[found.end():]) year = 1900 month = day = 1 hour = minute = second = 0 tz = -1 # weekday and julian defaulted to -1 so as to signal need to calculate values weekday = julian = -1 found_dict = found.groupdict() for group_key in found_dict.iterkeys(): if group_key == 'y': year = int(found_dict['y']) # Open Group specification for strptime() states that a %y #value in the range of [00, 68] is in the century 2000, while #[69,99] is in the century 1900 if year <= 68: year += 2000 else: year += 1900 elif group_key == 'Y': year = int(found_dict['Y']) elif group_key == 'm': month = int(found_dict['m']) elif group_key == 'B': month = _insensitiveindex(locale_time.f_month, found_dict['B']) elif group_key == 'b': month = _insensitiveindex(locale_time.a_month, found_dict['b']) elif group_key == 'd': day = int(found_dict['d']) elif group_key == 'H': hour = int(found_dict['H']) elif group_key == 'I': hour = int(found_dict['I']) ampm = found_dict.get('p', '').lower() # If there was no AM/PM indicator, we'll treat this like AM if ampm in ('', locale_time.am_pm[0].lower()): # We're in AM so the hour is correct unless we're # looking at 12 midnight. # 12 midnight == 12 AM == hour 0 if hour == 12: hour = 0 elif ampm == locale_time.am_pm[1].lower(): # We're in PM so we need to add 12 to the hour unless # we're looking at 12 noon. # 12 noon == 12 PM == hour 12 if hour != 12: hour += 12 elif group_key == 'M': minute = int(found_dict['M']) elif group_key == 'S': second = int(found_dict['S']) elif group_key == 'A': weekday = _insensitiveindex(locale_time.f_weekday, found_dict['A']) elif group_key == 'a': weekday = _insensitiveindex(locale_time.a_weekday, found_dict['a']) elif group_key == 'w': weekday = int(found_dict['w']) if weekday == 0: weekday = 6 else: weekday -= 1 elif group_key == 'j': julian = int(found_dict['j']) elif group_key == 'Z': # Since -1 is default value only need to worry about setting tz if # it can be something other than -1. found_zone = found_dict['Z'].lower() if locale_time.timezone[0] == locale_time.timezone[1] and \ time.daylight: pass #Deals with bad locale setup where timezone info is # the same; first found on FreeBSD 4.4. elif found_zone in ("utc", "gmt"): tz = 0 elif locale_time.timezone[2].lower() == found_zone: tz = 0 elif time.daylight and \ locale_time.timezone[3].lower() == found_zone: tz = 1 # Cannot pre-calculate datetime_date() since can change in Julian #calculation and thus could have different value for the day of the week #calculation if julian == -1: # Need to add 1 to result since first day of the year is 1, not 0. julian = datetime_date(year, month, day).toordinal() - \ datetime_date(year, 1, 1).toordinal() + 1 else: # Assume that if they bothered to include Julian day it will #be accurate datetime_result = datetime_date.fromordinal((julian - 1) + datetime_date(year, 1, 1).toordinal()) year = datetime_result.year month = datetime_result.month day = datetime_result.day if weekday == -1: weekday = datetime_date(year, month, day).weekday() return time.struct_time((year, month, day, hour, minute, second, weekday, julian, tz)) | bed2a30cdaaf5bbf3937ed3e63290b22ca65f5c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bed2a30cdaaf5bbf3937ed3e63290b22ca65f5c6/_strptime.py |
'marshal', 'math', 'md5', 'operator', | 'math', 'md5', 'operator', | def reload(self, module, path=None): if path is None and hasattr(module, '__filename__'): head, tail = os.path.split(module.__filename__) path = [os.path.join(head, '')] return ihooks.ModuleImporter.reload(self, module, path) | 026e8e32c712985e0d526be5af142d174027c2e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/026e8e32c712985e0d526be5af142d174027c2e8/rexec.py |
'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) | 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) | def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) host, port = splitport(host) if not port \ and socket.gethostbyname(host) in (localhost(), thishost()): urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) raise IOError, ('local file error', 'not on local host') | ef141c8252e5527b22cd6ac842db63a0ffa522a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ef141c8252e5527b22cd6ac842db63a0ffa522a0/urllib.py |
return addinfourl(open(url2pathname(file), 'rb'), | return addinfourl(open(localname, 'rb'), | def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) host, port = splitport(host) if not port \ and socket.gethostbyname(host) in (localhost(), thishost()): urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) raise IOError, ('local file error', 'not on local host') | ef141c8252e5527b22cd6ac842db63a0ffa522a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ef141c8252e5527b22cd6ac842db63a0ffa522a0/urllib.py |
return addinfourl(open(url2pathname(file), 'rb'), | return addinfourl(open(localname, 'rb'), | def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) host, port = splitport(host) if not port \ and socket.gethostbyname(host) in (localhost(), thishost()): urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) raise IOError, ('local file error', 'not on local host') | ef141c8252e5527b22cd6ac842db63a0ffa522a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ef141c8252e5527b22cd6ac842db63a0ffa522a0/urllib.py |
"exclude=", "include=", "package=", "strip") | "exclude=", "include=", "package=", "strip", "iconfile=") | def main(builder=None): if builder is None: builder = AppBuilder(verbosity=1) shortopts = "b:n:r:e:m:c:p:lx:i:hvq" longopts = ("builddir=", "name=", "resource=", "executable=", "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "standalone", "exclude=", "include=", "package=", "strip") try: options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) except getopt.error: usage() for opt, arg in options: if opt in ('-b', '--builddir'): builder.builddir = arg elif opt in ('-n', '--name'): builder.name = arg elif opt in ('-r', '--resource'): builder.resources.append(arg) elif opt in ('-e', '--executable'): builder.executable = arg elif opt in ('-m', '--mainprogram'): builder.mainprogram = arg elif opt in ('-c', '--creator'): builder.creator = arg elif opt == "--nib": builder.nibname = arg elif opt in ('-p', '--plist'): builder.plist = Plist.fromFile(arg) elif opt in ('-l', '--link'): builder.symlink = 1 elif opt == '--link-exec': builder.symlink_exec = 1 elif opt in ('-h', '--help'): usage() elif opt in ('-v', '--verbose'): builder.verbosity += 1 elif opt in ('-q', '--quiet'): builder.verbosity -= 1 elif opt == '--standalone': builder.standalone = 1 elif opt in ('-x', '--exclude'): builder.excludeModules.append(arg) elif opt in ('-i', '--include'): builder.includeModules.append(arg) elif opt == '--package': builder.includePackages.append(arg) elif opt == '--strip': builder.strip = 1 if len(args) != 1: usage("Must specify one command ('build', 'report' or 'help')") command = args[0] if command == "build": builder.setup() builder.build() elif command == "report": builder.setup() builder.report() elif command == "help": usage() else: usage("Unknown command '%s'" % command) | 11edf2e129a41542c8d7ba1370ddf7d44d0a83e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11edf2e129a41542c8d7ba1370ddf7d44d0a83e0/bundlebuilder.py |
p = Parser() | p = Parser(strict=1) | def test_bogus_boundary(self): fp = openfile(findfile('msg_15.txt')) try: data = fp.read() finally: fp.close() p = Parser() # Note, under a future non-strict parsing mode, this would parse the # message into the intended message tree. self.assertRaises(Errors.BoundaryError, p.parsestr, data) | 1b82ccf34f8b7355442a0e6e3588865865ad1f2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1b82ccf34f8b7355442a0e6e3588865865ad1f2b/test_email.py |
ExistingwasteObj_New, &we) ) return NULL; | WEOObj_Convert, &we) ) return NULL; | def outputCheckNewArg(self): Output("""if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }""") | 6a203c59d146d7c0c26c935bc767ceadc00ee8f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6a203c59d146d7c0c26c935bc767ceadc00ee8f5/wastesupport.py |
def join(a, b): if isabs(b): return b if a == '' or a[-1:] in '/\\': return a + b return a + os.sep + b | def join(a, *p): path = a for b in p: if isabs(b): path = b elif path == '' or path[-1:] in '/\\': path = path + b else: path = path + os.sep + b return path | def isabs(s): s = splitdrive(s)[1] return s != '' and s[:1] in '/\\' | 0f0b31022413145aa92ee61b6ae46482b4e1c46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0f0b31022413145aa92ee61b6ae46482b4e1c46b/dospath.py |
option = string.lower(option) | option = self.optionxform(option) | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c1da1078f47d55e42fecc2a9e46047446172dd40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c1da1078f47d55e42fecc2a9e46047446172dd40/ConfigParser.py |
__SECTCRE = re.compile( | SECTCRE = re.compile( | def getboolean(self, section, option): v = self.get(section, option) val = string.atoi(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val | c1da1078f47d55e42fecc2a9e46047446172dd40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c1da1078f47d55e42fecc2a9e46047446172dd40/ConfigParser.py |
__OPTCRE = re.compile( | OPTCRE = re.compile( | def getboolean(self, section, option): v = self.get(section, option) val = string.atoi(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val | c1da1078f47d55e42fecc2a9e46047446172dd40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c1da1078f47d55e42fecc2a9e46047446172dd40/ConfigParser.py |
mo = self.__SECTCRE.match(line) | mo = self.SECTCRE.match(line) | def __read(self, fp): """Parse a sectioned setup file. | c1da1078f47d55e42fecc2a9e46047446172dd40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c1da1078f47d55e42fecc2a9e46047446172dd40/ConfigParser.py |
mo = self.__OPTCRE.match(line) | mo = self.OPTCRE.match(line) | def __read(self, fp): """Parse a sectioned setup file. | c1da1078f47d55e42fecc2a9e46047446172dd40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c1da1078f47d55e42fecc2a9e46047446172dd40/ConfigParser.py |
opts, args = getopt.getopt(sys.argv[1:], 'e:p:') | opts, args = getopt.getopt(sys.argv[1:], 'e:p:P:') | def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | bbf003ce64fe627cd70357565d8e6a46983244b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbf003ce64fe627cd70357565d8e6a46983244b7/freeze.py |
binlib = os.path.join(prefix, 'lib/python/lib') | binlib = os.path.join(exec_prefix, 'lib/python/lib') | def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | bbf003ce64fe627cd70357565d8e6a46983244b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbf003ce64fe627cd70357565d8e6a46983244b7/freeze.py |
defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', | defines = ['-DHAVE_CONFIG_H', | def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | bbf003ce64fe627cd70357565d8e6a46983244b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbf003ce64fe627cd70357565d8e6a46983244b7/freeze.py |
for dir in [prefix, binlib, incldir] + extensions: | for dir in [prefix, exec_prefix, binlib, incldir] + extensions: | def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | bbf003ce64fe627cd70357565d8e6a46983244b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbf003ce64fe627cd70357565d8e6a46983244b7/freeze.py |
for file in config_c_in, makefile_in, frozenmain_c: | for file in [config_c_in, makefile_in] + supp_sources: | def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | bbf003ce64fe627cd70357565d8e6a46983244b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbf003ce64fe627cd70357565d8e6a46983244b7/freeze.py |
files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ | files = ['$(OPT)', config_c, frozen_c] + \ supp_sources + addfiles + libs + \ | def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | bbf003ce64fe627cd70357565d8e6a46983244b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbf003ce64fe627cd70357565d8e6a46983244b7/freeze.py |
doc(arg) | help.help(arg) | def stopped(): print 'pydoc server stopped' | e83ab454f498bc3440faadf86f62b002191e1722 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e83ab454f498bc3440faadf86f62b002191e1722/pydoc.py |
function, module, or package, or a dotted reference to a class or function within a module or module in a package. If <name> contains a '%s', it is used as the path to a Python source file to document. | Python keyword, topic, function, module, or package, or a dotted reference to a class or function within a module or module in a package. If <name> contains a '%s', it is used as the path to a Python source file to document. If name is 'keywords', 'topics', or 'modules', a listing of these things is displayed. | def stopped(): print 'pydoc server stopped' | e83ab454f498bc3440faadf86f62b002191e1722 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e83ab454f498bc3440faadf86f62b002191e1722/pydoc.py |
self.c_func_name = arg | self.c_func_name = repr(arg) | def trace_dispatch(self, frame, event, arg): timer = self.timer t = timer() t = t[0] + t[1] - self.t - self.bias | 4bebed7f41d355b06ad80be190d79611a385cc7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4bebed7f41d355b06ad80be190d79611a385cc7e/profile.py |
self.c_func_name = arg | self.c_func_name = repr(arg) | def trace_dispatch_i(self, frame, event, arg): timer = self.timer t = timer() - self.t - self.bias | 4bebed7f41d355b06ad80be190d79611a385cc7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4bebed7f41d355b06ad80be190d79611a385cc7e/profile.py |
self.c_func_name = arg | self.c_func_name = repr(arg) | def trace_dispatch_mac(self, frame, event, arg): timer = self.timer t = timer()/60.0 - self.t - self.bias | 4bebed7f41d355b06ad80be190d79611a385cc7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4bebed7f41d355b06ad80be190d79611a385cc7e/profile.py |
self.c_func_name = arg | self.c_func_name = repr(arg) | def trace_dispatch_l(self, frame, event, arg): get_time = self.get_time t = get_time() - self.t - self.bias | 4bebed7f41d355b06ad80be190d79611a385cc7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4bebed7f41d355b06ad80be190d79611a385cc7e/profile.py |
'Copyright: ' + self.distribution.get_license(), | 'License: ' + self.distribution.get_license(), | 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: ' + self.distribution.get_description(), ] | 240e94eb9587bcf37cf89cb03f6c342e861c0392 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/240e94eb9587bcf37cf89cb03f6c342e861c0392/bdist_rpm.py |
'include_dirs', if given, must be a list of strings, the directories to add to the default include file search path for this compilation only. | 'include_dirs', if given, must be a list of strings, the directories to add to the default include file search path for this compilation only. 'debug' is a boolean; if true, the compiler will be instructed to output debug symbols in (or alongside) the object file(s). | def compile (self, sources, output_dir=None, macros=None, include_dirs=None, extra_preargs=None, extra_postargs=None): """Compile one or more C/C++ source files. 'sources' must be a list of strings, each one the name of a C/C++ source file. Return a list of the object filenames generated (one for each source filename in 'sources'). | ad52244351623d70cabe2a37810a940852ec67bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ad52244351623d70cabe2a37810a940852ec67bb/ccompiler.py |
output_dir=None): | output_dir=None, debug=0): | def link_static_lib (self, objects, output_libname, output_dir=None): """Link a bunch of stuff together to create a static library file. The "bunch of stuff" consists of the list of object files supplied as 'objects', the extra object files supplied to 'add_link_object()' and/or 'set_link_objects()', the libraries supplied to 'add_library()' and/or 'set_libraries()', and the libraries supplied as 'libraries' (if any). | ad52244351623d70cabe2a37810a940852ec67bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ad52244351623d70cabe2a37810a940852ec67bb/ccompiler.py |
'output_libname' should be a library name, not a filename; the filename will be inferred from the library name. | 'output_libname' should be a library name, not a filename; the filename will be inferred from the library name. 'output_dir' is the directory where the library file will be put. 'debug' is a boolean; if true, debugging information will be included in the library (note that on most platforms, it is the compile step where this matters: the 'debug' flag is included here just for consistency).""" pass def link_shared_lib (self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, debug=0, extra_preargs=None, extra_postargs=None): """Link a bunch of stuff together to create a shared library file. Has the same effect as 'link_static_lib()' except that the filename inferred from 'output_libname' will most likely be different, and the type of file generated will almost certainly be different | def link_static_lib (self, objects, output_libname, output_dir=None): """Link a bunch of stuff together to create a static library file. The "bunch of stuff" consists of the list of object files supplied as 'objects', the extra object files supplied to 'add_link_object()' and/or 'set_link_objects()', the libraries supplied to 'add_library()' and/or 'set_libraries()', and the libraries supplied as 'libraries' (if any). | ad52244351623d70cabe2a37810a940852ec67bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ad52244351623d70cabe2a37810a940852ec67bb/ccompiler.py |
for the particular linker being used).""" pass def link_shared_lib (self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, extra_preargs=None, extra_postargs=None): """Link a bunch of stuff together to create a shared library file. Has the same effect as 'link_static_lib()' except that the filename inferred from 'output_libname' will most likely be different, and the type of file generated will almost certainly be different.""" | for the particular linker being used).""" | def link_static_lib (self, objects, output_libname, output_dir=None): """Link a bunch of stuff together to create a static library file. The "bunch of stuff" consists of the list of object files supplied as 'objects', the extra object files supplied to 'add_link_object()' and/or 'set_link_objects()', the libraries supplied to 'add_library()' and/or 'set_libraries()', and the libraries supplied as 'libraries' (if any). | ad52244351623d70cabe2a37810a940852ec67bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ad52244351623d70cabe2a37810a940852ec67bb/ccompiler.py |
base = base.replace("/", ".") | base = base.replace(os.sep, ".") if os.altsep: base = base.replace(os.altsep, ".") | def fullmodname(path): """Return a plausible module name for the path.""" # If the file 'path' is part of a package, then the filename isn't # enough to uniquely identify it. Try to do the right thing by # looking in sys.path for the longest matching prefix. We'll # assume that the rest is the package name. longest = "" for dir in sys.path: if path.startswith(dir) and path[len(dir)] == os.path.sep: if len(dir) > len(longest): longest = dir if longest: base = path[len(longest) + 1:] else: base = path base = base.replace("/", ".") filename, ext = os.path.splitext(base) return filename | 83bab1a343de156fe75bec67d3be828dacfed2bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/83bab1a343de156fe75bec67d3be828dacfed2bf/trace.py |
return | return 0, 0 | def write_results_file(self, path, lines, lnotab, lines_hit): """Return a coverage results file in path.""" | 83bab1a343de156fe75bec67d3be828dacfed2bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/83bab1a343de156fe75bec67d3be828dacfed2bf/trace.py |
RA("%s=%s;" % (self.key, self.coded_value)) | RA("%s=%s" % (self.key, self.coded_value)) | def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
RA("%s=%s;" % (self._reserved[K], _getdate(V))) | RA("%s=%s" % (self._reserved[K], _getdate(V))) | def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
RA("%s=%d;" % (self._reserved[K], V)) | RA("%s=%d" % (self._reserved[K], V)) | def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
RA("%s;" % self._reserved[K]) | RA(str(self._reserved[K])) | def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
RA("%s=%s;" % (self._reserved[K], V)) | RA("%s=%s" % (self._reserved[K], V)) | def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
return _spacejoin(result) | return _semispacejoin(result) | def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
def output(self, attrs=None, header="Set-Cookie:", sep="\n"): | def output(self, attrs=None, header="Set-Cookie:", sep="\015\012"): | def output(self, attrs=None, header="Set-Cookie:", sep="\n"): """Return a string suitable for HTTP.""" result = [] items = self.items() items.sort() for K,V in items: result.append( V.output(attrs, header) ) return sep.join(result) | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
return '<%s: %s>' % (self.__class__.__name__, _spacejoin(L)) | return '<%s: %s>' % (self.__class__.__name__, _semispacejoin(L)) | def __repr__(self): L = [] items = self.items() items.sort() for K,V in items: L.append( '%s=%s' % (K,repr(V.value) ) ) return '<%s: %s>' % (self.__class__.__name__, _spacejoin(L)) | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py |
self.socket = socket.socket(self.address_family, self.socket_type) self.server_bind() self.server_activate() def server_bind(self): """Called by constructor to bind the socket. May be overridden. """ if self.allow_reuse_address: self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.bind(self.server_address) | def __init__(self, server_address, RequestHandlerClass): """Constructor. May be extended, do not override.""" self.server_address = server_address self.RequestHandlerClass = RequestHandlerClass self.socket = socket.socket(self.address_family, self.socket_type) self.server_bind() self.server_activate() | 6ec81d9983655c1decc44a7d9d7195ed1148d6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ec81d9983655c1decc44a7d9d7195ed1148d6ba/SocketServer.py |
|
self.socket.listen(self.request_queue_size) def fileno(self): """Return socket file number. Interface required by select(). """ return self.socket.fileno() | pass | def server_activate(self): """Called by constructor to activate the server. | 6ec81d9983655c1decc44a7d9d7195ed1148d6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ec81d9983655c1decc44a7d9d7195ed1148d6ba/SocketServer.py |
def get_request(self): """Get the request and client address from the socket. May be overridden. """ return self.socket.accept() | def get_request(self): """Get the request and client address from the socket. | 6ec81d9983655c1decc44a7d9d7195ed1148d6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ec81d9983655c1decc44a7d9d7195ed1148d6ba/SocketServer.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.