rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
def set_link_objects (self, objects): """Set the list of object files (or analogues) to be included in every link to 'objects'. This does not affect any standard object files that the linker may include by default (such as system libraries). """ self.objects = copy (objects) | fd665424e7f30e6bf08b6431af59d0fa0d1271f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fd665424e7f30e6bf08b6431af59d0fa0d1271f1/ccompiler.py |
||
import saxutils | from . import saxutils | def parse(self, source): import saxutils source = saxutils.prepare_input_source(source) | e19efb3aa1de96074e7cdf7a2ff70e108372818f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e19efb3aa1de96074e7cdf7a2ff70e108372818f/xmlreader.py |
"unsupported format character '\000' (0x3000) at index 5") | "unsupported format character '?' (0x3000) at index 5") | def test_exc(formatstr, args, exception, excmsg): try: testformat(formatstr, args) except exception, exc: if str(exc) == excmsg: if verbose: print "yes" else: if verbose: print 'no' print 'Unexpected ', exception, ':', repr(str(exc)) except: if verbose: print 'no' print 'Unexpected exception' raise | af926b81ad1b12c1072dbb3656972a4b1bd34cd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/af926b81ad1b12c1072dbb3656972a4b1bd34cd6/test_format.py |
flags = 0 | flags = select.POLLERR | select.POLLHUP | select.POLLNVAL | def poll2(timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map = socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.POLLIN if obj.writable(): flags = flags | select.POLLOUT if flags: pollster.register(fd, flags) try: r = pollster.poll(timeout) except select.error, err: if err[0] != EINTR: raise r = [] for fd, flags in r: obj = map.get(fd) if obj is None: continue readwrite(obj, flags) | 6967de7844c4815a1a20ecad6d7f92caef399eeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6967de7844c4815a1a20ecad6d7f92caef399eeb/asyncore.py |
flags = select.POLLIN | flags = select.POLLIN | select.POLLPRI | def poll2(timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map = socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.POLLIN if obj.writable(): flags = flags | select.POLLOUT if flags: pollster.register(fd, flags) try: r = pollster.poll(timeout) except select.error, err: if err[0] != EINTR: raise r = [] for fd, flags in r: obj = map.get(fd) if obj is None: continue readwrite(obj, flags) | 6967de7844c4815a1a20ecad6d7f92caef399eeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6967de7844c4815a1a20ecad6d7f92caef399eeb/asyncore.py |
def getinfo(self): return (self.format, self.width, self.height, self.packfactor,\ self.c0bits, self.c1bits, self.c2bits, self.offset, \ self.chrompack) | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
||
def rewind(self): | def reopen(self): | def rewind(self): self.fp.seek(0) x = self.initfp(self.fp, self.filename) | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
def getnextframedata(self, (size, chromsize)): | def getnextframedata(self, size, chromsize): | def getnextframedata(self, (size, chromsize)): if self.hascache: self.position() self.frameno = self.frameno + 1 data = self.fp.read(size) if len(data) <> size: raise EOFError if chromsize: chromdata = self.fp.read(chromsize) if len(chromdata) <> chromsize: raise EOFError else: chromdata = None # return data, chromdata | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
def skipnextframedata(self, (size, chromsize)): | def skipnextframedata(self, size, chromsize): | def skipnextframedata(self, (size, chromsize)): if self.hascache: self.frameno = self.frameno + 1 return # Note that this won't raise EOFError for a partial frame. try: self.fp.seek(size + chromsize, 1) # Relative seek except: # Assume it's a pipe -- read the data to discard it dummy = self.fp.read(size + chromsize) | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
def showframe(self, (data, chromdata)): | def showframe(self, data, chromdata): | def showframe(self, (data, chromdata)): w, h, pf = self.width, self.height, self.packfactor if not self.colormapinited: self.initcolormap() factor = self.magnify if pf: factor = factor * pf if chromdata and not self.skipchrom: cp = self.chrompack cw = (w+cp-1)/cp ch = (h+cp-1)/cp gl.rectzoom(factor*cp, factor*cp) gl.pixmode(GL.PM_SIZE, 16) gl.writemask(self.mask - ((1 << self.c0bits) - 1)) gl.lrectwrite(self.xorigin, self.yorigin, \ self.xorigin + cw - 1, self.yorigin + ch - 1, \ chromdata) # if pf: gl.writemask((1 << self.c0bits) - 1) gl.pixmode(GL.PM_SIZE, 8) gl.rectzoom(factor, factor) w = w/pf h = h/pf gl.lrectwrite(self.xorigin, self.yorigin, \ self.xorigin + w - 1, self.yorigin + h - 1, data) | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
sys.stderr.write('Initializing color map...') | if not self.quiet: sys.stderr.write('Initializing color map...') | def initcolormap(self): self.colormapinited = 1 if self.format == 'rgb': gl.RGBmode() gl.gconfig() return gl.cmode() gl.gconfig() self.skipchrom = 0 sys.stderr.write('Initializing color map...') self.initcmap() sys.stderr.write(' Done.\n') if self.offset == 0: gl.color(0x800) gl.clear() self.mask = 0x7ff else: self.mask = 0xfff gl.clear() | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
sys.stderr.write(' Done.\n') | if not self.quiet: sys.stderr.write(' Done.\n') | def initcolormap(self): self.colormapinited = 1 if self.format == 'rgb': gl.RGBmode() gl.gconfig() return gl.cmode() gl.gconfig() self.skipchrom = 0 sys.stderr.write('Initializing color map...') self.initcmap() sys.stderr.write(' Done.\n') if self.offset == 0: gl.color(0x800) gl.clear() self.mask = 0x7ff else: self.mask = 0xfff gl.clear() | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
data = ('grey', 0) | data = ('grey', self.c0bits) | def writeheader(self): self.headerwritten = 1 if self.format == 'rgb': self.packfactor = 0 elif self.packfactor == 0: self.packfactor = 1 self.fp.write('CMIF video 3.0\n') if self.format == 'rgb': data = ('rgb', 0) elif self.format == 'grey': data = ('grey', 0) else: data = (self.format, (self.c0bits, self.c1bits, \ self.c2bits, self.chrompack, self.offset)) self.fp.write(`data`+'\n') data = (self.width, self.height, self.packfactor) self.fp.write(`data`+'\n') try: self._grabber = eval('grab_' + self.format) except: raise Error, 'unknown colorsys: ' + self.format | 620dcd44d24eb8bf113d55f56a197550bc6045b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/620dcd44d24eb8bf113d55f56a197550bc6045b6/VFile.py |
variable=self.__hexp) | variable=self.__hexp, command=self.__togglehex) | def __init__(self, switchboard, parent=None): # non-gui ivars self.__sb = switchboard self.__hexp = BooleanVar() self.__uwtyping = BooleanVar() # create the gui self.__frame = Frame(parent, relief=GROOVE, borderwidth=2) self.__frame.pack(side=RIGHT) # Red self.__xl = Label(self.__frame, text='Red:') self.__xl.grid(row=0, column=0, sticky=E) self.__x = Entry(self.__frame, width=4) self.__x.grid(row=0, column=1) self.__x.bindtags(self.__x.bindtags() + ('Normalize', 'Update')) self.__x.bind_class('Normalize', '<Key>', self.__normalize) self.__x.bind_class('Update' , '<Key>', self.__maybeupdate) # Green self.__yl = Label(self.__frame, text='Green:') self.__yl.grid(row=1, column=0, sticky=E) self.__y = Entry(self.__frame, width=4) self.__y.grid(row=1, column=1) self.__y.bindtags(self.__y.bindtags() + ('Normalize', 'Update')) # Blue self.__zl = Label(self.__frame, text='Blue:') self.__zl.grid(row=2, column=0, sticky=E) self.__z = Entry(self.__frame, width=4) self.__z.grid(row=2, column=1) self.__z.bindtags(self.__z.bindtags() + ('Normalize', 'Update')) # Update while typing? self.__uwt = Checkbutton(self.__frame, text='Update while typing', variable=self.__uwtyping) self.__uwt.grid(row=3, column=0, columnspan=2, sticky=W) # Hex/Dec self.__hex = Checkbutton(self.__frame, text='Hexadecimal', variable=self.__hexp) self.__hex.grid(row=4, column=0, columnspan=2, sticky=W) | 273b1be9cc92cde53c6673c280c3f5cc78c8ad96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/273b1be9cc92cde53c6673c280c3f5cc78c8ad96/TypeinViewer.py |
def __normalize(self, event=None): ew = event.widget contents = ew.get() if contents == '': contents = '0' # figure out what the contents value is in the current base try: if self.__hexp.get(): v = string.atoi(contents, 16) else: v = string.atoi(contents) except ValueError: v = None # if value is not legal, delete the last character and ring the bell if v is None or v < 0 or v > 255: contents = contents[:-1] ew.bell() elif self.__hexp.get(): contents = hex(v) else: contents = int(v) ew.delete(0, END) ew.insert(0, contents) | 273b1be9cc92cde53c6673c280c3f5cc78c8ad96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/273b1be9cc92cde53c6673c280c3f5cc78c8ad96/TypeinViewer.py |
||
contents = contents[:-1] | i = ew.index(INSERT) contents = contents[:i-1] + contents[i:] | def __normalize(self, event=None): ew = event.widget contents = ew.get() if contents == '': contents = '0' # figure out what the contents value is in the current base try: if self.__hexp.get(): v = string.atoi(contents, 16) else: v = string.atoi(contents) except ValueError: v = None # if value is not legal, delete the last character and ring the bell if v is None or v < 0 or v > 255: contents = contents[:-1] ew.bell() elif self.__hexp.get(): contents = hex(v) else: contents = int(v) ew.delete(0, END) ew.insert(0, contents) | 273b1be9cc92cde53c6673c280c3f5cc78c8ad96 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/273b1be9cc92cde53c6673c280c3f5cc78c8ad96/TypeinViewer.py |
os.rename(tmp_file.name, dest) | try: if hasattr(os, 'link'): os.link(tmp_file.name, dest) os.remove(tmp_file.name) else: os.rename(tmp_file.name, dest) except OSError, e: os.remove(tmp_file.name) if e.errno == errno.EEXIST: raise ExternalClashError('Name clash with existing message: %s' % dest) else: raise | def add(self, message): """Add message and return assigned key.""" tmp_file = self._create_tmp() try: self._dump_message(message, tmp_file) finally: _sync_close(tmp_file) if isinstance(message, MaildirMessage): subdir = message.get_subdir() suffix = self.colon + message.get_info() if suffix == self.colon: suffix = '' else: subdir = 'new' suffix = '' uniq = os.path.basename(tmp_file.name).split(self.colon)[0] dest = os.path.join(self._path, subdir, uniq + suffix) os.rename(tmp_file.name, dest) if isinstance(message, MaildirMessage): os.utime(dest, (os.path.getatime(dest), message.get_date())) return uniq | 8da4d8e5dc1aade852ca5277f200d63f53a43bd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8da4d8e5dc1aade852ca5277f200d63f53a43bd6/mailbox.py |
return open(path, 'wb+') | try: return _create_carefully(path) except OSError, e: if e.errno != errno.EEXIST: raise | def _create_tmp(self): """Create a file in the tmp subdirectory and open and return it.""" now = time.time() hostname = socket.gethostname() if '/' in hostname: hostname = hostname.replace('/', r'\057') if ':' in hostname: hostname = hostname.replace(':', r'\072') uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6), os.getpid(), Maildir._count, hostname) path = os.path.join(self._path, 'tmp', uniq) try: os.stat(path) except OSError, e: if e.errno == errno.ENOENT: Maildir._count += 1 return open(path, 'wb+') else: raise else: raise ExternalClashError('Name clash prevented file creation: %s' % path) | 8da4d8e5dc1aade852ca5277f200d63f53a43bd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8da4d8e5dc1aade852ca5277f200d63f53a43bd6/mailbox.py |
else: raise ExternalClashError('Name clash prevented file creation: %s' % path) | raise ExternalClashError('Name clash prevented file creation: %s' % path) | def _create_tmp(self): """Create a file in the tmp subdirectory and open and return it.""" now = time.time() hostname = socket.gethostname() if '/' in hostname: hostname = hostname.replace('/', r'\057') if ':' in hostname: hostname = hostname.replace(':', r'\072') uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6), os.getpid(), Maildir._count, hostname) path = os.path.join(self._path, 'tmp', uniq) try: os.stat(path) except OSError, e: if e.errno == errno.ENOENT: Maildir._count += 1 return open(path, 'wb+') else: raise else: raise ExternalClashError('Name clash prevented file creation: %s' % path) | 8da4d8e5dc1aade852ca5277f200d63f53a43bd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8da4d8e5dc1aade852ca5277f200d63f53a43bd6/mailbox.py |
def pickle(ob_type, pickle_function, constructor_ob = None): | def pickle(ob_type, pickle_function, constructor_ob=None): if type(ob_type) is _ClassType: raise TypeError("copy_reg is not intended for use with classes") if not callable(pickle_function): raise TypeError("reduction functions must be callable") | def pickle(ob_type, pickle_function, constructor_ob = None): dispatch_table[ob_type] = pickle_function if constructor_ob is not None: constructor(constructor_ob) | dd7167b7e69679a8458ad05e7c21c646775a219d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7167b7e69679a8458ad05e7c21c646775a219d/copy_reg.py |
def pickle_complex(c): return complex, (c.real, c.imag) | dd7167b7e69679a8458ad05e7c21c646775a219d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd7167b7e69679a8458ad05e7c21c646775a219d/copy_reg.py |
||
return self.decode(self.stream.read())[0] | return self.decode(self.stream.read(), self.errors)[0] | def read(self, size=-1): | bd2d5b48a46a987072540f3cda6d46911e583100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd2d5b48a46a987072540f3cda6d46911e583100/codecs.py |
object, decodedbytes = decode(data) | object, decodedbytes = decode(data, self.errors) | def read(self, size=-1): | bd2d5b48a46a987072540f3cda6d46911e583100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd2d5b48a46a987072540f3cda6d46911e583100/codecs.py |
return self.decode(line)[0] | return self.decode(line,self.errors)[0] | def readline(self, size=None): | bd2d5b48a46a987072540f3cda6d46911e583100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd2d5b48a46a987072540f3cda6d46911e583100/codecs.py |
return self.decode(data)[0].splitlines(1) | return self.decode(data,self.errors)[0].splitlines(1) | def readlines(self, sizehint=0): | bd2d5b48a46a987072540f3cda6d46911e583100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd2d5b48a46a987072540f3cda6d46911e583100/codecs.py |
u = u'\U00010001\U00020002\U00030003\U00040004\U00050005' for encoding in ('utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'unicode_escape', 'unicode_internal'): verify(unicode(u.encode(encoding),encoding) == u) | def __str__(self): return self.x | 2851f4b9c1a3650076f5a010637da7bae42e5931 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2851f4b9c1a3650076f5a010637da7bae42e5931/test_unicode.py |
|
self._cont_handler.startElement(name, attrs) | self._cont_handler.startElementNS(name, qname, attrs) | def startElementNS(self, name, qname, attrs): self._cont_handler.startElement(name, attrs) | 6c03578d19ef7d1d78102a64c1c7d2b22e99bae9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6c03578d19ef7d1d78102a64c1c7d2b22e99bae9/saxutils.py |
print "open", askopenfilename(filetypes=[("all filez", "*")]) print "saveas", asksaveasfilename() | enc = "utf-8" try: import locale enc = locale.nl_langinfo(locale.CODESET) except (ImportError, AttributeError): pass print "open", askopenfilename(filetypes=[("all filez", "*")]).encode(enc) print "saveas", asksaveasfilename().encode(enc) | def askdirectory (**options): "Ask for a directory, and return the file name" return Directory(**options).show() | 5627324ad9b53a5e4fc9e14a2fca1c3290b735e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5627324ad9b53a5e4fc9e14a2fca1c3290b735e4/tkFileDialog.py |
self.log_error("command: %s", cmdline) | self.log_message("command: %s", cmdline) | def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): self.send_error(403, "CGI script is not a plain file (%s)" % `scriptname`) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) return if not self.is_executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return | 524136cbc6f72f3dff7bf31c24a5bdd5d7b724c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/524136cbc6f72f3dff7bf31c24a5bdd5d7b724c5/CGIHTTPServer.py |
self.log_error("CGI script exited OK") | self.log_message("CGI script exited OK") | def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): self.send_error(403, "CGI script is not a plain file (%s)" % `scriptname`) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) return if not self.is_executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return | 524136cbc6f72f3dff7bf31c24a5bdd5d7b724c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/524136cbc6f72f3dff7bf31c24a5bdd5d7b724c5/CGIHTTPServer.py |
self.log_error("CGI script exited OK") | self.log_message("CGI script exited OK") | def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): self.send_error(403, "CGI script is not a plain file (%s)" % `scriptname`) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) return if not self.is_executable(scriptfile): self.send_error(403, "CGI script is not executable (%s)" % `scriptname`) return | 524136cbc6f72f3dff7bf31c24a5bdd5d7b724c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/524136cbc6f72f3dff7bf31c24a5bdd5d7b724c5/CGIHTTPServer.py |
if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]: | if not sys.argv[1:]: if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: | def main(): if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]: print 'Usage: zappyc dir ...' sys.exit(1) for dir in sys.argv[1:]: zappyc(dir) | cd9c8ebd8aea22cdf288f59c39b01c267508e33e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd9c8ebd8aea22cdf288f59c39b01c267508e33e/zappycfiles.py |
for dir in sys.argv[1:]: zappyc(dir) | for dir in sys.argv[1:]: zappyc(dir) | def main(): if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]: print 'Usage: zappyc dir ...' sys.exit(1) for dir in sys.argv[1:]: zappyc(dir) | cd9c8ebd8aea22cdf288f59c39b01c267508e33e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd9c8ebd8aea22cdf288f59c39b01c267508e33e/zappycfiles.py |
def doc(thing, title='Python Library Documentation: '): | def doc(thing, title='Python Library Documentation: %s'): | def doc(thing, title='Python Library Documentation: '): """Display text documentation, given an object or a path to an object.""" suffix, name = '', None if type(thing) is type(''): try: object = locate(thing) except ErrorDuringImport, value: print value return if not object: print 'no Python documentation found for %s' % repr(thing) return parts = split(thing, '.') if len(parts) > 1: suffix = ' in ' + join(parts[:-1], '.') name = parts[-1] thing = object desc = describe(thing) module = inspect.getmodule(thing) if not suffix and module and module is not thing: suffix = ' in module ' + module.__name__ pager(title + desc + suffix + '\n\n' + text.document(object, name)) | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
pager(title + desc + suffix + '\n\n' + text.document(object, name)) | pager(title % (desc + suffix) + '\n\n' + text.document(thing, name)) | def doc(thing, title='Python Library Documentation: '): """Display text documentation, given an object or a path to an object.""" suffix, name = '', None if type(thing) is type(''): try: object = locate(thing) except ErrorDuringImport, value: print value return if not object: print 'no Python documentation found for %s' % repr(thing) return parts = split(thing, '.') if len(parts) > 1: suffix = ' in ' + join(parts[:-1], '.') name = parts[-1] thing = object desc = describe(thing) module = inspect.getmodule(thing) if not suffix and module and module is not thing: suffix = ' in module ' + module.__name__ pager(title + desc + suffix + '\n\n' + text.document(object, name)) | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
def run(self, key, callback, completer=None): key = lower(key) | def run(self, callback, key=None, completer=None): if key: key = lower(key) | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
desc = split(freshimport(modname).__doc__ or '', '\n')[0] if find(lower(modname + ' - ' + desc), key) >= 0: callback(None, modname, desc) | if key is None: callback(None, modname, '') else: desc = split(freshimport(modname).__doc__ or '', '\n')[0] if find(lower(modname + ' - ' + desc), key) >= 0: callback(None, modname, desc) | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
if key: | if key is None: callback(path, modname, '') else: | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
else: callback(path, modname, '') | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
|
ModuleScanner().run(key, callback) | ModuleScanner().run(callback, key) | def callback(path, modname, desc): if modname[-9:] == '.__init__': modname = modname[:-9] + ' (package)' print modname, desc and '- ' + desc | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
def serve(port, callback=None, finalizer=None): | def serve(port, callback=None, completer=None): | def serve(port, callback=None, finalizer=None): import BaseHTTPServer, SocketServer, mimetools, select # Patch up mimetools.Message so it doesn't break if rfc822 is reloaded. class Message(mimetools.Message): def __init__(self, fp, seekable=1): Message = self.__class__ Message.__bases__[0].__bases__[0].__init__(self, fp, seekable) self.encodingheader = self.getheader('content-transfer-encoding') self.typeheader = self.getheader('content-type') self.parsetype() self.parseplist() class DocHandler(BaseHTTPServer.BaseHTTPRequestHandler): def send_document(self, title, contents): try: self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write(html.page(title, contents)) except IOError: pass def do_GET(self): path = self.path if path[-5:] == '.html': path = path[:-5] if path[:1] == '/': path = path[1:] if path and path != '.': try: obj = locate(path) except ErrorDuringImport, value: self.send_document(path, html.escape(str(value))) return if obj: self.send_document(describe(obj), html.document(obj, path)) else: self.send_document(path, | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
if finalizer: finalizer() | if completer: completer() | def server_activate(self): self.base.server_activate(self) if self.callback: self.callback(self) | 62de9755a6b9ac845b39db8fb3dc73ec9598b5f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62de9755a6b9ac845b39db8fb3dc73ec9598b5f9/pydoc.py |
return 'pwpc' | return 'pwpc', 1 | def interact(scriptname): if PPC_ONLY: return 'pwpc' d = Dlg.GetNewDialog(DLG_ID, -1) if not d: print "Can't get DLOG resource with id =", DLG_ID return d.SetDialogDefaultItem(OK_BUTTON) d.SetDialogCancelItem(CANCEL_BUTTON) Dlg.ParamText(scriptname, "", "", "") radiogroup = radio(d, GENFAT_BUTTON, GENPPC_BUTTON, GEN68K_BUTTON) radiogroup.set(GENFAT_BUTTON) gentype = 'fat' while 1: n = Dlg.ModalDialog(None) if n == OK_BUTTON or n == CANCEL_BUTTON: break elif radiogroup.hasitem(n): radiogroup.set(n) genitem = radiogroup.get() del radiogroup del d if genitem == GENFAT_BUTTON: gentype = 'fat' elif genitem == GENPPC_BUTTON: gentype = 'pwpc' elif genitem == GEN68K_BUTTON: gentype = 'm68k' return gentype, n == OK_BUTTON | 0c15eb35e9d3cc8cdce3d3a8397c55b0414e1201 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c15eb35e9d3cc8cdce3d3a8397c55b0414e1201/BuildApplication.py |
print "Can't get DLOG resource with id =", DLG_ID return | raise "Can't get DLOG resource with id =", DLG_ID | def interact(scriptname): if PPC_ONLY: return 'pwpc' d = Dlg.GetNewDialog(DLG_ID, -1) if not d: print "Can't get DLOG resource with id =", DLG_ID return d.SetDialogDefaultItem(OK_BUTTON) d.SetDialogCancelItem(CANCEL_BUTTON) Dlg.ParamText(scriptname, "", "", "") radiogroup = radio(d, GENFAT_BUTTON, GENPPC_BUTTON, GEN68K_BUTTON) radiogroup.set(GENFAT_BUTTON) gentype = 'fat' while 1: n = Dlg.ModalDialog(None) if n == OK_BUTTON or n == CANCEL_BUTTON: break elif radiogroup.hasitem(n): radiogroup.set(n) genitem = radiogroup.get() del radiogroup del d if genitem == GENFAT_BUTTON: gentype = 'fat' elif genitem == GENPPC_BUTTON: gentype = 'pwpc' elif genitem == GEN68K_BUTTON: gentype = 'm68k' return gentype, n == OK_BUTTON | 0c15eb35e9d3cc8cdce3d3a8397c55b0414e1201 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c15eb35e9d3cc8cdce3d3a8397c55b0414e1201/BuildApplication.py |
>>> def f(): | >>> def f(): | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
... SyntaxError: 'return' with argument inside generator (<string>, line 2) >>> def f(): | .. SyntaxError: 'return' with argument inside generator (..., line 2) >>> def f(): | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
... SyntaxError: 'return' with argument inside generator (<string>, line 3) | .. SyntaxError: 'return' with argument inside generator (..., line 3) | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
>>> def f(): | >>> def f(): | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
... SyntaxError: 'return' with argument inside generator (<string>, line 3) | .. SyntaxError: 'return' with argument inside generator (..., line 3) | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
>>> def f(): | >>> def f(): | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
... SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause (<string>, line 3) >>> def f(): | .. SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause (..., line 3) >>> def f(): | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause (<string>, line 6) | SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause (..., line 6) | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
>>> def f(): | >>> def f(): | >>> def f(): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
SyntaxError: 'return' with argument inside generator (<string>, line 8) | SyntaxError: 'return' with argument inside generator (..., line 8) | ... def f(i): | a4ffd17c5f876b866146a28676698ce02f3d43bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4ffd17c5f876b866146a28676698ce02f3d43bc/test_generators.py |
'gopher://gopher.lib.ncsu.edu/11/library/stacks/Alex', 'gopher://gopher.vt.edu:10010/10/33', | 'gopher://gopher.lib.ncsu.edu./11/library/stacks/Alex', 'gopher://gopher.vt.edu.:10010/10/33', | def test_gopher(self): import warnings warnings.filterwarnings("ignore", "the gopherlib module is deprecated", DeprecationWarning, "urllib2$") urls = [ # Thanks to Fred for finding these! 'gopher://gopher.lib.ncsu.edu/11/library/stacks/Alex', 'gopher://gopher.vt.edu:10010/10/33', ] self._test_urls(urls, self._extra_handlers()) | 0633c3792b01834e7615d678c36a3afee5954a01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0633c3792b01834e7615d678c36a3afee5954a01/test_urllib2net.py |
self.assert_(isinstance(err, expected_err)) | msg = ("Didn't get expected error(s) %s for %s %s, got %s" % (expected_err, url, req, err)) self.assert_(isinstance(err, expected_err), msg) | def _test_urls(self, urls, handlers): import socket import time import logging debug = logging.getLogger("test_urllib2").debug | 0633c3792b01834e7615d678c36a3afee5954a01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0633c3792b01834e7615d678c36a3afee5954a01/test_urllib2net.py |
def _extra_handlers(self): handlers = [] | 0633c3792b01834e7615d678c36a3afee5954a01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0633c3792b01834e7615d678c36a3afee5954a01/test_urllib2net.py |
||
import sys | def whichmodule(cls, clsname): """Figure out the module in which a class occurs. Search sys.modules for the module. Cache in classmap. Return a module name. If the class cannot be found, return __main__. """ if classmap.has_key(cls): return classmap[cls] import sys for name, module in sys.modules.items(): if name != '__main__' and \ hasattr(module, clsname) and \ getattr(module, clsname) is cls: break else: name = '__main__' classmap[cls] = name return name | 9d4cecb0c19004e64c0355a7d455ec3bbc1458c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d4cecb0c19004e64c0355a7d455ec3bbc1458c6/pickle.py |
|
value = apply(klass, args) | try: value = apply(klass, args) except TypeError, err: raise TypeError, "in constructor for %s: %s" % ( klass.__name__, str(err)), sys.exc_info()[2] | def load_inst(self): k = self.marker() args = tuple(self.stack[k+1:]) del self.stack[k:] module = self.readline()[:-1] name = self.readline()[:-1] klass = self.find_class(module, name) instantiated = 0 if (not args and type(klass) is ClassType and not hasattr(klass, "__getinitargs__")): try: value = _EmptyClass() value.__class__ = klass instantiated = 1 except RuntimeError: # In restricted execution, assignment to inst.__class__ is # prohibited pass if not instantiated: value = apply(klass, args) self.append(value) | 9d4cecb0c19004e64c0355a7d455ec3bbc1458c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d4cecb0c19004e64c0355a7d455ec3bbc1458c6/pickle.py |
socket = _socketobject | socket = SocketType = _socketobject | _s = ("def %s(self, *args): return self._sock.%s(*args)\n\n" "%s.__doc__ = _realsocket.%s.__doc__\n") | dab3510ce0819b9b4f95fe45b7f75f4a406b7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dab3510ce0819b9b4f95fe45b7f75f4a406b7ed7/socket.py |
ef = codecs.EncodedFile(f, 'utf-16', 'utf-8') self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae') | ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8') self.assertEquals(ef.read(), '\\\xd5\n\x00\x00\xae') | def test_basic(self): f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80') ef = codecs.EncodedFile(f, 'utf-16', 'utf-8') self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae') | 2861df3cc62e70f3549c70dc0c8907612e022552 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2861df3cc62e70f3549c70dc0c8907612e022552/test_codecs.py |
def subn(self, repl, source, count=0): """subn(repl, string[, count=0]) -> tuple | fa75ec60c8d9887028fa05bec6da4b2286f8b324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa75ec60c8d9887028fa05bec6da4b2286f8b324/pre.py |
||
except error: | except (error, TypeError): | def subn(self, repl, source, count=0): """subn(repl, string[, count=0]) -> tuple | fa75ec60c8d9887028fa05bec6da4b2286f8b324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa75ec60c8d9887028fa05bec6da4b2286f8b324/pre.py |
want = int((have - 1) / self.indentwidth) * self.indentwidth | want = ((have - 1) // self.indentwidth) * self.indentwidth | def smart_backspace_event(self, event): text = self.text first, last = self.editwin.get_selection_indices() if first and last: text.delete(first, last) text.mark_set("insert", first) return "break" # Delete whitespace left, until hitting a real char or closest # preceding virtual tab stop. chars = text.get("insert linestart", "insert") if chars == '': if text.compare("insert", ">", "1.0"): # easy: delete preceding newline text.delete("insert-1c") else: text.bell() # at start of buffer return "break" if chars[-1] not in " \t": # easy: delete preceding real char text.delete("insert-1c") return "break" # Ick. It may require *inserting* spaces if we back up over a # tab character! This is written to be clear, not fast. expand, tabwidth = string.expandtabs, self.tabwidth have = len(expand(chars, tabwidth)) assert have > 0 want = int((have - 1) / self.indentwidth) * self.indentwidth ncharsdeleted = 0 while 1: chars = chars[:-1] ncharsdeleted = ncharsdeleted + 1 have = len(expand(chars, tabwidth)) if have <= want or chars[-1] not in " \t": break text.undo_block_start() text.delete("insert-%dc" % ncharsdeleted, "insert") if have < want: text.insert("insert", ' ' * (want - have)) text.undo_block_stop() return "break" | 8d3b3c83e2dc135fd2bf7b8da0012e7e860f911e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8d3b3c83e2dc135fd2bf7b8da0012e7e860f911e/AutoIndent.py |
effective = (int(effective / tabwidth) + 1) * tabwidth | effective = (effective // tabwidth + 1) * tabwidth | def classifyws(s, tabwidth): raw = effective = 0 for ch in s: if ch == ' ': raw = raw + 1 effective = effective + 1 elif ch == '\t': raw = raw + 1 effective = (int(effective / tabwidth) + 1) * tabwidth else: break return raw, effective | 8d3b3c83e2dc135fd2bf7b8da0012e7e860f911e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8d3b3c83e2dc135fd2bf7b8da0012e7e860f911e/AutoIndent.py |
self.preffilepath = ":Python:PythonIDE preferences" | self.preffilepath = os.path.join("Python", "PythonIDE preferences") | def __init__(self): self.preffilepath = ":Python:PythonIDE preferences" Wapplication.Application.__init__(self, 'Pide') from Carbon import AE from Carbon import AppleEvents AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEReopenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEPrintDocuments, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenDocuments, self.opendocsevent) AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEQuitApplication, self.quitevent) import PyConsole, PyEdit Splash.wait() # With -D option (OSX command line only) keep stderr, for debugging the IDE # itself. debug_stderr = None if len(sys.argv) >= 2 and sys.argv[1] == '-D': debug_stderr = sys.stderr del sys.argv[1] PyConsole.installoutput() PyConsole.installconsole() if debug_stderr: sys.stderr = debug_stderr for path in sys.argv[1:]: self.opendoc(path) try: import Wthreading except ImportError: self.mainloop() else: if Wthreading.haveThreading: self.mainthread = Wthreading.Thread("IDE event loop", self.mainloop) self.mainthread.start() #self.mainthread.setResistant(1) Wthreading.run() else: self.mainloop() | 6fde78a0f4986d26e079a86df3b0324f561f8f1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6fde78a0f4986d26e079a86df3b0324f561f8f1b/PythonIDEMain.py |
exclude=0, single=0, randomize=0): | exclude=0, single=0, randomize=0, leakdebug=0): | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other six default arguments (verbose, quiet, generate, exclude, single, and randomize) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsr') except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: if not quiet: print "test", test, print "skipped -- an optional feature could not be imported" skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | 218cb4fa9eb9d864a9beaa743e1d66c10dd7192c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/218cb4fa9eb9d864a9beaa743e1d66c10dd7192c/regrtest.py |
The other six default arguments (verbose, quiet, generate, exclude, single, and randomize) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. | The other seven default arguments (verbose, quiet, generate, exclude, single, randomize, and leakdebug) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other six default arguments (verbose, quiet, generate, exclude, single, and randomize) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsr') except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: if not quiet: print "test", test, print "skipped -- an optional feature could not be imported" skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | 218cb4fa9eb9d864a9beaa743e1d66c10dd7192c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/218cb4fa9eb9d864a9beaa743e1d66c10dd7192c/regrtest.py |
opts, args = getopt.getopt(sys.argv[1:], 'vgqxsr') | opts, args = getopt.getopt(sys.argv[1:], 'vgqxsrl') | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other six default arguments (verbose, quiet, generate, exclude, single, and randomize) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsr') except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: if not quiet: print "test", test, print "skipped -- an optional feature could not be imported" skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | 218cb4fa9eb9d864a9beaa743e1d66c10dd7192c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/218cb4fa9eb9d864a9beaa743e1d66c10dd7192c/regrtest.py |
if a_uri: | if a_uri == xmlns_uri: if a_localname == 'xmlns': qname = a_localname else: qname = 'xmlns:' + a_localname attr = self.document.createAttributeNS(a_uri, qname) node.setAttributeNodeNS(attr) elif a_uri: | def startElementNS(self, name, tagName , attrs): uri, localname = name if uri: # When using namespaces, the reader may or may not # provide us with the original name. If not, create # *a* valid tagName from the current context. if tagName is None: prefix = self._current_context[uri] if prefix: tagName = prefix + ":" + localname else: tagName = localname if self.document: node = self.document.createElementNS(uri, tagName) else: node = self.buildDocument(uri, tagName) else: # When the tagname is not prefixed, it just appears as # localname if self.document: node = self.document.createElement(localname) else: node = self.buildDocument(None, localname) | b6782635f74ed95893328b75dced67be9d60592e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b6782635f74ed95893328b75dced67be9d60592e/pulldom.py |
UpdateEditIdle = "UpdateEditIDLE" | UpdateEditIDLE = "UpdateEditIDLE" | def add_ui(db): x = y = 50 w = 370 h = 300 title = "[ProductName] Setup" # see "Dialog Style Bits" modal = 3 # visible | modal modeless = 1 # visible track_disk_space = 32 add_data(db, 'ActionText', uisample.ActionText) add_data(db, 'UIText', uisample.UIText) # Bitmaps if not os.path.exists(srcdir+r"\PC\python_icon.exe"): raise "Run icons.mak in PC directory" add_data(db, "Binary", [("PythonWin", msilib.Binary(srcdir+r"\PCbuild\installer.bmp")), # 152x328 pixels ("py.ico",msilib.Binary(srcdir+r"\PC\py.ico")), ]) add_data(db, "Icon", [("python_icon.exe", msilib.Binary(srcdir+r"\PC\python_icon.exe"))]) # Scripts # CheckDir sets TargetExists if TARGETDIR exists. # UpdateEditIDLE sets the REGISTRY.tcl component into # the installed/uninstalled state according to both the # Extensions and TclTk features. if os.system("nmake /nologo /c /f msisupport.mak") != 0: raise "'nmake /f msisupport.mak' failed" add_data(db, "Binary", [("Script", msilib.Binary("msisupport.dll"))]) # See "Custom Action Type 1" if msilib.Win64: CheckDir = "CheckDir" UpdateEditIdle = "UpdateEditIDLE" else: CheckDir = "_CheckDir@4" UpdateEditIDLE = "_UpdateEditIDLE@4" add_data(db, "CustomAction", [("CheckDir", 1, "Script", CheckDir)]) if have_tcl: add_data(db, "CustomAction", [("UpdateEditIDLE", 1, "Script", UpdateEditIDLE)]) # UI customization properties add_data(db, "Property", # See "DefaultUIFont Property" [("DefaultUIFont", "DlgFont8"), # See "ErrorDialog Style Bit" ("ErrorDialog", "ErrorDlg"), ("Progress1", "Install"), # modified in maintenance type dlg ("Progress2", "installs"), ("MaintenanceForm_Action", "Repair")]) # Fonts, see "TextStyle Table" add_data(db, "TextStyle", [("DlgFont8", "Tahoma", 9, None, 0), ("DlgFontBold8", "Tahoma", 8, None, 1), #bold ("VerdanaBold10", "Verdana", 10, None, 1), ("VerdanaRed9", "Verdana", 9, 255, 0), ]) compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x badsyntax [TARGETDIR]Lib" # See "CustomAction Table" add_data(db, "CustomAction", [ # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty # See "Custom Action Type 51", # "Custom Action Execution Scheduling Options" ("InitialTargetDir", 307, "TARGETDIR", "[WindowsVolume]Python%s%s" % (major, minor)), ("SetDLLDirToTarget", 307, "DLLDIR", "[TARGETDIR]"), ("SetDLLDirToSystem32", 307, "DLLDIR", SystemFolderName), # msidbCustomActionTypeExe + msidbCustomActionTypeSourceFile # See "Custom Action Type 18" ("CompilePyc", 18, "python.exe", compileargs), ("CompilePyo", 18, "python.exe", "-O "+compileargs), ]) # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table" # Numbers indicate sequence; see sequence.py for how these action integrate add_data(db, "InstallUISequence", [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140), ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141), ("InitialTargetDir", 'TARGETDIR=""', 750), # In the user interface, assume all-users installation if privileged. ("SetDLLDirToSystem32", 'DLLDIR="" and ' + sys32cond, 751), ("SetDLLDirToTarget", 'DLLDIR="" and not ' + sys32cond, 752), ("SelectDirectoryDlg", "Not Installed", 1230), # XXX no support for resume installations yet #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240), ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250), ("ProgressDlg", None, 1280)]) add_data(db, "AdminUISequence", [("InitialTargetDir", 'TARGETDIR=""', 750), ("SetDLLDirToTarget", 'DLLDIR=""', 751), ]) # Execute Sequences add_data(db, "InstallExecuteSequence", [("InitialTargetDir", 'TARGETDIR=""', 750), ("SetDLLDirToSystem32", 'DLLDIR="" and ' + sys32cond, 751), ("SetDLLDirToTarget", 'DLLDIR="" and not ' + sys32cond, 752), ("UpdateEditIDLE", None, 1050), ("CompilePyc", "COMPILEALL", 6800), ("CompilePyo", "COMPILEALL", 6801), ]) add_data(db, "AdminExecuteSequence", [("InitialTargetDir", 'TARGETDIR=""', 750), ("SetDLLDirToTarget", 'DLLDIR=""', 751), ("CompilePyc", "COMPILEALL", 6800), ("CompilePyo", "COMPILEALL", 6801), ]) ##################################################################### # Standard dialogs: FatalError, UserExit, ExitDialog fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title, "Finish", "Finish", "Finish") fatal.title("[ProductName] Installer ended prematurely") fatal.back("< Back", "Finish", active = 0) fatal.cancel("Cancel", "Back", active = 0) fatal.text("Description1", 135, 70, 220, 80, 0x30003, "[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.") fatal.text("Description2", 135, 155, 220, 20, 0x30003, "Click the Finish button to exit the Installer.") c=fatal.next("Finish", "Cancel", name="Finish") # See "ControlEvent Table". Parameters are the event, the parameter # to the action, and optionally the condition for the event, and the order # of events. c.event("EndDialog", "Exit") user_exit=PyDialog(db, "UserExit", x, y, w, h, modal, title, "Finish", "Finish", "Finish") user_exit.title("[ProductName] Installer was interrupted") user_exit.back("< Back", "Finish", active = 0) user_exit.cancel("Cancel", "Back", active = 0) user_exit.text("Description1", 135, 70, 220, 80, 0x30003, "[ProductName] setup was interrupted. Your system has not been modified. " "To install this program at a later time, please run the installation again.") user_exit.text("Description2", 135, 155, 220, 20, 0x30003, "Click the Finish button to exit the Installer.") c = user_exit.next("Finish", "Cancel", name="Finish") c.event("EndDialog", "Exit") exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title, "Finish", "Finish", "Finish") exit_dialog.title("Completing the [ProductName] Installer") exit_dialog.back("< Back", "Finish", active = 0) exit_dialog.cancel("Cancel", "Back", active = 0) exit_dialog.text("Acknowledgements", 135, 95, 220, 120, 0x30003, "Special Windows thanks to:\n" " LettError, Erik van Blokland, for the \n" " Python for Windows graphic.\n" " http://www.letterror.com/\n" "\n" " Mark Hammond, without whose years of freely \n" " shared Windows expertise, Python for Windows \n" " would still be Python for DOS.") exit_dialog.text("Description", 135, 235, 220, 20, 0x30003, "Click the Finish button to exit the Installer.") c = exit_dialog.next("Finish", "Cancel", name="Finish") c.event("EndDialog", "Return") ##################################################################### # Required dialog: FilesInUse, ErrorDlg inuse = PyDialog(db, "FilesInUse", x, y, w, h, 19, # KeepModeless|Modal|Visible title, "Retry", "Retry", "Retry", bitmap=False) inuse.text("Title", 15, 6, 200, 15, 0x30003, r"{\DlgFontBold8}Files in Use") inuse.text("Description", 20, 23, 280, 20, 0x30003, "Some files that need to be updated are currently in use.") inuse.text("Text", 20, 55, 330, 50, 3, "The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.") inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess", None, None, None) c=inuse.back("Exit", "Ignore", name="Exit") c.event("EndDialog", "Exit") c=inuse.next("Ignore", "Retry", name="Ignore") c.event("EndDialog", "Ignore") c=inuse.cancel("Retry", "Exit", name="Retry") c.event("EndDialog","Retry") # See "Error Dialog". See "ICE20" for the required names of the controls. error = Dialog(db, "ErrorDlg", 50, 10, 330, 101, 65543, # Error|Minimize|Modal|Visible title, "ErrorText", None, None) error.text("ErrorText", 50,9,280,48,3, "") error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "py.ico", None, None) error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo") error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes") error.pushbutton("A",0,72,81,21,3,"Abort",None).event("EndDialog","ErrorAbort") error.pushbutton("C",42,72,81,21,3,"Cancel",None).event("EndDialog","ErrorCancel") error.pushbutton("I",81,72,81,21,3,"Ignore",None).event("EndDialog","ErrorIgnore") error.pushbutton("O",159,72,81,21,3,"Ok",None).event("EndDialog","ErrorOk") error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry") ##################################################################### # Global "Query Cancel" dialog cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title, "No", "No", "No") cancel.text("Text", 48, 15, 194, 30, 3, "Are you sure you want to cancel [ProductName] installation?") cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None, "py.ico", None, None) c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No") c.event("EndDialog", "Exit") c=cancel.pushbutton("No", 132, 57, 56, 17, 3, "No", "Yes") c.event("EndDialog", "Return") ##################################################################### # Global "Wait for costing" dialog costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title, "Return", "Return", "Return") costing.text("Text", 48, 15, 194, 30, 3, "Please wait while the installer finishes determining your disk space requirements.") costing.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None, "py.ico", None, None) c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None) c.event("EndDialog", "Exit") ##################################################################### # Preparation dialog: no user input except cancellation prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title, "Cancel", "Cancel", "Cancel") prep.text("Description", 135, 70, 220, 40, 0x30003, "Please wait while the Installer prepares to guide you through the installation.") prep.title("Welcome to the [ProductName] Installer") c=prep.text("ActionText", 135, 110, 220, 20, 0x30003, "Pondering...") c.mapping("ActionText", "Text") c=prep.text("ActionData", 135, 135, 220, 30, 0x30003, None) c.mapping("ActionData", "Text") prep.back("Back", None, active=0) prep.next("Next", None, active=0) c=prep.cancel("Cancel", None) c.event("SpawnDialog", "CancelDlg") ##################################################################### # Target directory selection seldlg = PyDialog(db, "SelectDirectoryDlg", x, y, w, h, modal, title, "Next", "Next", "Cancel") seldlg.title("Select Destination Directory") c = seldlg.text("Existing", 135, 25, 235, 30, 0x30003, "{\VerdanaRed9}This update will replace your existing [ProductLine] installation.") c.condition("Hide", 'REMOVEOLDVERSION="" and REMOVEOLDSNAPSHOT=""') seldlg.text("Description", 135, 50, 220, 40, 0x30003, "Please select a directory for the [ProductName] files.") seldlg.back("< Back", None, active=0) c = seldlg.next("Next >", "Cancel") c.event("DoAction", "CheckDir", "TargetExistsOk<>1", order=1) # If the target exists, but we found that we are going to remove old versions, don't bother # confirming that the target directory exists. Strictly speaking, we should determine that # the target directory is indeed the target of the product that we are going to remove, but # I don't know how to do that. c.event("SpawnDialog", "ExistingDirectoryDlg", 'TargetExists=1 and REMOVEOLDVERSION="" and REMOVEOLDSNAPSHOT=""', 2) c.event("SetTargetPath", "TARGETDIR", 'TargetExists=0 or REMOVEOLDVERSION<>"" or REMOVEOLDSNAPSHOT<>""', 3) c.event("SpawnWaitDialog", "WaitForCostingDlg", "CostingComplete=1", 4) c.event("NewDialog", "SelectFeaturesDlg", 'TargetExists=0 or REMOVEOLDVERSION<>"" or REMOVEOLDSNAPSHOT<>""', 5) c = seldlg.cancel("Cancel", "DirectoryCombo") c.event("SpawnDialog", "CancelDlg") seldlg.control("DirectoryCombo", "DirectoryCombo", 135, 70, 172, 80, 393219, "TARGETDIR", None, "DirectoryList", None) seldlg.control("DirectoryList", "DirectoryList", 135, 90, 208, 136, 3, "TARGETDIR", None, "PathEdit", None) seldlg.control("PathEdit", "PathEdit", 135, 230, 206, 16, 3, "TARGETDIR", None, "Next", None) c = seldlg.pushbutton("Up", 306, 70, 18, 18, 3, "Up", None) c.event("DirectoryListUp", "0") c = seldlg.pushbutton("NewDir", 324, 70, 30, 18, 3, "New", None) c.event("DirectoryListNew", "0") ##################################################################### # SelectFeaturesDlg features = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal|track_disk_space, title, "Tree", "Next", "Cancel") features.title("Customize [ProductName]") features.text("Description", 135, 35, 220, 15, 0x30003, "Select the way you want features to be installed.") features.text("Text", 135,45,220,30, 3, "Click on the icons in the tree below to change the way features will be installed.") c=features.back("< Back", "Next") c.event("NewDialog", "SelectDirectoryDlg") c=features.next("Next >", "Cancel") c.mapping("SelectionNoItems", "Enabled") c.event("SpawnDialog", "DiskCostDlg", "OutOfDiskSpace=1", order=1) c.event("EndDialog", "Return", "OutOfDiskSpace<>1", order=2) c=features.cancel("Cancel", "Tree") c.event("SpawnDialog", "CancelDlg") # The browse property is not used, since we have only a single target path (selected already) features.control("Tree", "SelectionTree", 135, 75, 220, 95, 7, "_BrowseProperty", "Tree of selections", "Back", None) #c=features.pushbutton("Reset", 42, 243, 56, 17, 3, "Reset", "DiskCost") #c.mapping("SelectionNoItems", "Enabled") #c.event("Reset", "0") features.control("Box", "GroupBox", 135, 170, 225, 90, 1, None, None, None, None) c=features.xbutton("DiskCost", "Disk &Usage", None, 0.10) c.mapping("SelectionNoItems","Enabled") c.event("SpawnDialog", "DiskCostDlg") c=features.xbutton("Advanced", "Advanced", None, 0.30) c.event("SpawnDialog", "AdvancedDlg") c=features.text("ItemDescription", 140, 180, 210, 30, 3, "Multiline description of the currently selected item.") c.mapping("SelectionDescription","Text") c=features.text("ItemSize", 140, 210, 210, 45, 3, "The size of the currently selected item.") c.mapping("SelectionSize", "Text") ##################################################################### # Disk cost cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title, "OK", "OK", "OK", bitmap=False) cost.text("Title", 15, 6, 200, 15, 0x30003, "{\DlgFontBold8}Disk Space Requirements") cost.text("Description", 20, 20, 280, 20, 0x30003, "The disk space required for the installation of the selected features.") cost.text("Text", 20, 53, 330, 60, 3, "The highlighted volumes (if any) do not have enough disk space " "available for the currently selected features. You can either " "remove some files from the highlighted volumes, or choose to " "install less features onto local drive(s), or select different " "destination drive(s).") cost.control("VolumeList", "VolumeCostList", 20, 100, 330, 150, 393223, None, "{120}{70}{70}{70}{70}", None, None) cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return") ##################################################################### # WhichUsers Dialog. Only available on NT, and for privileged users. # This must be run before FindRelatedProducts, because that will # take into account whether the previous installation was per-user # or per-machine. We currently don't support going back to this # dialog after "Next" was selected; to support this, we would need to # find how to reset the ALLUSERS property, and how to re-run # FindRelatedProducts. # On Windows9x, the ALLUSERS property is ignored on the command line # and in the Property table, but installer fails according to the documentation # if a dialog attempts to set ALLUSERS. whichusers = PyDialog(db, "WhichUsersDlg", x, y, w, h, modal, title, "AdminInstall", "Next", "Cancel") whichusers.title("Select whether to install [ProductName] for all users of this computer.") # A radio group with two options: allusers, justme g = whichusers.radiogroup("AdminInstall", 135, 60, 160, 50, 3, "WhichUsers", "", "Next") g.add("ALL", 0, 5, 150, 20, "Install for all users") g.add("JUSTME", 0, 25, 150, 20, "Install just for me") whichusers.back("Back", None, active=0) c = whichusers.next("Next >", "Cancel") c.event("[ALLUSERS]", "1", 'WhichUsers="ALL"', 1) c.event("EndDialog", "Return", order = 2) c = whichusers.cancel("Cancel", "AdminInstall") c.event("SpawnDialog", "CancelDlg") ##################################################################### # Advanced Dialog. advanced = PyDialog(db, "AdvancedDlg", x, y, w, h, modal, title, "CompilePyc", "Next", "Cancel") advanced.title("Advanced Options for [ProductName]") # A radio group with two options: allusers, justme advanced.checkbox("CompilePyc", 135, 60, 230, 50, 3, "COMPILEALL", "Compile .py files to byte code after installation", "Next") c = advanced.next("Finish", "Cancel") c.event("EndDialog", "Return") c = advanced.cancel("Cancel", "CompilePyc") c.event("SpawnDialog", "CancelDlg") ##################################################################### # Existing Directory dialog dlg = Dialog(db, "ExistingDirectoryDlg", 50, 30, 200, 80, modal, title, "No", "No", "No") dlg.text("Title", 10, 20, 180, 40, 3, "[TARGETDIR] exists. Are you sure you want to overwrite existing files?") c=dlg.pushbutton("Yes", 30, 60, 55, 17, 3, "Yes", "No") c.event("[TargetExists]", "0", order=1) c.event("[TargetExistsOk]", "1", order=2) c.event("EndDialog", "Return", order=3) c=dlg.pushbutton("No", 115, 60, 55, 17, 3, "No", "Yes") c.event("EndDialog", "Return") ##################################################################### # Installation Progress dialog (modeless) progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title, "Cancel", "Cancel", "Cancel", bitmap=False) progress.text("Title", 20, 15, 200, 15, 0x30003, "{\DlgFontBold8}[Progress1] [ProductName]") progress.text("Text", 35, 65, 300, 30, 3, "Please wait while the Installer [Progress2] [ProductName]. " "This may take several minutes.") progress.text("StatusLabel", 35, 100, 35, 20, 3, "Status:") c=progress.text("ActionText", 70, 100, w-70, 20, 3, "Pondering...") c.mapping("ActionText", "Text") #c=progress.text("ActionData", 35, 140, 300, 20, 3, None) #c.mapping("ActionData", "Text") c=progress.control("ProgressBar", "ProgressBar", 35, 120, 300, 10, 65537, None, "Progress done", None, None) c.mapping("SetProgress", "Progress") progress.back("< Back", "Next", active=False) progress.next("Next >", "Cancel", active=False) progress.cancel("Cancel", "Back").event("SpawnDialog", "CancelDlg") # Maintenance type: repair/uninstall maint = PyDialog(db, "MaintenanceTypeDlg", x, y, w, h, modal, title, "Next", "Next", "Cancel") maint.title("Welcome to the [ProductName] Setup Wizard") maint.text("BodyText", 135, 63, 230, 42, 3, "Select whether you want to repair or remove [ProductName].") g=maint.radiogroup("RepairRadioGroup", 135, 108, 230, 60, 3, "MaintenanceForm_Action", "", "Next") g.add("Change", 0, 0, 200, 17, "&Change [ProductName]") g.add("Repair", 0, 18, 200, 17, "&Repair [ProductName]") g.add("Remove", 0, 36, 200, 17, "Re&move [ProductName]") maint.back("< Back", None, active=False) c=maint.next("Finish", "Cancel") # Change installation: Change progress dialog to "Change", then ask # for feature selection c.event("[Progress1]", "Change", 'MaintenanceForm_Action="Change"', 1) c.event("[Progress2]", "changes", 'MaintenanceForm_Action="Change"', 2) # Reinstall: Change progress dialog to "Repair", then invoke reinstall # Also set list of reinstalled features to "ALL" c.event("[REINSTALL]", "ALL", 'MaintenanceForm_Action="Repair"', 5) c.event("[Progress1]", "Repairing", 'MaintenanceForm_Action="Repair"', 6) c.event("[Progress2]", "repairs", 'MaintenanceForm_Action="Repair"', 7) c.event("Reinstall", "ALL", 'MaintenanceForm_Action="Repair"', 8) # Uninstall: Change progress to "Remove", then invoke uninstall # Also set list of removed features to "ALL" c.event("[REMOVE]", "ALL", 'MaintenanceForm_Action="Remove"', 11) c.event("[Progress1]", "Removing", 'MaintenanceForm_Action="Remove"', 12) c.event("[Progress2]", "removes", 'MaintenanceForm_Action="Remove"', 13) c.event("Remove", "ALL", 'MaintenanceForm_Action="Remove"', 14) # Close dialog when maintenance action scheduled c.event("EndDialog", "Return", 'MaintenanceForm_Action<>"Change"', 20) c.event("NewDialog", "SelectFeaturesDlg", 'MaintenanceForm_Action="Change"', 21) maint.cancel("Cancel", "RepairRadioGroup").event("SpawnDialog", "CancelDlg") | 1a1812dadf239ee2e9e47ba532051c60660c47ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a1812dadf239ee2e9e47ba532051c60660c47ad/msi.py |
self._policy._now = self._now = int(time.time()) cookies = self._cookies_for_request(request) attrs = self._cookie_attrs(cookies) if attrs: if not request.has_header("Cookie"): request.add_unredirected_header( "Cookie", "; ".join(attrs)) if (self._policy.rfc2965 and not self._policy.hide_cookie2 and not request.has_header("Cookie2")): for cookie in cookies: if cookie.version != 1: request.add_unredirected_header("Cookie2", '$Version="1"') break self._cookies_lock.release() | try: self._policy._now = self._now = int(time.time()) cookies = self._cookies_for_request(request) attrs = self._cookie_attrs(cookies) if attrs: if not request.has_header("Cookie"): request.add_unredirected_header( "Cookie", "; ".join(attrs)) if (self._policy.rfc2965 and not self._policy.hide_cookie2 and not request.has_header("Cookie2")): for cookie in cookies: if cookie.version != 1: request.add_unredirected_header("Cookie2", '$Version="1"') break finally: self._cookies_lock.release() | def add_cookie_header(self, request): """Add correct Cookie: header to request (urllib2.Request object). | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py |
self._policy._now = self._now = int(time.time()) if self._policy.set_ok(cookie, request): self.set_cookie(cookie) self._cookies_lock.release() | try: self._policy._now = self._now = int(time.time()) if self._policy.set_ok(cookie, request): self.set_cookie(cookie) finally: self._cookies_lock.release() | def set_cookie_if_ok(self, cookie, request): """Set a cookie if policy says it's OK to do so.""" self._cookies_lock.acquire() self._policy._now = self._now = int(time.time()) | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py |
self._policy._now = self._now = int(time.time()) for cookie in self.make_cookies(response, request): if self._policy.set_ok(cookie, request): _debug(" setting cookie: %s", cookie) self.set_cookie(cookie) self._cookies_lock.release() | try: self._policy._now = self._now = int(time.time()) for cookie in self.make_cookies(response, request): if self._policy.set_ok(cookie, request): _debug(" setting cookie: %s", cookie) self.set_cookie(cookie) finally: self._cookies_lock.release() | def extract_cookies(self, response, request): """Extract cookies from response, where allowable given the request.""" _debug("extract_cookies: %s", response.info()) self._cookies_lock.acquire() self._policy._now = self._now = int(time.time()) | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py |
for cookie in self: if cookie.discard: self.clear(cookie.domain, cookie.path, cookie.name) self._cookies_lock.release() | try: for cookie in self: if cookie.discard: self.clear(cookie.domain, cookie.path, cookie.name) finally: self._cookies_lock.release() | def clear_session_cookies(self): """Discard all session cookies. | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py |
now = time.time() for cookie in self: if cookie.is_expired(now): self.clear(cookie.domain, cookie.path, cookie.name) self._cookies_lock.release() | try: now = time.time() for cookie in self: if cookie.is_expired(now): self.clear(cookie.domain, cookie.path, cookie.name) finally: self._cookies_lock.release() | def clear_expired_cookies(self): """Discard all expired cookies. | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py |
old_state = copy.deepcopy(self._cookies) self._cookies = {} | def revert(self, filename=None, ignore_discard=False, ignore_expires=False): """Clear all cookies and reload cookies from a saved file. | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py |
|
self.load(filename, ignore_discard, ignore_expires) except (LoadError, IOError): self._cookies = old_state raise self._cookies_lock.release() | old_state = copy.deepcopy(self._cookies) self._cookies = {} try: self.load(filename, ignore_discard, ignore_expires) except (LoadError, IOError): self._cookies = old_state raise finally: self._cookies_lock.release() | def revert(self, filename=None, ignore_discard=False, ignore_expires=False): """Clear all cookies and reload cookies from a saved file. | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py |
self._note("%s.acquire(%s): initial succes", self, blocking) | self._note("%s.acquire(%s): initial success", self, blocking) | def acquire(self, blocking=1): me = currentThread() if self.__owner is me: self.__count = self.__count + 1 if __debug__: self._note("%s.acquire(%s): recursive success", self, blocking) return 1 rc = self.__block.acquire(blocking) if rc: self.__owner = me self.__count = 1 if __debug__: self._note("%s.acquire(%s): initial succes", self, blocking) else: if __debug__: self._note("%s.acquire(%s): failure", self, blocking) return rc | 52e4f8db6f8c0e887cf7ee33f6c825594fba73b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/52e4f8db6f8c0e887cf7ee33f6c825594fba73b5/threading.py |
def __init__(self, filename, etype, evalue): | def __init__(self, filename, (type, value, tb)): | def __init__(self, filename, etype, evalue): self.filename = filename self.etype = etype self.evalue = evalue if type(etype) is types.ClassType: etype = etype.__name__ self.args = '%s: %s' % (etype, evalue) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
self.etype = etype self.evalue = evalue if type(etype) is types.ClassType: etype = etype.__name__ self.args = '%s: %s' % (etype, evalue) | self.type = type self.value = value self.tb = tb def __str__(self): t = self.type if type(t) is types.ClassType: t = t.__name__ return 'problem in %s - %s: %s' % (self.filename, t, self.value) | def __init__(self, filename, etype, evalue): self.filename = filename self.etype = etype self.evalue = evalue if type(etype) is types.ClassType: etype = etype.__name__ self.args = '%s: %s' % (etype, evalue) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
raise DocImportError(path, sys.exc_type, sys.exc_value) | raise DocImportError(path, sys.exc_info()) | def importfile(path): """Import a Python source file or compiled file given its path.""" magic = imp.get_magic() file = open(path, 'r') if file.read(len(magic)) == magic: kind = imp.PY_COMPILED else: kind = imp.PY_SOURCE file.close() filename = os.path.basename(path) name, ext = os.path.splitext(filename) file = open(path, 'r') try: module = imp.load_module(name, file, path, (ext, 'r', kind)) except: raise DocImportError(path, sys.exc_type, sys.exc_value) file.close() return module | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
init = os.path.join(path, '__init__.py') initc = os.path.join(path, '__init__.pyc') if os.path.isfile(init) or os.path.isfile(initc): return 1 | for ext in ['.py', '.pyc', '.pyo']: if os.path.isfile(os.path.join(path, '__init__' + ext)): return 1 | def ispackage(path): """Guess whether a path refers to a package directory.""" if os.path.isdir(path): init = os.path.join(path, '__init__.py') initc = os.path.join(path, '__init__.pyc') if os.path.isfile(init) or os.path.isfile(initc): return 1 | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
def document(self, object, *args): | def document(self, object, name=None, *args): | def document(self, object, *args): """Generate documentation for an object.""" args = (object,) + args if inspect.ismodule(object): return apply(self.docmodule, args) if inspect.isclass(object): return apply(self.docclass, args) if inspect.isroutine(object): return apply(self.docroutine, args) raise TypeError, "don't know how to document objects of type " + \ type(object).__name__ | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
args = (object,) + args | args = (object, name) + args | def document(self, object, *args): """Generate documentation for an object.""" args = (object,) + args if inspect.ismodule(object): return apply(self.docmodule, args) if inspect.isclass(object): return apply(self.docclass, args) if inspect.isroutine(object): return apply(self.docroutine, args) raise TypeError, "don't know how to document objects of type " + \ type(object).__name__ | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
raise TypeError, "don't know how to document objects of type " + \ type(object).__name__ | return apply(self.docother, args) def fail(self, object, name=None, *args): """Raise an exception for unimplemented types.""" message = "don't know how to document object%s of type %s" % ( name and ' ' + repr(name), type(object).__name__) raise TypeError, message docmodule = docclass = docroutine = docother = fail | def document(self, object, *args): """Generate documentation for an object.""" args = (object,) + args if inspect.ismodule(object): return apply(self.docmodule, args) if inspect.isclass(object): return apply(self.docclass, args) if inspect.isroutine(object): return apply(self.docroutine, args) raise TypeError, "don't know how to document objects of type " + \ type(object).__name__ | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
self.maxstring = self.maxother = 50 | self.maxstring = self.maxother = 100 | def __init__(self): Repr.__init__(self) self.maxlist = self.maxtuple = self.maxdict = 10 self.maxstring = self.maxother = 50 | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
result = Repr.repr(self, object) return result | return Repr.repr(self, object) | def repr(self, object): result = Repr.repr(self, object) return result | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
return cram(stripid(repr(x)), self.maxstring) | return self.escape(cram(stripid(repr(x)), self.maxstring)) | def repr_instance(self, x, level): try: return cram(stripid(repr(x)), self.maxstring) except: return self.escape('<%s instance>' % x.__class__.__name__) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
def multicolumn(self, list, format, cols=4): """Format a list of items into a multi-column list.""" result = '' rows = (len(list)+cols-1)/cols | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
||
def heading(self, title, fgcol, bgcol, extras=''): """Format a page heading.""" return """ <p><table width="100%%" cellspacing=0 cellpadding=0 border=0> <tr bgcolor="%s"><td> </td> <td valign=bottom><small><small><br></small></small ><font color="%s" face="helvetica"><br> %s</font></td ><td align=right valign=bottom ><font color="%s" face="helvetica">%s</font></td><td> </td></tr></table> """ % (bgcol, fgcol, title, fgcol, extras or ' ') def section(self, title, fgcol, bgcol, contents, width=20, prelude='', marginalia=None, gap=' '): """Format a section with a heading.""" if marginalia is None: marginalia = ' ' * width result = """ <p><table width="100%%" cellspacing=0 cellpadding=0 border=0> <tr bgcolor="%s"><td rowspan=2> </td> <td colspan=3 valign=bottom><small><small><br></small></small ><font color="%s" face="helvetica, arial"> %s</font></td></tr> """ % (bgcol, fgcol, title) if prelude: result = result + """ <tr><td bgcolor="%s">%s</td> <td bgcolor="%s" colspan=2>%s</td></tr> """ % (bgcol, marginalia, bgcol, prelude) result = result + """ <tr><td bgcolor="%s">%s</td><td>%s</td> """ % (bgcol, marginalia, gap) result = result + '<td width="100%%">%s</td></tr></table>' % contents return result def bigsection(self, title, *args): """Format a section with a big heading.""" title = '<big><strong>%s</strong></big>' % title return apply(self.section, (title,) + args) | def small(self, text): return '<small>%s</small>' % text def grey(self, text): return '<font color=" | def heading(self, title, fgcol, bgcol, extras=''): """Format a page heading.""" return """ | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
return '<font color=" | return self.grey(name) | def modpkglink(self, (name, path, ispackage, shadowed)): """Make a link for a module or package to display in an index.""" if shadowed: return '<font color="#909090">%s</font>' % name if path: url = '%s.%s.html' % (path, name) else: url = '%s.html' % name if ispackage: text = '<strong>%s</strong> (package)' % name else: text = name return '<a href="%s">%s</a>' % (url, text) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
def doctree(self, tree, modname, classes={}, parent=None): | def formattree(self, tree, modname, classes={}, parent=None): | def doctree(self, tree, modname, classes={}, parent=None): """Produce HTML for a class tree as given by inspect.getclasstree().""" result = '' for entry in tree: if type(entry) is type(()): c, bases = entry result = result + '<dt><font face="helvetica, arial"><small>' result = result + self.classlink(c, modname, classes) if bases and bases != (parent,): parents = [] for base in bases: parents.append(self.classlink(base, modname, classes)) result = result + '(' + join(parents, ', ') + ')' result = result + '\n</small></font></dt>' elif type(entry) is type([]): result = result + \ '<dd>\n%s</dd>\n' % self.doctree(entry, modname, classes, c) return '<dl>\n%s</dl>\n' % result | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
result = result + \ '<dd>\n%s</dd>\n' % self.doctree(entry, modname, classes, c) | result = result + '<dd>\n%s</dd>\n' % self.formattree( entry, modname, classes, c) | def doctree(self, tree, modname, classes={}, parent=None): """Produce HTML for a class tree as given by inspect.getclasstree().""" result = '' for entry in tree: if type(entry) is type(()): c, bases = entry result = result + '<dt><font face="helvetica, arial"><small>' result = result + self.classlink(c, modname, classes) if bases and bases != (parent,): parents = [] for base in bases: parents.append(self.classlink(base, modname, classes)) result = result + '(' + join(parents, ', ') + ')' result = result + '\n</small></font></dt>' elif type(entry) is type([]): result = result + \ '<dd>\n%s</dd>\n' % self.doctree(entry, modname, classes, c) return '<dl>\n%s</dl>\n' % result | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
def docmodule(self, object): | def docmodule(self, object, name=None): | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
name = object.__name__ | name = object.__name__ | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
second = lambda list: list[1] modules = map(second, inspect.getmembers(object, inspect.ismodule)) | modules = inspect.getmembers(object, inspect.ismodule) if 0 and hasattr(object, '__all__'): visible = lambda key, all=object.__all__: key in all else: visible = lambda key: key[:1] != '_' | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
if (inspect.getmodule(value) or object) is object: classes.append(value) | if visible(key) and ( inspect.getmodule(value) or object) is object: classes.append((key, value)) | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
if inspect.isbuiltin(value) or inspect.getmodule(value) is object: funcs.append(value) | if visible(key) and (inspect.isbuiltin(value) or inspect.getmodule(value) is object): funcs.append((key, value)) | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
for c in classes: for base in c.__bases__: key, modname = base.__name__, base.__module__ if modname != name and sys.modules.has_key(modname): module = sys.modules[modname] if hasattr(module, key) and getattr(module, key) is base: if not cdict.has_key(key): cdict[key] = cdict[base] = modname + '.html | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.