rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
SITE_CO = compile(SITE_PY, "<-bundlebuilder->", "exec") | SITE_CO = compile(SITE_PY, "<-bundlebuilder.py->", "exec") | def report(self): # XXX something decent import pprint pprint.pprint(self.__dict__) | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
EXECVE_WRAPPER = """\ import os from sys import argv, executable resources = os.path.join(os.path.dirname(os.path.dirname(argv[0])), "Resources") mainprogram = os.path.join(resources, "%(mainprogram)s") assert os.path.exists(mainprogram) argv.insert(1, mainprogram) os.environ["PYTHONPATH"] = resources %(setexecutable... | BOOTSTRAP_SCRIPT = """\ execdir=$(dirname ${0}) executable=${execdir}/%(executable)s resdir=$(dirname ${execdir})/Resources main=${resdir}/%(mainprogram)s PYTHONPATH=$resdir export PYTHONPATH exec ${executable} ${main} ${1} | def report(self): # XXX something decent import pprint pprint.pprint(self.__dict__) | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
setExecutableTemplate = """executable = os.path.join(resources, "%s")""" pythonhomeSnippet = """os.environ["home"] = resources""" | def report(self): # XXX something decent import pprint pprint.pprint(self.__dict__) | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py | |
if self.executable is None: self.executable = sys.executable | def setup(self): if self.standalone and self.mainprogram is None: raise BundleBuilderError, ("must specify 'mainprogram' when " "building a standalone application.") if self.mainprogram is None and self.executable is None: raise BundleBuilderError, ("must specify either or both of " "'executable' and 'mainprogram'") | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py | |
execpath = pathjoin(self.execdir, self.name) | execname = self.name | def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execpath = pathjoin(self.execdir, self.name) else: execpath = pathjoin(resdir, os.path.basename(self.executable)) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.append... | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
execpath = pathjoin(resdir, os.path.basename(self.executable)) | execname = os.path.basename(self.executable) execpath = pathjoin(self.execdir, execname) | def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execpath = pathjoin(self.execdir, self.name) else: execpath = pathjoin(resdir, os.path.basename(self.executable)) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.append... | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
setexecutable = setExecutableTemplate % os.path.basename(self.executable) else: setexecutable = "" | def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execpath = pathjoin(self.execdir, self.name) else: execpath = pathjoin(resdir, os.path.basename(self.executable)) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.append... | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py | |
open(mainwrapperpath, "w").write(EXECVE_WRAPPER % locals()) | open(mainwrapperpath, "w").write(BOOTSTRAP_SCRIPT % locals()) | def preProcess(self): resdir = "Contents/Resources" if self.executable is not None: if self.mainprogram is None: execpath = pathjoin(self.execdir, self.name) else: execpath = pathjoin(resdir, os.path.basename(self.executable)) if not self.symlink_exec: self.files.append((self.executable, execpath)) self.binaries.append... | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
if self.missingModules: | if self.missingModules or self.maybeMissingModules: | def postProcess(self): self.addPythonModules() if self.strip and not self.symlink: self.stripBinaries() | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
self.missingModules.extend(mf.any_missing()) | if hasattr(mf, "any_missing_maybe"): missing, maybe = mf.any_missing_maybe() else: missing = mf.any_missing() maybe = [] self.missingModules.extend(missing) self.maybeMissingModules.extend(maybe) | def findDependencies(self): self.message("Finding module dependencies", 1) import modulefinder mf = modulefinder.ModuleFinder(excludes=self.excludeModules) # manually add our own site.py site = mf.add_module("site") site.__code__ = SITE_CO mf.scan_code(SITE_CO, site) | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
missingsub = [name for name in missing if "." in name] missing = [name for name in missing if "." not in name] | if self.maybeMissingModules: maybe = self.maybeMissingModules else: maybe = [name for name in missing if "." in name] missing = [name for name in missing if "." not in name] | def reportMissing(self): missing = [name for name in self.missingModules if name not in MAYMISS_MODULES] missingsub = [name for name in missing if "." in name] missing = [name for name in missing if "." not in name] missing.sort() missingsub.sort() if missing: self.message("Warning: couldn't find the following modules:... | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
missingsub.sort() | maybe.sort() if maybe: self.message("Warning: couldn't find the following submodules:", 1) self.message(" (Note that these could be false alarms -- " "it's not always", 1) self.message(" possible to distinguish between from \"package import submodule\" ", 1) self.message(" and \"from package import name\")", 1... | def reportMissing(self): missing = [name for name in self.missingModules if name not in MAYMISS_MODULES] missingsub = [name for name in missing if "." in name] missing = [name for name in missing if "." not in name] missing.sort() missingsub.sort() if missing: self.message("Warning: couldn't find the following modules:... | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
self.message(" " + ", ".join(missing)) if missingsub: self.message("Warning: couldn't find the following submodules " "(but it's probably OK since modulefinder can't distinguish " "between from \"module import submodule\" and " "\"from module import name\"):", 1) self.message(" " + ", ".join(missingsub)) | for name in missing: self.message(" ? " + name, 1) def report(self): import pprint pprint.pprint(self.__dict__) if self.standalone: self.reportMissing() | def reportMissing(self): missing = [name for name in self.missingModules if name not in MAYMISS_MODULES] missingsub = [name for name in missing if "." in name] missing = [name for name in missing if "." not in name] missing.sort() missingsub.sort() if missing: self.message("Warning: couldn't find the following modules:... | 74bdca8a207af74796b7e4a117886be92818f6cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bdca8a207af74796b7e4a117886be92818f6cb/bundlebuilder.py |
"""Like nstransfercmd() but returns only the socket.""" | """Like ntransfercmd() but returns only the socket.""" | def transfercmd(self, cmd, rest=None): """Like nstransfercmd() but returns only the socket.""" return self.ntransfercmd(cmd, rest)[0] | b6aca6afe2c46b57810c0f3e726e6dae5336d324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6aca6afe2c46b57810c0f3e726e6dae5336d324/ftplib.py |
return int(resp[3:].strip()) | s = resp[3:].strip() try: return int(s) except OverflowError: return long(s) | def size(self, filename): '''Retrieve the size of a file.''' # Note that the RFC doesn't say anything about 'SIZE' resp = self.sendcmd('SIZE ' + filename) if resp[:3] == '213': return int(resp[3:].strip()) | b6aca6afe2c46b57810c0f3e726e6dae5336d324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6aca6afe2c46b57810c0f3e726e6dae5336d324/ftplib.py |
if m: return int(m.group(1)) return None | if not m: return None s = m.group(1) try: return int(s) except OverflowError: return long(s) | def parse150(resp): '''Parse the '150' response for a RETR request. Returns the expected transfer size or None; size is not guaranteed to be present in the 150 message. ''' if resp[:3] != '150': raise error_reply, resp global _150_re if _150_re is None: import re _150_re = re.compile("150 .* \((\d+) bytes\)", re.IGNORE... | b6aca6afe2c46b57810c0f3e726e6dae5336d324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6aca6afe2c46b57810c0f3e726e6dae5336d324/ftplib.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.... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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 | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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.sto... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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("... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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("... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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("... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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("... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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("... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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() | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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.it... | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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])) | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/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) | a8946406dfd6f4ecaf090325eed64241b36b5d4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a8946406dfd6f4ecaf090325eed64241b36b5d4a/wcgui.py |
if self.basetype: Output(" | Output(" | def generate(self): # XXX This should use long strings and %(varname)s substitution! | 5bb2f6497f6b4455e4da64ef049bf43cd1c2215a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bb2f6497f6b4455e4da64ef049bf43cd1c2215a/bgenObjectDefinition.py |
else: Output(" self.prefix, self.typename) | def generate(self): # XXX This should use long strings and %(varname)s substitution! | 5bb2f6497f6b4455e4da64ef049bf43cd1c2215a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bb2f6497f6b4455e4da64ef049bf43cd1c2215a/bgenObjectDefinition.py | |
env['CONTENT_TYPE'] = self.headers.type | if self.headers.typeheader is None: env['CONTENT_TYPE'] = self.headers.type else: env['CONTENT_TYPE'] = self.headers.typeheader | def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = string.rfind(rest, '?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = string.find(rest, '/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.tran... | 01fc65d92fcf774c4b14fb0e744ad4d08c825168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/01fc65d92fcf774c4b14fb0e744ad4d08c825168/CGIHTTPServer.py |
def print_debug(msg): if debug: print msg def _open(fullpath): | def needs_declaration(fullpath): | def print_debug(msg): if debug: print msg | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py |
size = os.stat(fullpath).st_size except OSError, err: print_debug("%s: permission denied: %s" % (fullpath, err)) | infile = open(fullpath, 'rU') except IOError: | def _open(fullpath): try: size = os.stat(fullpath).st_size except OSError, err: # Permission denied - ignore the file print_debug("%s: permission denied: %s" % (fullpath, err)) return None if size > 1024*1024: # too big print_debug("%s: the file is too big: %d bytes" % (fullpath, size)) return None try: return open(f... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py |
if size > 1024*1024: print_debug("%s: the file is too big: %d bytes" % (fullpath, size)) return None try: return open(fullpath, 'rU') except IOError, err: print_debug("%s: access denied: %s" % (fullpath, err)) return None def has_python_ext(fullpath): return fullpath.endswith(".py") or fullpath.endswith(".pyw") def ... | line1 = infile.readline() line2 = infile.readline() if get_declaration(line1) or get_declaration(line2): infile.close() | def _open(fullpath): try: size = os.stat(fullpath).st_size except OSError, err: # Permission denied - ignore the file print_debug("%s: permission denied: %s" % (fullpath, err)) return None if size > 1024*1024: # too big print_debug("%s: the file is too big: %d bytes" % (fullpath, size)) return None try: return open(f... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py |
line = infile.readline() | rest = infile.read() | def looks_like_python(fullpath): infile = _open(fullpath) if infile is None: return False line = infile.readline() infile.close() if binary_re.search(line): # file appears to be binary print_debug("%s: appears to be binary" % fullpath) return False if fullpath.endswith(".py") or fullpath.endswith(".pyw"): return Tru... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py |
if binary_re.search(line): print_debug("%s: appears to be binary" % fullpath) | if has_correct_encoding(line1+line2+rest, "ascii"): | def looks_like_python(fullpath): infile = _open(fullpath) if infile is None: return False line = infile.readline() infile.close() if binary_re.search(line): # file appears to be binary print_debug("%s: appears to be binary" % fullpath) return False if fullpath.endswith(".py") or fullpath.endswith(".pyw"): return Tru... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py |
if fullpath.endswith(".py") or fullpath.endswith(".pyw"): return True elif "python" in line: return True return False def can_be_compiled(fullpath): infile = _open(fullpath) if infile is None: return False code = infile.read() infile.close() try: compile(code, fullpath, "exec") except Exception, err: print_debug(... | def looks_like_python(fullpath): infile = _open(fullpath) if infile is None: return False line = infile.readline() infile.close() if binary_re.search(line): # file appears to be binary print_debug("%s: appears to be binary" % fullpath) return False if fullpath.endswith(".py") or fullpath.endswith(".pyw"): return Tru... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py | |
def walk_python_files(paths, is_python=looks_like_python, exclude_dirs=None): """\ Recursively yield all Python source files below the given paths. | usage = """Usage: %s [-cd] paths... -c: recognize Python source files trying to compile them -d: debug output""" % sys.argv[0] | def walk_python_files(paths, is_python=looks_like_python, exclude_dirs=None): """\ Recursively yield all Python source files below the given paths. paths: a list of files and/or directories to be checked. is_python: a function that takes a file name and checks whether it is a Python source file exclude_dirs: a list of... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py |
paths: a list of files and/or directories to be checked. is_python: a function that takes a file name and checks whether it is a Python source file exclude_dirs: a list of directory base names that should be excluded in the search """ if exclude_dirs is None: exclude_dirs=[] for path in paths: print_debug("testing: %s... | try: opts, args = getopt.getopt(sys.argv[1:], 'cd') except getopt.error, msg: print >>sys.stderr, msg print >>sys.stderr, usage sys.exit(1) is_python = pysource.looks_like_python debug = False for o, a in opts: if o == '-c': is_python = pysource.can_be_compiled elif o == '-d': debug = True if not args: print >>sys.s... | def walk_python_files(paths, is_python=looks_like_python, exclude_dirs=None): """\ Recursively yield all Python source files below the given paths. paths: a list of files and/or directories to be checked. is_python: a function that takes a file name and checks whether it is a Python source file exclude_dirs: a list of... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py |
if __name__ == "__main__": for fullpath in walk_python_files(['.']): print fullpath print "----------" for fullpath in walk_python_files(['.'], is_python=can_be_compiled): print fullpath | def walk_python_files(paths, is_python=looks_like_python, exclude_dirs=None): """\ Recursively yield all Python source files below the given paths. paths: a list of files and/or directories to be checked. is_python: a function that takes a file name and checks whether it is a Python source file exclude_dirs: a list of... | 568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py | |
"""Tix maintains a list of directory under which which | """Tix maintains a list of directories under which | def tix_addbitmapdir(self, directory): """Tix maintains a list of directory under which which the tix_getimage and tix_getbitmap commands will search for image files. The standard bitmap direc tory is $TIX_LIBRARY/bitmaps. The addbitmapdir com mand adds directory into this list. By using this command, the image ... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
search for image files. The standard bitmap direc tory is $TIX_LIBRARY/bitmaps. The addbitmapdir com mand adds directory into this list. By using this | search for image files. The standard bitmap directory is $TIX_LIBRARY/bitmaps. The addbitmapdir command adds directory into this list. By using this | def tix_addbitmapdir(self, directory): """Tix maintains a list of directory under which which the tix_getimage and tix_getbitmap commands will search for image files. The standard bitmap direc tory is $TIX_LIBRARY/bitmaps. The addbitmapdir com mand adds directory into this list. By using this command, the image ... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
"""Query or modify the configuration options of the Tix application context. If no option is specified, returns a list describing all of the available options (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describin... | """Query or modify the configuration options of the Tix application context. If no option is specified, returns a dictionary all of the available options. If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of t... | def tix_configure(self, cnf=None, **kw): """Query or modify the configuration options of the Tix application context. If no option is specified, returns a list describing all of the available options (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, th... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
return apply(self.tk.call, ('tix', configure) + self._options(cnf,kw) ) | if kw: cnf = _cnfmerge((cnf, kw)) elif cnf: cnf = _cnfmerge(cnf) if cnf is None: cnf = {} for x in self.tk.split(self.tk.call('tix', 'configure')): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if isinstance(cnf, StringType): x = self.tk.split(self.tk.call('tix', 'configure', '-'+cnf)) return (x[0][1:],) + x[1:] retu... | def tix_configure(self, cnf=None, **kw): """Query or modify the configuration options of the Tix application context. If no option is specified, returns a list describing all of the available options (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, th... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
"""Returns the file selection dialog that may be shared among different modules of this application. This command will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix filedialog. An optional dlgclass parameter can be passe... | """Returns the file selection dialog that may be shared among different calls from this application. This command will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix_filedialog. An optional dlgclass parameter can be passed to specifie... | def tix_filedialog(self, dlgclass=None): """Returns the file selection dialog that may be shared among different modules of this application. This command will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix filedialog. An op... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
"""Locates a bitmap file of the name name.xpm or name in one of the bitmap directories (self, see the tix_addbitmapdir command above). By using tix_getbitmap, you can advoid hard coding the pathnames of the bitmap files in your application. When successful, it returns the complete pathname of the bitmap f... | """Locates a bitmap file of the name name.xpm or name in one of the bitmap directories (see the tix_addbitmapdir command above). By using tix_getbitmap, you can avoid hard coding the pathnames of the bitmap files in your application. When successful, it returns the complete pathname of the bitmap file, prefixed with t... | def tix_getbitmap(self, name): """Locates a bitmap file of the name name.xpm or name in one of the bitmap directories (self, see the tix_addbitmapdir command above). By using tix_getbitmap, you can advoid hard coding the pathnames of the bitmap files in your application. When successful, it returns the co... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
"""Locates an image file of the name name.xpm, name.xbm or name.ppm in one of the bitmap directo ries (see the addbitmapdir command above). If more than one file with the same name (but different extensions) exist, then the image type is chosen according to the depth of the X display: xbm images are chose... | """Locates an image file of the name name.xpm, name.xbm or name.ppm in one of the bitmap directories (see the addbitmapdir command above). If more than one file with the same name (but different extensions) exist, then the image type is chosen according to the depth of the X display: xbm images are chosen on monochrome... | def tix_getimage(self, name): """Locates an image file of the name name.xpm, name.xbm or name.ppm in one of the bitmap directo ries (see the addbitmapdir command above). If more than one file with the same name (but different extensions) exist, then the image type is chosen according to the depth of the X ... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
scheme mechanism. Available options are: | scheme mechanism. Available options include: | def tix_option_get(self, name): """Gets the options manitained by the Tix scheme mechanism. Available options are: | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
"""Resets the scheme and fontset of the Tix application to newScheme and newFontSet, respectively. This affects only those widgets created after this call. Therefore, it is best to call the resetop tions command before the creation of any widgets in a Tix application. The optional parameter newScmPrio can be... | """Resets the scheme and fontset of the Tix application to newScheme and newFontSet, respectively. This affects only those widgets created after this call. Therefore, it is best to call the resetoptions command before the creation of any widgets in a Tix application. The optional parameter newScmPrio can be given to ... | def tix_resetoptions(self, newScheme, newFontSet, newScmPrio=None): """Resets the scheme and fontset of the Tix application to newScheme and newFontSet, respectively. This affects only those widgets created after this call. Therefore, it is best to call the resetop tions command before the creation of any wid... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
def __init__(self, screenName=None, baseName=None, className='Tix'): Tkinter.Tk.__init__(self, screenName, baseName, className) tixlib = os.environ.get('TIX_LIBRARY') self.tk.eval('global auto_path; lappend auto_path [file dir [info nameof]]') if tixlib is not None: self.tk.eval('global auto_path; lappend auto_path {%s... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py | ||
elif type(option) != type(''): | elif not isinstance(option, StringType): | def config_all(self, option, value): """Set configuration options for all subwidgets (and self).""" if option == '': return elif type(option) != type(''): option = `option` if type(value) != type(''): value = `value` names = self._subwidget_names() for name in names: self.tk.call(name, 'configure', '-' + option, value) | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
if type(value) != type(''): | if not isinstance(value, StringType): | def config_all(self, option, value): """Set configuration options for all subwidgets (and self).""" if option == '': return elif type(option) != type(''): option = `option` if type(value) != type(''): value = `value` names = self._subwidget_names() for name in names: self.tk.call(name, 'configure', '-' + option, value) | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
label Label message Message""" | label Label message Message""" | def __getitem__(self,key): return self.tk.call(self.stylename, 'cget', '-%s'%key) | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] | static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] | def __init__(self, master=None, cnf={}, **kw): # static seem to be -installcolormap -initwait -statusbar -cursor static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] TixWidget.__init__(self, master, 'tixBalloon', static, cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label', destroy_ph... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
destroy_physically=0) | destroy_physically=0) | def __init__(self, master=None, cnf={}, **kw): # static seem to be -installcolormap -initwait -statusbar -cursor static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] TixWidget.__init__(self, master, 'tixBalloon', static, cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label', destroy_ph... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
destroy_physically=0) | destroy_physically=0) | def __init__(self, master=None, cnf={}, **kw): # static seem to be -installcolormap -initwait -statusbar -cursor static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] TixWidget.__init__(self, master, 'tixBalloon', static, cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label', destroy_ph... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
['orientation', 'options'], cnf, kw) | ['orientation', 'options'], cnf, kw) | def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixButtonBox', ['orientation', 'options'], cnf, kw) | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
(self._w, 'add', name) + self._options(cnf, kw)) | (self._w, 'add', name) + self._options(cnf, kw)) | def add(self, name, cnf={}, **kw): """Add a button with given name to box.""" | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
['editable', 'dropdown', 'fancy', 'options'], cnf, kw) | ['editable', 'dropdown', 'fancy', 'options'], cnf, kw) | def __init__ (self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixComboBox', ['editable', 'dropdown', 'fancy', 'options'], cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label') self.subwidget_list['entry'] = _dummyEntry(self, 'entry') self.subwidget_list['arrow'] = _dummyButton(self, 'ar... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
'slistbox') | 'slistbox') | def __init__ (self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixComboBox', ['editable', 'dropdown', 'fancy', 'options'], cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label') self.subwidget_list['entry'] = _dummyEntry(self, 'entry') self.subwidget_list['arrow'] = _dummyButton(self, 'ar... | 723293cb49f479a41dc893d72c2d6502587d52cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/723293cb49f479a41dc893d72c2d6502587d52cb/Tix.py |
if line == '\037\014\n': | if line == '\037\014\n' or line == '\037': | def _search_end(self): while 1: pos = self.fp.tell() line = self.fp.readline() if not line: return if line == '\037\014\n': self.fp.seek(pos) return | 6abc685a03763a44f4b7abb2a5d0f3c6b2853ac5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6abc685a03763a44f4b7abb2a5d0f3c6b2853ac5/mailbox.py |
try: r, w, e = select.select(r, w, e, timeout) except select.error, err: if err[0] != EINTR: raise | if [] == r == w == e: time.sleep(timeout) else: try: r, w, e = select.select(r, w, e, timeout) except select.error, err: if err[0] not in (EINTR, ENOENT): raise | def poll(timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append(fd) if obj.writable(): w.append(fd) try: r, w, e = select.select(r, w, e, timeout) except select.error, err: if err[0] != EINTR: raise for fd in r: obj = map.get(fd) ... | d8ce87ad84d748fb648b874d7dd9d9a3a835ec3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8ce87ad84d748fb648b874d7dd9d9a3a835ec3d/asyncore.py |
while url[-1] in ');:,.?\'"': | while url[-1] in '();:,.?\'"<>': | def translate(text, pre=0): global translate_prog if not translate_prog: url = '\(http\|ftp\|https\)://[^ \t\r\n]*' email = '\<[-a-zA-Z0-9._]+@[-a-zA-Z0-9._]+' translate_prog = prog = regex.compile(url + '\|' + email) else: prog = translate_prog i = 0 list = [] while 1: j = prog.search(text, i) if j < 0: break list.app... | 0721358969aa14f5f38601f0d921a6ec5432e5d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0721358969aa14f5f38601f0d921a6ec5432e5d6/faqwiz.py |
i = i + len(url) | def translate(text, pre=0): global translate_prog if not translate_prog: url = '\(http\|ftp\|https\)://[^ \t\r\n]*' email = '\<[-a-zA-Z0-9._]+@[-a-zA-Z0-9._]+' translate_prog = prog = regex.compile(url + '\|' + email) else: prog = translate_prog i = 0 list = [] while 1: j = prog.search(text, i) if j < 0: break list.app... | 0721358969aa14f5f38601f0d921a6ec5432e5d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0721358969aa14f5f38601f0d921a6ec5432e5d6/faqwiz.py | |
if self.addr == types.TupleType: | if type(self.addr) == types.TupleType: | def __repr__ (self): try: status = [] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr: if self.addr == types.TupleType: status.append ('%s:%d' % self.addr) else: status.append (self.addr) return '<%s %s at %x>' % (self.__class__.__name__, ' '.jo... | 1efbe425f5c8b822c2b65e7d8041c0197941f97a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1efbe425f5c8b822c2b65e7d8041c0197941f97a/asyncore.py |
file.warn ("exclude (!) doesn't apply to " + "whole directory trees") | manifest.warn ("exclude (!) doesn't apply to " + "whole directory trees") | def read_manifest (self): | e9436da6863e18f710e0908cb8d4be4b571a172d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9436da6863e18f710e0908cb8d4be4b571a172d/dist.py |
file.warn ("can't have multiple words unless first word " + "('%s') is a directory name" % words[0]) | manifest.warn ("can't have multiple words unless first word " + "('%s') is a directory name" % words[0]) | def read_manifest (self): | e9436da6863e18f710e0908cb8d4be4b571a172d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9436da6863e18f710e0908cb8d4be4b571a172d/dist.py |
file.warn ("no files excluded by '%s'" % pattern) | manifest.warn ("no files excluded by '%s'" % pattern) | def read_manifest (self): | e9436da6863e18f710e0908cb8d4be4b571a172d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9436da6863e18f710e0908cb8d4be4b571a172d/dist.py |
if debuginfo: self.move_file(debuginfo[0], self.dist_dir) | def run (self): | c982bbde1c5012202187b8e398fd631b6cec214b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c982bbde1c5012202187b8e398fd631b6cec214b/bdist_rpm.py | |
if data[0][-1] in (',', '.') or data[0].lower() in _daynames: | if data[0].endswith(',') or data[0].lower() in _daynames: | def parsedate_tz(data): """Convert a date string to a time tuple. Accounts for military timezones. """ data = data.split() if data[0][-1] in (',', '.') or data[0].lower() in _daynames: # There's a dayname here. Skip it del data[0] if len(data) == 3: # RFC 850 date, deprecated stuff = data[0].split('-') if len(stuff) =... | ba97659f5fedddac67587a0da94f486fd920cfb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba97659f5fedddac67587a0da94f486fd920cfb0/_parseaddr.py |
self.literal = message | self.literal = MapCRLF.sub(CRLF, message) | def append(self, mailbox, flags, date_time, message): """Append message to named mailbox. | 47404fffff3e36699786082d0ee6565872d627e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47404fffff3e36699786082d0ee6565872d627e1/imaplib.py |
test_mesg = 'From: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s' % {'user':USER, 'lf':CRLF} | test_mesg = 'From: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s' % {'user':USER, 'lf':'\n'} | def Time2Internaldate(date_time): """Convert 'date_time' to IMAP4 INTERNALDATE representation. Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' """ if isinstance(date_time, (int, float)): tt = time.localtime(date_time) elif isinstance(date_time, (tuple, time.struct_time)): tt = date_time elif isinstance(date_ti... | 47404fffff3e36699786082d0ee6565872d627e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47404fffff3e36699786082d0ee6565872d627e1/imaplib.py |
st2 = parser.sequence2ast(t) | try: st2 = parser.sequence2ast(t) except parser.ParserError: print "Failing syntax tree:" pprint.pprint(t) raise | def roundtrip(f, s): st1 = f(s) t = st1.totuple() st2 = parser.sequence2ast(t) | e1578ce20464dfda61d3b113f95fd006783beed6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e1578ce20464dfda61d3b113f95fd006783beed6/test_parser.py |
return | return command | def reinitialize_command (self, command): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This gives provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the confi... | 282c7a0230b578147a89a18ec22410b830edddfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/282c7a0230b578147a89a18ec22410b830edddfe/dist.py |
def __init__(self, s, charset=None, maxlinelen=MAXLINELEN, header_name=None): | def __init__(self, s, charset=None, maxlinelen=None, header_name=None): | def __init__(self, s, charset=None, maxlinelen=MAXLINELEN, header_name=None): """Create a MIME-compliant header that can contain many languages. | 812031b95555e607ccec74f31aabc7601a53ed8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/812031b95555e607ccec74f31aabc7601a53ed8a/Header.py |
The maximum line length can either be specified by maxlinelen, or you can pass in the name of the header field (e.g. "Subject") to let this class guess the best line length to use to prevent wrapping. The default maxlinelen is 76. | The maximum line length can be specified explicitly via maxlinelen. You can also pass None for maxlinelen and the name of a header field (e.g. "Subject") to let the constructor guess the best line length to use. The default maxlinelen is 76. | def __init__(self, s, charset=None, maxlinelen=MAXLINELEN, header_name=None): """Create a MIME-compliant header that can contain many languages. | 812031b95555e607ccec74f31aabc7601a53ed8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/812031b95555e607ccec74f31aabc7601a53ed8a/Header.py |
self._maxlinelen = maxlinelen if header_name is not None: self.guess_maxlinelen(header_name) | if maxlinelen is None: if header_name is None: self._maxlinelen = MAXLINELEN else: self.guess_maxlinelen(header_name) else: self._maxlinelen = maxlinelen | def __init__(self, s, charset=None, maxlinelen=MAXLINELEN, header_name=None): """Create a MIME-compliant header that can contain many languages. | 812031b95555e607ccec74f31aabc7601a53ed8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/812031b95555e607ccec74f31aabc7601a53ed8a/Header.py |
if charset.encoded_header_len(encoded) < self._maxlinelen: | elen = charset.encoded_header_len(encoded) if elen <= self._maxlinelen: | def _split(self, s, charset): # Split up a header safely for use with encode_chunks. BAW: this # appears to be a private convenience method. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) if charset.encoded_header_len(encoded) < self._maxlinelen: return [(encoded, charset)] else: ... | 812031b95555e607ccec74f31aabc7601a53ed8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/812031b95555e607ccec74f31aabc7601a53ed8a/Header.py |
halfway = len(splittable) // 2 | halfway = _intdiv2(len(splittable)) | def _split(self, s, charset): # Split up a header safely for use with encode_chunks. BAW: this # appears to be a private convenience method. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) if charset.encoded_header_len(encoded) < self._maxlinelen: return [(encoded, charset)] else: ... | 812031b95555e607ccec74f31aabc7601a53ed8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/812031b95555e607ccec74f31aabc7601a53ed8a/Header.py |
os.mkdir(dst) | os.makedirs(dst) copystat(src, dst) | def copytree(src, dst, symlinks=False): """Recursively copy a directory tree using copy2(). The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the desti... | e4172eadf3fb9c1de591305ad4ca4ce3e252abd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4172eadf3fb9c1de591305ad4ca4ce3e252abd3/shutil.py |
output = struct.pack("iiiiiii", 0x950412de, | output = struct.pack("Iiiiiii", 0x950412deL, | def generate(): "Return the generated output." global MESSAGES keys = MESSAGES.keys() # the keys are sorted in the .mo file keys.sort() offsets = [] ids = strs = '' for id in keys: # For each string, we need size and file offset. Each string is NUL # terminated; the NUL does not count into the size. offsets.append((le... | 8f0bd5657a384199d9203c753cecdd0a9b1f9bcb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8f0bd5657a384199d9203c753cecdd0a9b1f9bcb/msgfmt.py |
files=Open(**options).show() return files.split() | return Open(**options).show() | def askopenfilenames(**options): """Ask for multiple filenames to open Returns a list of filenames or empty list if cancel button selected """ options["multiple"]=1 files=Open(**options).show() return files.split() | d6efae500ce3e955b95b324954defa1a9f2d9e96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d6efae500ce3e955b95b324954defa1a9f2d9e96/tkFileDialog.py |
'db4': {'libs': ('db-4.1', 'db-4.0',), | 'db4': {'libs': ('db-4.1', 'db41', 'db-4.0', 'db4',), | 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') | 28df64ac472862ce0f03f932407e71a35ce61f19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/28df64ac472862ce0f03f932407e71a35ce61f19/setup.py |
'db3': {'libs': ('db-3.3', 'db-3.2', 'db-3.1'), | 'db3': {'libs': ('db-3.3', 'db-3.2', 'db-3.1', 'db3',), | 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') | 28df64ac472862ce0f03f932407e71a35ce61f19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/28df64ac472862ce0f03f932407e71a35ce61f19/setup.py |
"""parse the input lines from a robot.txt file. | """parse the input lines from a robots.txt file. | def parse(self, lines): """parse the input lines from a robot.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.""" state = 0 linenumber = 0 entry = Entry() | 2d95f1ad570791a5dffb16addd74b35b46f77fdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d95f1ad570791a5dffb16addd74b35b46f77fdc/robotparser.py |
_debug("Checking robot.txt allowance for:\n user agent: %s\n url: %s" % | _debug("Checking robots.txt allowance for:\n user agent: %s\n url: %s" % | def can_fetch(self, useragent, url): """using the parsed robots.txt decide if useragent can fetch url""" _debug("Checking robot.txt allowance for:\n user agent: %s\n url: %s" % (useragent, url)) if self.disallow_all: return False if self.allow_all: return True # search for given user agent matches # the first match c... | 2d95f1ad570791a5dffb16addd74b35b46f77fdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d95f1ad570791a5dffb16addd74b35b46f77fdc/robotparser.py |
finalized. This gives provides the opportunity to sneak option | finalized. This provides the opportunity to sneak option | def reinitialize_command (self, command): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This gives provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the confi... | 7d9c705b234ad2ad013db1649e5fd2ffc2a59a75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7d9c705b234ad2ad013db1649e5fd2ffc2a59a75/dist.py |
('dbserv2.theopalgroup.com', '/mediumfile'), ('dbserv2.theopalgroup.com', '/smallfile'), | def test(): """Test this module. A hodge podge of tests collected here, because they have too many external dependencies for the regular test suite. """ import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.python.org' selector = '/' if a... | 77628658ca71260d2a69bbb7f35f3f6e5df796be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/77628658ca71260d2a69bbb7f35f3f6e5df796be/httplib.py | |
c = HTTPConnection("promotions.yahoo.com") c.set_debuglevel(1) c.connect() c.request("GET", "/promotions/mom_com97/supermom.html") r = c.getresponse() print r.status, r.version lines = r.read().split("\n") print "\n".join(lines[:5]) c = HTTPConnection("promotions.yahoo.com", strict=1) c.set_debuglevel(1) c.connect()... | def test(): """Test this module. A hodge podge of tests collected here, because they have too many external dependencies for the regular test suite. """ import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.python.org' selector = '/' if a... | 77628658ca71260d2a69bbb7f35f3f6e5df796be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/77628658ca71260d2a69bbb7f35f3f6e5df796be/httplib.py | |
flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0) if flags >= 0: | try: flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0) except IOError: pass else: | def _set_cloexec(fd): flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0) if flags >= 0: # flags read successfully, modify flags |= _fcntl.FD_CLOEXEC _fcntl.fcntl(fd, _fcntl.F_SETFD, flags) | f09994e5273e358c5fc764db681bd3dafecc3e2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f09994e5273e358c5fc764db681bd3dafecc3e2d/tempfile.py |
return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "config.h") | return os.path.join(sys.exec_prefix, "include", "python" + sys.version[:3], "config.h") | def get_config_h_filename(): """Return full pathname of installed config.h file.""" return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "config.h") | 6a1b53c16538b3d503b19aa039f4a54bc757bc21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6a1b53c16538b3d503b19aa039f4a54bc757bc21/sysconfig.py |
folderbox = Listbox(right) | folderbox = Listbox(right, {'exportselection': 0}) | def main(): global root, tk, top, mid, bot global folderbox, foldermenu, scanbox, scanmenu, viewer global folder, seq global mh, mhf # Parse command line options folder = 'inbox' seq = 'all' try: opts, args = getopt.getopt(sys.argv[1:], '') except getopt.error, msg: print msg sys.exit(2) for arg in args: if arg[:1] =... | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py |
def open_folder(*e): | def open_folder(e=None): | def open_folder(*e): global folder, mhf sel = folderbox.curselection() if len(sel) != 1: if len(sel) > 1: msg = "Please open one folder at a time" else: msg = "Please select a folder to open" dialog(root, "Can't Open Folder", msg, "", 0, "OK") return i = sel[0] folder = folderbox.get(i) mhf = mh.openfolder(folder) resc... | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py |
def open_message(*e): | def open_message(e=None): | def open_message(*e): global viewer sel = scanbox.curselection() if len(sel) != 1: if len(sel) > 1: msg = "Please open one message at a time" else: msg = "Please select a message to open" dialog(root, "Can't Open Message", msg, "", 0, "OK") return cursor = scanbox['cursor'] scanbox['cursor'] = 'watch' tk.call('update',... | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py |
def remove_message(): | def remove_message(e=None): | def remove_message(): itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Remove", "Please select a message to remove", "", 0, "OK") return todo = [] for i in sel: line = scanbox.get(i) if scanparser.match(line) >= 0: todo.append(string.atoi(scanparser.group(1))) mhf.removemes... | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py |
def refile_message(): | def refile_message(e=None): | def refile_message(): global lastrefile, tofolder itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Refile", "Please select a message to refile", "", 0, "OK") return foldersel = folderbox.curselection() if len(foldersel) != 1: if not foldersel: msg = "Please select a folder ... | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py |
print 'refile', todo, tofolder | def refile_message(): global lastrefile, tofolder itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Refile", "Please select a message to refile", "", 0, "OK") return foldersel = folderbox.curselection() if len(foldersel) != 1: if not foldersel: msg = "Please select a folder ... | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py | |
print 'new folder' | def refile_message(): global lastrefile, tofolder itop = scanbox.nearest(0) sel = scanbox.curselection() if not sel: dialog(root, "No Message To Refile", "Please select a message to refile", "", 0, "OK") return foldersel = folderbox.curselection() if len(foldersel) != 1: if not foldersel: msg = "Please select a folder ... | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py | |
print 'yview', `itop` | def fixfocus(near, itop): n = scanbox.size() for i in range(n): line = scanbox.get(`i`) if scanparser.match(line) >= 0: num = string.atoi(scanparser.group(1)) if num >= near: break else: i = 'end' scanbox.select_from(i) print 'yview', `itop` scanbox.yview(itop) | 78b0c82535af09fde940d1b040f9da72c20f7c70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78b0c82535af09fde940d1b040f9da72c20f7c70/mbox.py | |
Single = group("^'", "[^\]'") Double = group('^"', '[^\]"') Single3 = group("^'''", "[^\]'''") Double3 = group('^"""', '[^\]"""') | Single = group("[^'\]", "[\].") + "*'" Double = group('[^"\]', '[\].') + '*"' Single3 = group("[^'\]","[\].","'[^'\]","'[\].","''[^'\]","''[\].") + "*'''" Double3 = group('[^"\]','[\].','"[^"\]','"[\].','""[^"\]','""[\].') + '*"""' | def group(*choices): return '\(' + string.join(choices, '\|') + '\)' | de65527e4b0925692f0d75f388116b7958a390bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de65527e4b0925692f0d75f388116b7958a390bb/tokenize.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.