rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
result.addError(self, self.__exc_info()) | result.addError(self, self._exc_info()) | def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return | b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py |
result.addFailure(self, self.__exc_info()) | result.addFailure(self, self._exc_info()) | def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return | b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py |
result.addError(self, self.__exc_info()) | result.addError(self, self._exc_info()) | def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return | b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py |
result.addError(self, self.__exc_info()) | result.addError(self, self._exc_info()) | def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return | b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py |
getattr(self, self.__testMethodName)() | getattr(self, self._testMethodName)() | def debug(self): """Run the test without collecting errors in a TestResult""" self.setUp() getattr(self, self.__testMethodName)() self.tearDown() | b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py |
def __exc_info(self): | def _exc_info(self): | def __exc_info(self): """Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed. """ exctype, excvalue, tb = sys.exc_info() if sys.platform[:4] == 'java': ## tracebacks look different in Jython return (exctype, excvalue, tb) return (exctype, excvalue, tb) | b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py |
raise ValueError, "CRC check failed" | raise IOError, "CRC check failed" | def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. Note that the size # stored is the true file size mod 2**32. self.fileobj.seek(-8, 1) crc32 = read32(self.fileobj) isize = U32(read32(self.fileobj)) # may exceed 2GB if U32(crc32) != U32(self.crc): raise ValueError, "CRC check failed" elif isize != LOWU32(self.size): raise ValueError, "Incorrect length of data produced" | 04ea4fbe05eaed009801243ce743503068de45af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/04ea4fbe05eaed009801243ce743503068de45af/gzip.py |
raise ValueError, "Incorrect length of data produced" | raise IOError, "Incorrect length of data produced" | def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. Note that the size # stored is the true file size mod 2**32. self.fileobj.seek(-8, 1) crc32 = read32(self.fileobj) isize = U32(read32(self.fileobj)) # may exceed 2GB if U32(crc32) != U32(self.crc): raise ValueError, "CRC check failed" elif isize != LOWU32(self.size): raise ValueError, "Incorrect length of data produced" | 04ea4fbe05eaed009801243ce743503068de45af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/04ea4fbe05eaed009801243ce743503068de45af/gzip.py |
state = ' ' | self.state = ' ' | def get_token(self): "Get a token from the input stream (or from stack if it's monempty)" if self.pushback: tok = self.pushback[0] self.pushback = self.pushback[1:] if (self.debug >= 1): print "Popping " + tok return tok tok = '' while 1: nextchar = self.instream.read(1); if nextchar == '\n': self.lineno = self.lineno + 1 if self.debug >= 3: print "In state " + repr(self.state) + " I see character: " + repr(nextchar) if self.state == None: return '' elif self.state == ' ': if not nextchar: self.state = None; # end of file break elif nextchar in self.whitespace: if self.debug >= 2: print "I see whitespace in whitespace state" if self.token: break # emit current token else: continue elif nextchar in self.commenters: self.instream.readline() self.lineno = self.lineno + 1 elif nextchar in self.wordchars: self.token = nextchar self.state = 'a' elif nextchar in self.quotes: self.token = nextchar self.state = nextchar else: self.token = nextchar if self.token: break # emit current token else: continue elif self.state in self.quotes: self.token = self.token + nextchar if nextchar == self.state: self.state = ' ' break elif self.state == 'a': if not nextchar: self.state = None; # end of file break elif nextchar in self.whitespace: if self.debug >= 2: print "I see whitespace in word state" self.state = ' ' if self.token: break # emit current token else: continue elif nextchar in self.commenters: self.instream.readline() self.lineno = self.lineno + 1 elif nextchar in self.wordchars or nextchar in self.quotes: self.token = self.token + nextchar else: self.pushback = [nextchar] + self.pushback if self.debug >= 2: print "I see punctuation in word state" state = ' ' if self.token: break # emit current token else: continue result = self.token self.token = '' if self.debug >= 1: print "Token: " + result return result | 04a1725e62e248a6287c2299dfe6504a8c7874bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/04a1725e62e248a6287c2299dfe6504a8c7874bf/shlex.py |
if 'Host' in (headers or [k for k in headers.iterkeys() if k.lower() == "host"]): | if 'host' in [k.lower() for k in headers]: | def _send_request(self, method, url, body, headers): # If headers already contains a host header, then define the # optional skip_host argument to putrequest(). The check is # harder because field names are case insensitive. if 'Host' in (headers or [k for k in headers.iterkeys() if k.lower() == "host"]): self.putrequest(method, url, skip_host=1) else: self.putrequest(method, url) | 922ed41d8c276ae7638ed40408ca775221b8a0a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/922ed41d8c276ae7638ed40408ca775221b8a0a7/httplib.py |
return | return True | def scriptswalk(self, top, menu, done=None): if done is None: done = {} if done.has_key(top): return done[top] = 1 import os, string try: names = os.listdir(top) except os.error: FrameWork.MenuItem(menu, '(Scripts Folder not found)', None, None) return savedir = os.getcwd() os.chdir(top) for name in names: if name == "CVS": continue try: fsr, isdir, isalias = File.FSResolveAliasFile(name, 1) except: # maybe a broken alias continue path = fsr.as_pathname() if done.has_key(path): continue name = string.strip(name) if os.name == "posix": name = unicode(name, "utf-8") if name[-3:] == '---': menu.addseparator() elif isdir: submenu = FrameWork.SubMenu(menu, name) self.scriptswalk(path, submenu, done) else: creator, type = MacOS.GetCreatorAndType(path) if type == 'TEXT': if name[-3:] == '.py': name = name[:-3] item = FrameWork.MenuItem(menu, name, None, self.domenu_script) self._scripts[(menu.id, item.item)] = path done[path] = 1 os.chdir(savedir) | a93e9074645ebb767545f234bf3e49f5cc7b85db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a93e9074645ebb767545f234bf3e49f5cc7b85db/Wapplication.py |
return | return True | def scriptswalk(self, top, menu, done=None): if done is None: done = {} if done.has_key(top): return done[top] = 1 import os, string try: names = os.listdir(top) except os.error: FrameWork.MenuItem(menu, '(Scripts Folder not found)', None, None) return savedir = os.getcwd() os.chdir(top) for name in names: if name == "CVS": continue try: fsr, isdir, isalias = File.FSResolveAliasFile(name, 1) except: # maybe a broken alias continue path = fsr.as_pathname() if done.has_key(path): continue name = string.strip(name) if os.name == "posix": name = unicode(name, "utf-8") if name[-3:] == '---': menu.addseparator() elif isdir: submenu = FrameWork.SubMenu(menu, name) self.scriptswalk(path, submenu, done) else: creator, type = MacOS.GetCreatorAndType(path) if type == 'TEXT': if name[-3:] == '.py': name = name[:-3] item = FrameWork.MenuItem(menu, name, None, self.domenu_script) self._scripts[(menu.id, item.item)] = path done[path] = 1 os.chdir(savedir) | a93e9074645ebb767545f234bf3e49f5cc7b85db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a93e9074645ebb767545f234bf3e49f5cc7b85db/Wapplication.py |
self.scriptswalk(path, submenu, done) | if not self.scriptswalk(path, submenu, done): return False | def scriptswalk(self, top, menu, done=None): if done is None: done = {} if done.has_key(top): return done[top] = 1 import os, string try: names = os.listdir(top) except os.error: FrameWork.MenuItem(menu, '(Scripts Folder not found)', None, None) return savedir = os.getcwd() os.chdir(top) for name in names: if name == "CVS": continue try: fsr, isdir, isalias = File.FSResolveAliasFile(name, 1) except: # maybe a broken alias continue path = fsr.as_pathname() if done.has_key(path): continue name = string.strip(name) if os.name == "posix": name = unicode(name, "utf-8") if name[-3:] == '---': menu.addseparator() elif isdir: submenu = FrameWork.SubMenu(menu, name) self.scriptswalk(path, submenu, done) else: creator, type = MacOS.GetCreatorAndType(path) if type == 'TEXT': if name[-3:] == '.py': name = name[:-3] item = FrameWork.MenuItem(menu, name, None, self.domenu_script) self._scripts[(menu.id, item.item)] = path done[path] = 1 os.chdir(savedir) | a93e9074645ebb767545f234bf3e49f5cc7b85db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a93e9074645ebb767545f234bf3e49f5cc7b85db/Wapplication.py |
return if address.lower().startswith('stimpy'): self.push('503 You suck %s' % address) | def smtp_RCPT(self, arg): print >> DEBUGSTREAM, '===> RCPT', arg if not self.__mailfrom: self.push('503 Error: need MAIL command') return address = self.__getaddr('TO:', arg) if not address: self.push('501 Syntax: RCPT TO: <address>') return if address.lower().startswith('stimpy'): self.push('503 You suck %s' % address) return self.__rcpttos.append(address) print >> DEBUGSTREAM, 'recips:', self.__rcpttos self.push('250 Ok') | f4bf8a72bf65c6b7d62acfda63b1d06815431183 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f4bf8a72bf65c6b7d62acfda63b1d06815431183/smtpd.py |
|
return getattr(self, self.err) | return getattr(self.err, attr) | def __getattr__(self, attr): return getattr(self, self.err) | 040a322c4d58967e6ea03dbba5364afb473948b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/040a322c4d58967e6ea03dbba5364afb473948b7/test_cgi.py |
'UNICODE': ('ref/strings', 'encodings unicode TYPES STRING'), | 'UNICODE': ('ref/strings', 'encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES'), | def writedocs(dir, pkgpath='', done=None): """Write out HTML documentation for all modules in a directory tree.""" if done is None: done = {} for file in os.listdir(dir): path = os.path.join(dir, file) if ispackage(path): writedocs(path, pkgpath + file + '.', done) elif os.path.isfile(path): modname = inspect.getmodulename(path) if modname: if modname == '__init__': modname = pkgpath[:-1] # remove trailing period else: modname = pkgpath + modname if modname not in done: done[modname] = 1 writedoc(modname) | 608e36211ec60e3709b8dc3cca74f40cedae1bae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/608e36211ec60e3709b8dc3cca74f40cedae1bae/pydoc.py |
'EXECUTION': ('ref/naming', ''), 'NAMESPACES': ('ref/naming', 'global ASSIGNMENT DELETION'), | 'EXECUTION': ('ref/execmodel', 'NAMESPACES DYNAMICFEATURES EXCEPTIONS'), 'NAMESPACES': ('ref/naming', 'global ASSIGNMENT DELETION DYNAMICFEATURES'), 'DYNAMICFEATURES': ('ref/dynamic-features', ''), | 'METHODS': ('lib/typesmethods', 'class def CLASSES TYPES'), | 608e36211ec60e3709b8dc3cca74f40cedae1bae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/608e36211ec60e3709b8dc3cca74f40cedae1bae/pydoc.py |
'COERCIONS': 'CONVERSIONS', 'CONVERSIONS': ('ref/conversions', ''), | 'COERCIONS': ('ref/coercion-rules','CONVERSIONS'), 'CONVERSIONS': ('ref/conversions', 'COERCIONS'), | 'METHODS': ('lib/typesmethods', 'class def CLASSES TYPES'), | 608e36211ec60e3709b8dc3cca74f40cedae1bae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/608e36211ec60e3709b8dc3cca74f40cedae1bae/pydoc.py |
print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why)) | errors.append((srcname, dstname, why)) if errors: raise Error, errors | def copytree(src, dst, symlinks=0): """Recursively copy a directory tree using copy2(). The destination directory must not already exist. Error are reported to standard output. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. XXX Consider this example code rather than the ultimate tool. """ names = os.listdir(src) os.mkdir(dst) for name in names: srcname = os.path.join(src, name) dstname = os.path.join(dst, name) try: if symlinks and os.path.islink(srcname): linkto = os.readlink(srcname) os.symlink(linkto, dstname) elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks) else: copy2(srcname, dstname) # XXX What about devices, sockets etc.? except (IOError, os.error), why: print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why)) | d44b264ef8d5cad1380874bc2c55dd4363dba02f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d44b264ef8d5cad1380874bc2c55dd4363dba02f/shutil.py |
macros=macros, | def build_extensions (self): | 75fa37e86845ccd392ab434c37132e95456e3104 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/75fa37e86845ccd392ab434c37132e95456e3104/build_ext.py |
|
opts, args = getopt.getopt(sys.argv[1:], 'm:qv') | opts, args = getopt.getopt(sys.argv[1:], 't:m:qva') | def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'm:qv') except getopt.error, msg: sys.stdout = sys.stderr print msg print __doc__%vars(webchecker) sys.exit(2) for o, a in opts: if o == '-m': webchecker.maxpage = string.atoi(a) if o == '-q': webchecker.verbose = 0 if o == '-v': webchecker.verbose = webchecker.verbose + 1 root = Tk(className='Webchecker') root.protocol("WM_DELETE_WINDOW", root.quit) c = CheckerWindow(root) if args: for arg in args[:-1]: c.addroot(arg) c.suggestroot(args[-1]) root.mainloop() | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
self.__todo = ListPanel(mp, "To check", self.showinfo) self.__done = ListPanel(mp, "Checked", self.showinfo) self.__bad = ListPanel(mp, "Bad links", self.showinfo) self.__errors = ListPanel(mp, "Pages w/ bad links", self.showinfo) | self.__todo = ListPanel(mp, "To check", self, self.showinfo) self.__done = ListPanel(mp, "Checked", self, self.showinfo) self.__bad = ListPanel(mp, "Bad links", self, self.showinfo) self.__errors = ListPanel(mp, "Pages w/ bad links", self, self.showinfo) | def __init__(self, parent, root=webchecker.DEFROOT): self.__parent = parent | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
self.__checking.config(text="Checking "+url) | self.__checking.config(text="Checking "+self.format_url(url)) | def dosomething(self): if self.__busy: return self.__busy = 1 if self.todo: l = self.__todo.selectedindices() if l: i = l[0] else: i = 0 self.__todo.list.select_set(i) self.__todo.list.yview(i) url = self.__todo.items[i] self.__checking.config(text="Checking "+url) self.__parent.update() self.dopage(url) else: self.stop() self.__busy = 0 self.go() | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
d.put("URL: %s\n" % url) | d.put("URL: %s\n" % self.format_url(url)) | def showinfo(self, url): d = self.__details d.clear() d.put("URL: %s\n" % url) if self.bad.has_key(url): d.put("Error: %s\n" % str(self.bad[url])) if url in self.roots: d.put("Note: This is a root URL\n") if self.done.has_key(url): d.put("Status: checked\n") o = self.done[url] elif self.todo.has_key(url): d.put("Status: to check\n") o = self.todo[url] else: d.put("Status: unknown (!)\n") o = [] if self.errors.has_key(url): d.put("Bad links from this page:\n") for triple in self.errors[url]: link, rawlink, msg = triple d.put(" HREF %s" % link) if link != rawlink: d.put(" (%s)" %rawlink) d.put("\n") d.put(" error %s\n" % str(msg)) self.__mp.showpanel("Details") for source, rawlink in o: d.put("Origin: %s" % source) if rawlink != url: d.put(" (%s)" % rawlink) d.put("\n") d.text.yview("1.0") | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
if self.errors.has_key(url): | if (not url[1]) and self.errors.has_key(url[0]): | def showinfo(self, url): d = self.__details d.clear() d.put("URL: %s\n" % url) if self.bad.has_key(url): d.put("Error: %s\n" % str(self.bad[url])) if url in self.roots: d.put("Note: This is a root URL\n") if self.done.has_key(url): d.put("Status: checked\n") o = self.done[url] elif self.todo.has_key(url): d.put("Status: to check\n") o = self.todo[url] else: d.put("Status: unknown (!)\n") o = [] if self.errors.has_key(url): d.put("Bad links from this page:\n") for triple in self.errors[url]: link, rawlink, msg = triple d.put(" HREF %s" % link) if link != rawlink: d.put(" (%s)" %rawlink) d.put("\n") d.put(" error %s\n" % str(msg)) self.__mp.showpanel("Details") for source, rawlink in o: d.put("Origin: %s" % source) if rawlink != url: d.put(" (%s)" % rawlink) d.put("\n") d.text.yview("1.0") | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
for triple in self.errors[url]: | for triple in self.errors[url[0]]: | def showinfo(self, url): d = self.__details d.clear() d.put("URL: %s\n" % url) if self.bad.has_key(url): d.put("Error: %s\n" % str(self.bad[url])) if url in self.roots: d.put("Note: This is a root URL\n") if self.done.has_key(url): d.put("Status: checked\n") o = self.done[url] elif self.todo.has_key(url): d.put("Status: to check\n") o = self.todo[url] else: d.put("Status: unknown (!)\n") o = [] if self.errors.has_key(url): d.put("Bad links from this page:\n") for triple in self.errors[url]: link, rawlink, msg = triple d.put(" HREF %s" % link) if link != rawlink: d.put(" (%s)" %rawlink) d.put("\n") d.put(" error %s\n" % str(msg)) self.__mp.showpanel("Details") for source, rawlink in o: d.put("Origin: %s" % source) if rawlink != url: d.put(" (%s)" % rawlink) d.put("\n") d.text.yview("1.0") | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
d.put(" HREF %s" % link) if link != rawlink: d.put(" (%s)" %rawlink) | d.put(" HREF %s" % self.format_url(link)) if self.format_url(link) != rawlink: d.put(" (%s)" %rawlink) | def showinfo(self, url): d = self.__details d.clear() d.put("URL: %s\n" % url) if self.bad.has_key(url): d.put("Error: %s\n" % str(self.bad[url])) if url in self.roots: d.put("Note: This is a root URL\n") if self.done.has_key(url): d.put("Status: checked\n") o = self.done[url] elif self.todo.has_key(url): d.put("Status: to check\n") o = self.todo[url] else: d.put("Status: unknown (!)\n") o = [] if self.errors.has_key(url): d.put("Bad links from this page:\n") for triple in self.errors[url]: link, rawlink, msg = triple d.put(" HREF %s" % link) if link != rawlink: d.put(" (%s)" %rawlink) d.put("\n") d.put(" error %s\n" % str(msg)) self.__mp.showpanel("Details") for source, rawlink in o: d.put("Origin: %s" % source) if rawlink != url: d.put(" (%s)" % rawlink) d.put("\n") d.text.yview("1.0") | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
if rawlink != url: | if rawlink != self.format_url(url): | def showinfo(self, url): d = self.__details d.clear() d.put("URL: %s\n" % url) if self.bad.has_key(url): d.put("Error: %s\n" % str(self.bad[url])) if url in self.roots: d.put("Note: This is a root URL\n") if self.done.has_key(url): d.put("Status: checked\n") o = self.done[url] elif self.todo.has_key(url): d.put("Status: to check\n") o = self.todo[url] else: d.put("Status: unknown (!)\n") o = [] if self.errors.has_key(url): d.put("Bad links from this page:\n") for triple in self.errors[url]: link, rawlink, msg = triple d.put(" HREF %s" % link) if link != rawlink: d.put(" (%s)" %rawlink) d.put("\n") d.put(" error %s\n" % str(msg)) self.__mp.showpanel("Details") for source, rawlink in o: d.put("Origin: %s" % source) if rawlink != url: d.put(" (%s)" % rawlink) d.put("\n") d.text.yview("1.0") | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
self.__errors.insert(url) | self.__errors.insert((url, '')) | def seterror(self, url, triple): webchecker.Checker.seterror(self, url, triple) self.__errors.insert(url) self.newstatus() | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
def __init__(self, mp, name, showinfo=None): | def __init__(self, mp, name, checker, showinfo=None): | def __init__(self, mp, name, showinfo=None): self.mp = mp self.name = name self.showinfo = showinfo self.panel = mp.addpanel(name) self.list, self.frame = tktools.make_list_box( self.panel, width=60, height=5) self.list.config(exportselection=0) if showinfo: self.list.bind('<Double-Button-1>', self.doubleclick) self.items = [] | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
self.showinfo(self.list.get(l[0])) | self.showinfo(self.items[l[0]]) | def doubleclick(self, event): l = self.selectedindices() if l: self.showinfo(self.list.get(l[0])) | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
self.list.insert(i, url) | self.list.insert(i, self.checker.format_url(url)) | def insert(self, url): if url not in self.items: if not self.items: self.mp.showpanel(self.name) # (I tried sorting alphabetically, but the display is too jumpy) i = len(self.items) self.list.insert(i, url) self.list.yview(i) self.items.insert(i, url) | 2ebde6d1fb628c2812a1c10ff496f785bfd5d202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ebde6d1fb628c2812a1c10ff496f785bfd5d202/wcgui.py |
Checks wether this line is typed in the normal prompt or in a breakpoint command list definition | Checks whether this line is typed at the normal prompt or in a breakpoint command list definition. | def onecmd(self, line): """Interpret the argument as though it had been typed in response to the prompt. | b0fcf117295f2e29b1174d7a1c44e4d9e1571ab2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0fcf117295f2e29b1174d7a1c44e4d9e1571ab2/pdb.py |
if platform == 'cygwin': lib_prefix = 'cyg' else: lib_prefix = '' | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | b421b52918ef842ee58204947aa81df2ab8f47f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b421b52918ef842ee58204947aa81df2ab8f47f2/setup.py |
|
tklib = self.compiler.find_library_file(lib_dirs, lib_prefix + 'tk' + version) tcllib = self.compiler.find_library_file(lib_dirs, lib_prefix + 'tcl' + version) | tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version) tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version) | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | b421b52918ef842ee58204947aa81df2ab8f47f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b421b52918ef842ee58204947aa81df2ab8f47f2/setup.py |
libs.append(lib_prefix + 'tk'+ version) libs.append(lib_prefix + 'tcl'+ version) | libs.append('tk'+ version) libs.append('tcl'+ version) | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | b421b52918ef842ee58204947aa81df2ab8f47f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b421b52918ef842ee58204947aa81df2ab8f47f2/setup.py |
if os.environ.has_key("MSSdk") and self.find_exe("cl.exe"): | if os.environ.has_key("DISTUTILS_USE_SDK") and os.environ.has_key("MSSdk") and self.find_exe("cl.exe"): | def initialize(self): self.__paths = [] if os.environ.has_key("MSSdk") and self.find_exe("cl.exe"): # Assume that the SDK set up everything alright; don't try to be # smarter self.cc = "cl.exe" self.linker = "link.exe" self.lib = "lib.exe" self.rc = "rc.exe" self.mc = "mc.exe" else: self.__paths = self.get_msvc_paths("path") | 2cd1457d691919a9d1b7be0742e1cd3a7007f680 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2cd1457d691919a9d1b7be0742e1cd3a7007f680/msvccompiler.py |
library_dirs=None): | library_dirs=None, build_info=None): | def link_shared_lib (self, objects, output_libname, libraries=None, library_dirs=None): # XXX should we sanity check the library name? (eg. no # slashes) self.link_shared_object (objects, "lib%s%s" % (output_libname, SO)) | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
self.link_shared_object (objects, "lib%s%s" % (output_libname, SO)) | self.link_shared_object (objects, "lib%s%s" % \ (output_libname, self._shared_lib_ext), build_info=build_info) | def link_shared_lib (self, objects, output_libname, libraries=None, library_dirs=None): # XXX should we sanity check the library name? (eg. no # slashes) self.link_shared_object (objects, "lib%s%s" % (output_libname, SO)) | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
library_dirs=None): | library_dirs=None, build_info=None): | def link_shared_object (self, objects, output_filename, libraries=None, library_dirs=None): | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
if build_info is None: build_info = {} | def link_shared_object (self, objects, output_filename, libraries=None, library_dirs=None): | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
|
outnames.append (re.sub (r'\.(c|C|cc|cxx)$', '.o', inname)) | outnames.append ( re.sub (r'\.(c|C|cc|cxx|cpp)$', self._obj_ext, inname)) | def object_filenames (self, source_filenames): outnames = [] for inname in source_filenames: outnames.append (re.sub (r'\.(c|C|cc|cxx)$', '.o', inname)) return outnames | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
return re.sub (r'\.(c|C|cc|cxx)$', SO) | return re.sub (r'\.(c|C|cc|cxx|cpp)$', self._shared_lib_ext) | def shared_object_filename (self, source_filename): return re.sub (r'\.(c|C|cc|cxx)$', SO) | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
return "lib%s.a" % libname | return "lib%s%s" % (libname, self._static_lib_ext ) | def library_filename (self, libname): return "lib%s.a" % libname | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
return "lib%s.so" % libname | return "lib%s%s" % (libname, self._shared_lib_ext ) | def shared_library_filename (self, libname): return "lib%s.so" % libname | 8c4f097a5c637a4673608d1db14fe675c1b4ea3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8c4f097a5c637a4673608d1db14fe675c1b4ea3b/unixccompiler.py |
p = subprocess.Popen(cmdline, close_fds=True) | if sys.platform[:3] == 'win': p = subprocess.Popen(cmdline) else: p = subprocess.Popen(cmdline, close_fds=True) | def open(self, url, new=0, autoraise=1): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] try: p = subprocess.Popen(cmdline, close_fds=True) return not p.wait() except OSError: return False | 6b1f6af28ab6bcc6f4e1a10368d417dd1094d4ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b1f6af28ab6bcc6f4e1a10368d417dd1094d4ef/webbrowser.py |
setsid = getattr(os, 'setsid', None) if not setsid: setsid = getattr(os, 'setpgrp', None) | def open(self, url, new=0, autoraise=1): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] setsid = getattr(os, 'setsid', None) if not setsid: setsid = getattr(os, 'setpgrp', None) try: p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) return (p.poll() is None) except OSError: return False | 6b1f6af28ab6bcc6f4e1a10368d417dd1094d4ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b1f6af28ab6bcc6f4e1a10368d417dd1094d4ef/webbrowser.py |
|
p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) | if sys.platform[:3] == 'win': p = subprocess.Popen(cmdline) else: setsid = getattr(os, 'setsid', None) if not setsid: setsid = getattr(os, 'setpgrp', None) p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) | def open(self, url, new=0, autoraise=1): cmdline = [self.name] + [arg.replace("%s", url) for arg in self.args] setsid = getattr(os, 'setsid', None) if not setsid: setsid = getattr(os, 'setpgrp', None) try: p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) return (p.poll() is None) except OSError: return False | 6b1f6af28ab6bcc6f4e1a10368d417dd1094d4ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b1f6af28ab6bcc6f4e1a10368d417dd1094d4ef/webbrowser.py |
self._tofill = [] | def reset(self): """ Clear the screen, re-center the pen, and set variables to the default values. | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
|
if self._tofill: for item in self._tofill: self._canvas.itemconfigure(item, fill=self._color) self._items.append(item) | def fill(self, flag): """ Call fill(1) before drawing the shape you want to fill, and fill(0) when done. | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
|
self._tofill = [] | def fill(self, flag): """ Call fill(1) before drawing the shape you want to fill, and fill(0) when done. | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
|
self.forward(0) | def fill(self, flag): """ Call fill(1) before drawing the shape you want to fill, and fill(0) when done. | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
|
self.fill(1) | self._path = [self._position] self._filling = 1 | def begin_fill(self): """ Called just before drawing a shape to be filled. | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
color("green") left(130) | left(120) | def demo2(): # exercises some new and improved features speed('fast') width(3) # draw a segmented half-circle setheading(towards(0,0)) x,y = position() r = (x**2+y**2)**.5/2.0 right(90) pendown = True for i in range(18): if pendown: up() pendown = False else: down() pendown = True circle(r,10) sleep(2) reset() left(90) # draw a series of triangles l = 10 color("green") width(3) left(180) sp = 5 for i in range(-2,16): if i > 0: color(1.0-0.05*i,0,0.05*i) fill(1) color("green") for j in range(3): forward(l) left(120) l += 10 left(15) if sp > 0: sp = sp-1 speed(speeds[sp]) color(0.25,0,0.75) fill(0) color("green") left(130) up() forward(90) color("red") speed('fastest') down(); # create a second turtle and make the original pursue and catch it turtle=Turtle() turtle.reset() turtle.left(90) turtle.speed('normal') turtle.up() turtle.goto(280,40) turtle.left(24) turtle.down() turtle.speed('fast') turtle.color("blue") turtle.width(2) speed('fastest') # turn default turtle towards new turtle object setheading(towards(turtle)) while ( abs(position()[0]-turtle.position()[0])>4 or abs(position()[1]-turtle.position()[1])>4): turtle.forward(3.5) turtle.left(0.6) # turn default turtle towards new turtle object setheading(towards(turtle)) forward(4) write("CAUGHT! ", move=True) | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
forward(90) | forward(70) right(30) down() | def demo2(): # exercises some new and improved features speed('fast') width(3) # draw a segmented half-circle setheading(towards(0,0)) x,y = position() r = (x**2+y**2)**.5/2.0 right(90) pendown = True for i in range(18): if pendown: up() pendown = False else: down() pendown = True circle(r,10) sleep(2) reset() left(90) # draw a series of triangles l = 10 color("green") width(3) left(180) sp = 5 for i in range(-2,16): if i > 0: color(1.0-0.05*i,0,0.05*i) fill(1) color("green") for j in range(3): forward(l) left(120) l += 10 left(15) if sp > 0: sp = sp-1 speed(speeds[sp]) color(0.25,0,0.75) fill(0) color("green") left(130) up() forward(90) color("red") speed('fastest') down(); # create a second turtle and make the original pursue and catch it turtle=Turtle() turtle.reset() turtle.left(90) turtle.speed('normal') turtle.up() turtle.goto(280,40) turtle.left(24) turtle.down() turtle.speed('fast') turtle.color("blue") turtle.width(2) speed('fastest') # turn default turtle towards new turtle object setheading(towards(turtle)) while ( abs(position()[0]-turtle.position()[0])>4 or abs(position()[1]-turtle.position()[1])>4): turtle.forward(3.5) turtle.left(0.6) # turn default turtle towards new turtle object setheading(towards(turtle)) forward(4) write("CAUGHT! ", move=True) | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
speed('fastest') | speed("fastest") fill(1) for i in range(4): circle(50,90) right(90) forward(30) right(90) color("yellow") fill(0) left(90) up() forward(30) | def demo2(): # exercises some new and improved features speed('fast') width(3) # draw a segmented half-circle setheading(towards(0,0)) x,y = position() r = (x**2+y**2)**.5/2.0 right(90) pendown = True for i in range(18): if pendown: up() pendown = False else: down() pendown = True circle(r,10) sleep(2) reset() left(90) # draw a series of triangles l = 10 color("green") width(3) left(180) sp = 5 for i in range(-2,16): if i > 0: color(1.0-0.05*i,0,0.05*i) fill(1) color("green") for j in range(3): forward(l) left(120) l += 10 left(15) if sp > 0: sp = sp-1 speed(speeds[sp]) color(0.25,0,0.75) fill(0) color("green") left(130) up() forward(90) color("red") speed('fastest') down(); # create a second turtle and make the original pursue and catch it turtle=Turtle() turtle.reset() turtle.left(90) turtle.speed('normal') turtle.up() turtle.goto(280,40) turtle.left(24) turtle.down() turtle.speed('fast') turtle.color("blue") turtle.width(2) speed('fastest') # turn default turtle towards new turtle object setheading(towards(turtle)) while ( abs(position()[0]-turtle.position()[0])>4 or abs(position()[1]-turtle.position()[1])>4): turtle.forward(3.5) turtle.left(0.6) # turn default turtle towards new turtle object setheading(towards(turtle)) forward(4) write("CAUGHT! ", move=True) | 2219110991cdd175e1a19d5965be9339f89d5f07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2219110991cdd175e1a19d5965be9339f89d5f07/turtle.py |
import traceback | def formatException(self, ei): """ Format and return the specified exception information as a string. | 5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce/__init__.py |
|
import traceback | def handleError(self, record): """ Handle errors which occur during an emit() call. | 5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce/__init__.py |
|
def __init__(self, filename, mode="a"): | def __init__(self, filename, mode='a', encoding=None): | def __init__(self, filename, mode="a"): """ Open the specified file and use it as the stream for logging. """ StreamHandler.__init__(self, open(filename, mode)) #keep the absolute path, otherwise derived classes which use this #may come a cropper when the current directory changes self.baseFilename = os.path.abspath(filename) self.mode = mode | 5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce/__init__.py |
StreamHandler.__init__(self, open(filename, mode)) | if codecs is None: encoding = None if encoding is None: stream = open(filename, mode) else: stream = codecs.open(filename, mode, encoding) StreamHandler.__init__(self, stream) | def __init__(self, filename, mode="a"): """ Open the specified file and use it as the stream for logging. """ StreamHandler.__init__(self, open(filename, mode)) #keep the absolute path, otherwise derived classes which use this #may come a cropper when the current directory changes self.baseFilename = os.path.abspath(filename) self.mode = mode | 5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce/__init__.py |
(if filemode is unspecified, it defaults to "a"). | (if filemode is unspecified, it defaults to 'a'). | def basicConfig(**kwargs): """ Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHandler which writes to sys.stderr, set a formatter using the BASIC_FORMAT format string, and add the handler to the root logger. A number of optional keyword arguments may be specified, which can alter the default behaviour. filename Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler. filemode Specifies the mode to open the file, if filename is specified (if filemode is unspecified, it defaults to "a"). format Use the specified format string for the handler. datefmt Use the specified date/time format. level Set the root logger level to the specified level. stream Use the specified stream to initialize the StreamHandler. Note that this argument is incompatible with 'filename' - if both are present, 'stream' is ignored. Note that you could specify a stream created using open(filename, mode) rather than passing the filename and mode in. However, it should be remembered that StreamHandler does not close its stream (since it may be using sys.stdout or sys.stderr), whereas FileHandler closes its stream when the handler is closed. """ if len(root.handlers) == 0: filename = kwargs.get("filename") if filename: mode = kwargs.get("filemode", "a") hdlr = FileHandler(filename, mode) else: stream = kwargs.get("stream") hdlr = StreamHandler(stream) fs = kwargs.get("format", BASIC_FORMAT) dfs = kwargs.get("datefmt", None) fmt = Formatter(fs, dfs) hdlr.setFormatter(fmt) root.addHandler(hdlr) level = kwargs.get("level") if level: root.setLevel(level) | 5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce/__init__.py |
mode = kwargs.get("filemode", "a") | mode = kwargs.get("filemode", 'a') | def basicConfig(**kwargs): """ Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHandler which writes to sys.stderr, set a formatter using the BASIC_FORMAT format string, and add the handler to the root logger. A number of optional keyword arguments may be specified, which can alter the default behaviour. filename Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler. filemode Specifies the mode to open the file, if filename is specified (if filemode is unspecified, it defaults to "a"). format Use the specified format string for the handler. datefmt Use the specified date/time format. level Set the root logger level to the specified level. stream Use the specified stream to initialize the StreamHandler. Note that this argument is incompatible with 'filename' - if both are present, 'stream' is ignored. Note that you could specify a stream created using open(filename, mode) rather than passing the filename and mode in. However, it should be remembered that StreamHandler does not close its stream (since it may be using sys.stdout or sys.stderr), whereas FileHandler closes its stream when the handler is closed. """ if len(root.handlers) == 0: filename = kwargs.get("filename") if filename: mode = kwargs.get("filemode", "a") hdlr = FileHandler(filename, mode) else: stream = kwargs.get("stream") hdlr = StreamHandler(stream) fs = kwargs.get("format", BASIC_FORMAT) dfs = kwargs.get("datefmt", None) fmt = Formatter(fs, dfs) hdlr.setFormatter(fmt) root.addHandler(hdlr) level = kwargs.get("level") if level: root.setLevel(level) | 5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bc3d5b3ccc4bb023381ac18ad5f5fc8e213b9ce/__init__.py |
outputs.extend(cmd.get_outputs()) | for filename in cmd.get_outputs(): if filename not in outputs: outputs.append(filename) | def get_outputs (self): # This command doesn't have any outputs of its own, so just # get the outputs of all its sub-commands. outputs = [] for cmd_name in self.get_sub_commands(): cmd = self.get_finalized_command(cmd_name) outputs.extend(cmd.get_outputs()) | 390067eb7d8b26ff30e46561877e178bad034e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/390067eb7d8b26ff30e46561877e178bad034e5f/install.py |
{'message' : 'foo', 'args' : ('foo',)}), | {'message' : 'foo', 'args' : ('foo',), 'filename' : None, 'errno' : None, 'strerror' : None}), | def testAttributes(self): # test that exception attributes are happy | 00fdbb0ae71076b3ec37c7d26811482a66fd0268 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00fdbb0ae71076b3ec37c7d26811482a66fd0268/test_exceptions.py |
{'message' : '', 'args' : ('foo', 'bar')}), | {'message' : '', 'args' : ('foo', 'bar'), 'filename' : None, 'errno' : 'foo', 'strerror' : 'bar'}), | def testAttributes(self): # test that exception attributes are happy | 00fdbb0ae71076b3ec37c7d26811482a66fd0268 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00fdbb0ae71076b3ec37c7d26811482a66fd0268/test_exceptions.py |
{'message' : '', 'args' : ('foo', 'bar')}), | {'message' : '', 'args' : ('foo', 'bar'), 'filename' : 'baz', 'errno' : 'foo', 'strerror' : 'bar'}), (IOError, ('foo', 'bar', 'baz', 'quux'), {'message' : '', 'args' : ('foo', 'bar', 'baz', 'quux')}), | def testAttributes(self): # test that exception attributes are happy | 00fdbb0ae71076b3ec37c7d26811482a66fd0268 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/00fdbb0ae71076b3ec37c7d26811482a66fd0268/test_exceptions.py |
def __init__(self, filenames=()): | def __init__(self, filenames=(), strict=True): | def __init__(self, filenames=()): if not inited: init() self.encodings_map = encodings_map.copy() self.suffix_map = suffix_map.copy() self.types_map = types_map.copy() self.common_types = common_types.copy() for name in filenames: self.read(name) | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
self.types_map = types_map.copy() self.common_types = common_types.copy() | self.types_map = ({}, {}) self.types_map_inv = ({}, {}) for (ext, type) in types_map.items(): self.add_type(type, ext, True) for (ext, type) in common_types.items(): self.add_type(type, ext, False) | def __init__(self, filenames=()): if not inited: init() self.encodings_map = encodings_map.copy() self.suffix_map = suffix_map.copy() self.types_map = types_map.copy() self.common_types = common_types.copy() for name in filenames: self.read(name) | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
self.read(name) def guess_type(self, url, strict=1): | self.read(name, strict) def add_type(self, type, ext, strict=True): """Add a mapping between a type and and extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of standard types, else to the list of non-standard types. """ self.types_map[strict][ext] = type exts = self.types_map_inv[strict].setdefault(type, []) if ext not in exts: exts.append(ext) def guess_type(self, url, strict=True): | def __init__(self, filenames=()): if not inited: init() self.encodings_map = encodings_map.copy() self.suffix_map = suffix_map.copy() self.types_map = types_map.copy() self.common_types = common_types.copy() for name in filenames: self.read(name) | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
Optional `strict' argument when false adds a bunch of commonly found, | Optional `strict' argument when False adds a bunch of commonly found, | def guess_type(self, url, strict=1): """Guess the type of a file based on its URL. | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
types_map = self.types_map common_types = self.common_types | types_map = self.types_map[True] | def guess_type(self, url, strict=1): """Guess the type of a file based on its URL. | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
elif ext in common_types: return common_types[ext], encoding elif ext.lower() in common_types: return common_types[ext.lower()], encoding | types_map = self.types_map[False] if ext in types_map: return types_map[ext], encoding elif ext.lower() in types_map: return types_map[ext.lower()], encoding | def guess_type(self, url, strict=1): """Guess the type of a file based on its URL. | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
def guess_extension(self, type, strict=1): | def guess_all_extensions(self, type, strict=True): """Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ type = type.lower() extensions = self.types_map_inv[True].get(type, []) if not strict: for ext in self.types_map_inv[False].get(type, []): if ext not in extensions: extensions.append(ext) if len(extensions): return extensions def guess_extension(self, type, strict=True): | def guess_extension(self, type, strict=1): """Guess the extension for a file based on its MIME type. | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
type = type.lower() for ext, stype in self.types_map.items(): if type == stype: return ext if not strict: for ext, stype in common_types.items(): if type == stype: return ext return None def read(self, filename): """Read a single mime.types-format file, specified by pathname.""" | extensions = self.guess_all_extensions(type, strict) if extensions is not None: extensions = extensions[0] return extensions def read(self, filename, strict=True): """ Read a single mime.types-format file, specified by pathname. If strict is true, information will be added to list of standard types, else to the list of non-standard types. """ | def guess_extension(self, type, strict=1): """Guess the extension for a file based on its MIME type. | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
def readfp(self, fp): """Read a single mime.types-format file.""" map = self.types_map | def readfp(self, fp, strict=True): """ Read a single mime.types-format file. If strict is true, information will be added to list of standard types, else to the list of non-standard types. """ | def readfp(self, fp): """Read a single mime.types-format file.""" map = self.types_map while 1: line = fp.readline() if not line: break words = line.split() for i in range(len(words)): if words[i][0] == '#': del words[i:] break if not words: continue type, suffixes = words[0], words[1:] for suff in suffixes: map['.' + suff] = type | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
map['.' + suff] = type def guess_type(url, strict=1): | self.add_type(type, suff, strict) def guess_type(url, strict=True): | def readfp(self, fp): """Read a single mime.types-format file.""" map = self.types_map while 1: line = fp.readline() if not line: break words = line.split() for i in range(len(words)): if words[i][0] == '#': del words[i:] break if not words: continue type, suffixes = words[0], words[1:] for suff in suffixes: map['.' + suff] = type | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
def guess_extension(type, strict=1): | def guess_all_extensions(type, strict=True): """Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ init() return guess_all_extensions(type, strict) def guess_extension(type, strict=True): | def guess_extension(type, strict=1): """Guess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ init() return guess_extension(type, strict) | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
global guess_extension, guess_type | global guess_all_extensions, guess_extension, guess_type | def init(files=None): global guess_extension, guess_type global suffix_map, types_map, encodings_map, common_types global inited inited = 1 db = MimeTypes() if files is None: files = knownfiles for file in files: if os.path.isfile(file): db.readfp(open(file)) encodings_map = db.encodings_map suffix_map = db.suffix_map types_map = db.types_map guess_extension = db.guess_extension guess_type = db.guess_type common_types = db.common_types | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
global inited inited = 1 | global add_type, inited inited = True | def init(files=None): global guess_extension, guess_type global suffix_map, types_map, encodings_map, common_types global inited inited = 1 db = MimeTypes() if files is None: files = knownfiles for file in files: if os.path.isfile(file): db.readfp(open(file)) encodings_map = db.encodings_map suffix_map = db.suffix_map types_map = db.types_map guess_extension = db.guess_extension guess_type = db.guess_type common_types = db.common_types | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
types_map = db.types_map | types_map = db.types_map[True] guess_all_extensions = db.guess_all_extensions | def init(files=None): global guess_extension, guess_type global suffix_map, types_map, encodings_map, common_types global inited inited = 1 db = MimeTypes() if files is None: files = knownfiles for file in files: if os.path.isfile(file): db.readfp(open(file)) encodings_map = db.encodings_map suffix_map = db.suffix_map types_map = db.types_map guess_extension = db.guess_extension guess_type = db.guess_type common_types = db.common_types | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
common_types = db.common_types | add_type = db.add_type common_types = db.types_map[False] | def init(files=None): global guess_extension, guess_type global suffix_map, types_map, encodings_map, common_types global inited inited = 1 db = MimeTypes() if files is None: files = knownfiles for file in files: if os.path.isfile(file): db.readfp(open(file)) encodings_map = db.encodings_map suffix_map = db.suffix_map types_map = db.types_map guess_extension = db.guess_extension guess_type = db.guess_type common_types = db.common_types | b0945ca0ad01e7fdc7cc8a5703d1e114970042b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0945ca0ad01e7fdc7cc8a5703d1e114970042b7/mimetypes.py |
doc = getattr(value, "__doc__", None) | if callable(value): doc = getattr(value, "__doc__", None) else: doc = None | def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) doc = getattr(value, "__doc__", None) if doc is None: push('<dl><dt>%s</dl>\n' % base) else: doc = self.markup(getdoc(value), self.preformat, funcs, classes, mdict) doc = '<dd><tt>%s</tt>' % doc push('<dl><dt>%s%s</dl>\n' % (base, doc)) push('\n') return attrs | 07f6e5a8c03307be07da3a966532d6b1b9d8864c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/07f6e5a8c03307be07da3a966532d6b1b9d8864c/pydoc.py |
doc = getattr(value, "__doc__", None) | if callable(value): doc = getattr(value, "__doc__", None) else: doc = None | def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: doc = getattr(value, "__doc__", None) push(self.docother(getattr(object, name), name, mod, 70, doc) + '\n') return attrs | 07f6e5a8c03307be07da3a966532d6b1b9d8864c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/07f6e5a8c03307be07da3a966532d6b1b9d8864c/pydoc.py |
(0, 50001), RuntimeError) | (0, 50001)) | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 660fd76c8a68b876067edbc2eca033e4a2ebe64f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/660fd76c8a68b876067edbc2eca033e4a2ebe64f/test_sre.py |
class Boolean: """Boolean-value wrapper. Use True or False to generate a "boolean" XML-RPC value. """ def __init__(self, value = 0): self.value = operator.truth(value) def encode(self, out): out.write("<value><boolean>%d</boolean></value>\n" % self.value) def __cmp__(self, other): if isinstance(other, Boolean): other = other.value return cmp(self.value, other) def __repr__(self): if self.value: return "<Boolean True at %x>" % id(self) else: return "<Boolean False at %x>" % id(self) def __int__(self): return self.value def __nonzero__(self): return self.value True, False = Boolean(1), Boolean(0) def boolean(value, _truefalse=(False, True)): """Convert any Python value to XML-RPC 'boolean'.""" return _truefalse[operator.truth(value)] | if _bool_is_builtin: boolean = Boolean = bool True, False = True, False else: class Boolean: """Boolean-value wrapper. Use True or False to generate a "boolean" XML-RPC value. """ def __init__(self, value = 0): self.value = operator.truth(value) def encode(self, out): out.write("<value><boolean>%d</boolean></value>\n" % self.value) def __cmp__(self, other): if isinstance(other, Boolean): other = other.value return cmp(self.value, other) def __repr__(self): if self.value: return "<Boolean True at %x>" % id(self) else: return "<Boolean False at %x>" % id(self) def __int__(self): return self.value def __nonzero__(self): return self.value True, False = Boolean(1), Boolean(0) def boolean(value, _truefalse=(False, True)): """Convert any Python value to XML-RPC 'boolean'.""" return _truefalse[operator.truth(value)] | def __repr__(self): return ( "<Fault %s: %s>" % (self.faultCode, repr(self.faultString)) ) | 4bf101523d9c126186d5db93395f65a8bd373b9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4bf101523d9c126186d5db93395f65a8bd373b9d/xmlrpclib.py |
WRAPPERS = DateTime, Binary, Boolean | WRAPPERS = (DateTime, Binary) if not _bool_is_builtin: WRAPPERS = WRAPPERS + (Boolean,) | def _binary(data): # decode xml element contents into a Binary structure value = Binary() value.decode(data) return value | 4bf101523d9c126186d5db93395f65a8bd373b9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4bf101523d9c126186d5db93395f65a8bd373b9d/xmlrpclib.py |
return "Not all files were unpacked: %s" % " ".join(names) | return "Not all files were unpacked: %s" % " ".join(names) | def unpack(self, archive, output=None): tf = tarfile.open(archive, "r") members = tf.getmembers() skip = [] if self._renames: for member in members: for oldprefix, newprefix in self._renames: if oldprefix[:len(self._dir)] == self._dir: oldprefix2 = oldprefix[len(self._dir):] else: oldprefix2 = None if member.name[:len(oldprefix)] == oldprefix: if newprefix is None: skip.append(member) #print 'SKIP', member.name else: member.name = newprefix + member.name[len(oldprefix):] print ' ', member.name break elif oldprefix2 and member.name[:len(oldprefix2)] == oldprefix2: if newprefix is None: skip.append(member) #print 'SKIP', member.name else: member.name = newprefix + member.name[len(oldprefix2):] #print ' ', member.name break else: skip.append(member) #print '????', member.name for member in members: if member in skip: continue tf.extract(member, self._dir) if skip: names = [member.name for member in skip if member.name[-1] != '/'] if names: return "Not all files were unpacked: %s" % " ".join(names) | fdf67a69a43dc90510c8c54a95b15f0e1980b8aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fdf67a69a43dc90510c8c54a95b15f0e1980b8aa/pimp.py |
if not self.distribution.has_ext_modules(): spec_file.append('BuildArchitectures: noarch') | if not self.force_arch: if not self.distribution.has_ext_modules(): spec_file.append('BuildArch: noarch') else: spec_file.append( 'BuildArch: %s' % self.force_arch ) | 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().replace('-','_'), '%define release ' + self.release.replace('-','_'), '', 'Summary: ' + self.distribution.get_description(), ] | b362adb2436aaf27eec42a402c0b2cd90f39ef43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b362adb2436aaf27eec42a402c0b2cd90f39ef43/bdist_rpm.py |
for stack in self.rows + self.suits: | for stack in self.openstacks: | def closeststack(self, card): | 1f3e6c4561d6dffc34a6534ea37a8c8c5fb70ce1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1f3e6c4561d6dffc34a6534ea37a8c8c5fb70ce1/solitaire.py |
for stack in [self.opendeck] + self.suits + self.rows: | for stack in self.openstacks: | def reset(self): | 1f3e6c4561d6dffc34a6534ea37a8c8c5fb70ce1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1f3e6c4561d6dffc34a6534ea37a8c8c5fb70ce1/solitaire.py |
import __main__ class_ = getattr(__main__, options.classname) | classname = options.classname if "." in classname: lastdot = classname.rfind(".") mod = __import__(classname[:lastdot], globals(), locals(), [""]) classname = classname[lastdot+1:] else: import __main__ as mod print mod.__name__, dir(mod) class_ = getattr(mod, classname) | def parseargs(): global DEBUGSTREAM try: opts, args = getopt.getopt( sys.argv[1:], 'nVhc:d', ['class=', 'nosetuid', 'version', 'help', 'debug']) except getopt.error, e: usage(1, e) options = Options() for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-V', '--version'): print >> sys.stderr, __version__ sys.exit(0) elif opt in ('-n', '--nosetuid'): options.setuid = 0 elif opt in ('-c', '--class'): options.classname = arg elif opt in ('-d', '--debug'): DEBUGSTREAM = sys.stderr # parse the rest of the arguments if len(args) < 1: localspec = 'localhost:8025' remotespec = 'localhost:25' elif len(args) < 2: localspec = args[0] remotespec = 'localhost:25' elif len(args) < 3: localspec = args[0] remotespec = args[1] else: usage(1, 'Invalid arguments: %s' % COMMASPACE.join(args)) # split into host/port pairs i = localspec.find(':') if i < 0: usage(1, 'Bad local spec: %s' % localspec) options.localhost = localspec[:i] try: options.localport = int(localspec[i+1:]) except ValueError: usage(1, 'Bad local port: %s' % localspec) i = remotespec.find(':') if i < 0: usage(1, 'Bad remote spec: %s' % remotespec) options.remotehost = remotespec[:i] try: options.remoteport = int(remotespec[i+1:]) except ValueError: usage(1, 'Bad remote port: %s' % remotespec) return options | 923a59c02f2ae49e8f09bd66f5084e368dbd2ad4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/923a59c02f2ae49e8f09bd66f5084e368dbd2ad4/smtpd.py |
if w[0] != '-' and w[-2:] in ('.o', '.a'): | if w[0] not in ('-', '$') and w[-2:] in ('.o', '.a'): | def select(e, mods, vars, mod, skipofiles): files = [] for w in mods[mod]: w = treatword(w) if not w: continue w = expandvars(w, vars) for w in string.split(w): if skipofiles and w[-2:] == '.o': continue if w[0] != '-' and w[-2:] in ('.o', '.a'): w = os.path.join(e, w) if w[:2] in ('-L', '-R'): w = w[:2] + os.path.join(e, w[2:]) files.append(w) return files | 02a4bce349c32531cc74ac467f877a2f6ac4d26f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02a4bce349c32531cc74ac467f877a2f6ac4d26f/checkextensions.py |
if w[:2] in ('-L', '-R'): | if w[:2] in ('-L', '-R') and w[2:3] != '$': | def select(e, mods, vars, mod, skipofiles): files = [] for w in mods[mod]: w = treatword(w) if not w: continue w = expandvars(w, vars) for w in string.split(w): if skipofiles and w[-2:] == '.o': continue if w[0] != '-' and w[-2:] in ('.o', '.a'): w = os.path.join(e, w) if w[:2] in ('-L', '-R'): w = w[:2] + os.path.join(e, w[2:]) files.append(w) return files | 02a4bce349c32531cc74ac467f877a2f6ac4d26f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02a4bce349c32531cc74ac467f877a2f6ac4d26f/checkextensions.py |
fp.write(' | fp.write(' | def link (self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): # First examine a couple of options for things that aren't implemented yet if not target_desc in (self.SHARED_LIBRARY, self.SHARED_OBJECT): raise DistutilsPlatformError, 'Can only make SHARED_LIBRARY or SHARED_OBJECT targets on the Mac' if runtime_library_dirs: raise DistutilsPlatformError, 'Runtime library dirs not implemented yet' if extra_preargs or extra_postargs: raise DistutilsPlatformError, 'Runtime library dirs not implemented yet' if len(export_symbols) != 1: raise DistutilsPlatformError, 'Need exactly one export symbol' # Next there are various things for which we need absolute pathnames. # This is because we (usually) create the project in a subdirectory of # where we are now, and keeping the paths relative is too much work right # now. sources = map(self._filename_to_abs, self.__sources) include_dirs = map(self._filename_to_abs, self.__include_dirs) if objects: objects = map(self._filename_to_abs, objects) else: objects = [] if build_temp: build_temp = self._filename_to_abs(build_temp) else: build_temp = os.curdir() if output_dir: output_filename = os.path.join(output_dir, output_filename) # The output filename needs special handling: splitting it into dir and # filename part. Actually I'm not sure this is really needed, but it # can't hurt. output_filename = self._filename_to_abs(output_filename) output_dir, output_filename = os.path.split(output_filename) # Now we need the short names of a couple of things for putting them # into the project. if output_filename[-8:] == '.ppc.slb': basename = output_filename[:-8] elif output_filename[-11:] == '.carbon.slb': basename = output_filename[:-11] else: basename = os.path.strip(output_filename)[0] projectname = basename + '.mcp' targetname = basename xmlname = basename + '.xml' exportname = basename + '.mcp.exp' prefixname = 'mwerks_%s_config.h'%basename # Create the directories we need distutils.dir_util.mkpath(build_temp, self.verbose, self.dry_run) distutils.dir_util.mkpath(output_dir, self.verbose, self.dry_run) # And on to filling in the parameters for the project builder settings = {} settings['mac_exportname'] = exportname settings['mac_outputdir'] = output_dir settings['mac_dllname'] = output_filename settings['mac_targetname'] = targetname settings['sysprefix'] = sys.prefix settings['mac_sysprefixtype'] = 'Absolute' sourcefilenames = [] sourcefiledirs = [] for filename in sources + objects: dirname, filename = os.path.split(filename) sourcefilenames.append(filename) if not dirname in sourcefiledirs: sourcefiledirs.append(dirname) settings['sources'] = sourcefilenames settings['extrasearchdirs'] = sourcefiledirs + include_dirs + library_dirs if self.dry_run: print 'CALLING LINKER IN', os.getcwd() for key, value in settings.items(): print '%20.20s %s'%(key, value) return # Build the export file exportfilename = os.path.join(build_temp, exportname) if self.verbose: print '\tCreate export file', exportfilename fp = open(exportfilename, 'w') fp.write('%s\n'%export_symbols[0]) fp.close() # Generate the prefix file, if needed, and put it in the settings if self.__macros: prefixfilename = os.path.join(os.getcwd(), os.path.join(build_temp, prefixname)) fp = open(prefixfilename, 'w') fp.write('#include "mwerks_plugin_config.h"\n') for name, value in self.__macros: if value is None: fp.write('#define %s\n'%name) else: fp.write('#define %s "%s"\n'%(name, value)) fp.close() settings['prefixname'] = prefixname | f6469ef84fa33b9b4e2c78048958d52a4c9ea0f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f6469ef84fa33b9b4e2c78048958d52a4c9ea0f2/mwerkscompiler.py |
del self._data[element] | self.remove(element) | def discard(self, element): """Remove an element from a set if it is a member. | 84d1207ea7a53a971d622e4d8d7a1e8c5474caa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/84d1207ea7a53a971d622e4d8d7a1e8c5474caa3/sets.py |
vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 dr = (0, 0, vr[2], 0) | x0, y0, x1, y1 = self.wid.GetWindowPort().portRect x0 = x0 + 4 y0 = y0 + 4 x1 = x1 - 20 y1 = y1 - 20 vr = dr = x0, y0, x1, y1 | def open(self, path, name, data): self.path = path self.name = name r = windowbounds(400, 400) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 dr = (0, 0, vr[2], 0) Qd.SetPort(w) Qd.TextFont(4) Qd.TextSize(9) self.ted = TE.TENew(dr, vr) self.ted.TEAutoView(1) self.ted.TESetText(data) w.DrawGrowIcon() self.scrollbars() self.changed = 0 self.do_postopen() self.do_activate(1, None) | 9c50abf80bc4b3d1659afe08ec3e68dfc0d60d7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c50abf80bc4b3d1659afe08ec3e68dfc0d60d7c/ped.py |
match = mime_head.group(0, 1) newline = newline + line[:i] + mime_decode(match[1]) line = line[i + len(match[0]):] | match0, match1 = mime_head.group(0, 1) match1 = string.join(string.split(match1, '_'), ' ') newline = newline + line[:i] + mime_decode(match1) line = line[i + len(match0):] | def mime_decode_header(line): '''Decode a header line to 8bit.''' newline = '' while 1: i = mime_head.search(line) if i < 0: break match = mime_head.group(0, 1) newline = newline + line[:i] + mime_decode(match[1]) line = line[i + len(match[0]):] return newline + line | b833f63e50774e0cb1d83757644b4504440ecfdf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b833f63e50774e0cb1d83757644b4504440ecfdf/mimify.py |
id = 257 | def AskString(prompt, default = "", id=257, ok=None, cancel=None): """Display a PROMPT string and a text entry field with a DEFAULT string. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty. The PROMPT and DEFAULT strings, as well as the return value, can be at most 255 characters long. """ id = 257 d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return tp, h, rect = d.GetDialogItem(3) SetDialogItemText(h, lf2cr(prompt)) tp, h, rect = d.GetDialogItem(4) SetDialogItemText(h, lf2cr(default)) d.SelectDialogItemText(4, 0, 999) | c4273b18acf6df204b3b8a05cf8b6edbf6b86496 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c4273b18acf6df204b3b8a05cf8b6edbf6b86496/EasyDialogs.py |
|
return strftime(self.format, (item,)*9).capitalize() | return strftime(self.format, (item,)*8+(0,)).capitalize() | def __getitem__(self, item): if isinstance(item, int): if item < 0: item += self.len if not 0 <= item < self.len: raise IndexError, "out of range" return strftime(self.format, (item,)*9).capitalize() elif isinstance(item, type(slice(0))): return [self[e] for e in range(self.len)].__getslice__(item.start, item.stop) | 325b7674ea78afc939283d8008929700bbd2f753 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/325b7674ea78afc939283d8008929700bbd2f753/calendar.py |
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 66bc4a46a7fb3489b8760a3b1faf31bc78b9cc0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66bc4a46a7fb3489b8760a3b1faf31bc78b9cc0f/setup.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.