bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def getnextframedata(self, ds, cs): if self.atframeheader: raise CallError if ds: data = self.fp.read(ds) if len(data) < ds: raise EOFError else: data = '' if cs: cdata = self.fp.read(cs) if len(cdata) < cs: raise EOFerror else: cdata = '' self.atframeheader = 1 self.framecount = self.framecount + 1 return (data, cdata...
def getnextframedata(self, ds, cs): if self.atframeheader: raise CallError if ds: data = self.fp.read(ds) if len(data) < ds: self.eofseen = 1 raise EOFError else: data = '' if cs: cdata = self.fp.read(cs) if len(cdata) < cs: raise EOFerror else: cdata = '' self.atframeheader = 1 self.framecount = self.framecount + 1 re...
18,100
def getnextframedata(self, ds, cs): if self.atframeheader: raise CallError if ds: data = self.fp.read(ds) if len(data) < ds: raise EOFError else: data = '' if cs: cdata = self.fp.read(cs) if len(cdata) < cs: raise EOFerror else: cdata = '' self.atframeheader = 1 self.framecount = self.framecount + 1 return (data, cdata...
def getnextframedata(self, ds, cs): if self.atframeheader: raise CallError if ds: data = self.fp.read(ds) if len(data) < ds: raise EOFError else: data = '' if cs: cdata = self.fp.read(cs) if len(cdata) < cs: self.eofseen = 1 raise EOFError else: cdata = '' self.atframeheader = 1 self.framecount = self.framecount + 1 re...
18,101
def initfp(self, fp, filename): self = VideoParams.init(self) self.fp = fp self.filename = filename self.version = 3.0 # In case anyone inquires self.headerwritten = 0 return self
def initfp(self, fp, filename): self = VideoParams.init(self) self.fp = fp self.filename = filename self.version = 3.0 # In case anyone inquires self.headerwritten = 0 return self
18,102
def writeframeheader(self, t, ds, cs): if not self.headerwritten: self.writeheader() if not self.atheader: raise CallError self.fp.write(`(t, ds, cs)` + '\n') self.atheader = 0
def writeframeheader(self, t, ds, cs): if not self.headerwritten: self.writeheader() if not self.atheader: raise CallError data = `(t, ds, cs)` n = len(data) if n < 63: data = data + ' '*(63-n) self.fp.write(data + '\n') self.atheader = 0
18,103
def writeframedata(self, data, cdata): if not self.headerwritten or self.atheader: raise CallError if data: self.fp.write(data) if cdata: self.fp.write(cdata) self.atheader = 1 self.framecount = self.framecount + 1
def writeframedata(self, data, cdata): if not self.headerwritten or self.atheader: raise CallError if data: self.fp.write(data) if cdata: self.fp.write(cdata) self.atheader = 1 self.framecount = self.framecount + 1
18,104
def initfp(self, fp, filename): self = Displayer.init(self) return BasicVinFile.initfp(self, fp, filename)
def initfp(self, fp, filename): self = Displayer.init(self) return BasicVinFile.initfp(self, fp, filename)
18,105
def __init__(self, switchboard, master=None): self.__sb = switchboard self.__frame = Frame(master, relief=RAISED, borderwidth=1) self.__frame.grid(row=3, column=0, ipadx=5) # create the chip that will display the currently selected color # exactly self.__sframe = Frame(self.__frame) self.__sframe.grid(row=0, column=0) ...
def __init__(self, switchboard, master=None): self.__sb = switchboard self.__frame = Frame(master, relief=RAISED, borderwidth=1) self.__frame.grid(row=3, column=0, ipadx=5, sticky='NSEW') # create the chip that will display the currently selected color # exactly self.__sframe = Frame(self.__frame) self.__sframe.grid(ro...
18,106
def missing_ok(str): try: getattr(socket, str) except AttributeError: pass
def missing_ok(str): try: getattr(socket, str) except AttributeError: pass
18,107
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(scrip...
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(scrip...
18,108
def run (self):
def run (self):
18,109
def run (self):
def run (self):
18,110
def adjust(self, oldbounds): self.SetPort() # Appearance frames are drawn outside the specified bounds, # so we always need to outset the invalidated area. self.GetWindow().InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3)) self.GetWindow().InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3))
def adjust(self, oldbounds): self.SetPort() # Appearance frames are drawn outside the specified bounds, # so we always need to outset the invalidated area. self.GetWindow().InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3)) self.GetWindow().InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3))
18,111
def listDefDraw(self, selected, cellRect, theCell, dataOffset, dataLen, theList): savedPort = Qd.GetPort() Qd.SetPort(theList.GetListPort()) savedClip = Qd.NewRgn() Qd.GetClip(savedClip) Qd.ClipRect(cellRect) savedPenState = Qd.GetPenState() Qd.PenNormal() Qd.EraseRect(cellRect) #draw the cell if it contains data asce...
def listDefDraw(self, selected, cellRect, theCell, dataOffset, dataLen, theList): savedPort = Qd.GetPort() Qd.SetPort(theList.GetListPort()) savedClip = Qd.NewRgn() Qd.GetClip(savedClip) Qd.ClipRect(cellRect) savedPenState = Qd.GetPenState() Qd.PenNormal() Qd.EraseRect(cellRect) #draw the cell if it contains data asce...
18,112
def listDefDraw(self, selected, cellRect, theCell, dataOffset, dataLen, theList): savedPort = Qd.GetPort() Qd.SetPort(theList.GetListPort()) savedClip = Qd.NewRgn() Qd.GetClip(savedClip) Qd.ClipRect(cellRect) savedPenState = Qd.GetPenState() Qd.PenNormal() Qd.EraseRect(cellRect) #draw the cell if it contains data asce...
def listDefDraw(self, selected, cellRect, theCell, dataOffset, dataLen, theList): savedPort = Qd.GetPort() Qd.SetPort(theList.GetListPort()) savedClip = Qd.NewRgn() Qd.GetClip(savedClip) Qd.ClipRect(cellRect) savedPenState = Qd.GetPenState() Qd.PenNormal() Qd.EraseRect(cellRect) #draw the cell if it contains data asce...
18,113
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
18,114
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
18,115
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
18,116
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
18,117
def _note(self, format, *args): if self.__verbose: format = format % args format = "%s: %s\n" % ( currentThread().getName(), format) _sys.stderr.write(format)
def _note(self, format, *args): if self.__verbose: format = format % args format = "%s: %s\n" % ( currentThread().getName(), format) _sys.stderr.write(format)
18,118
def com_dictsetmaker(self, nodelist): # dictsetmaker: (test ':' test (',' test ':' value)* [',']) | (test (',' test)* [',']) items = [] if nodelist[2] != ':': # it's a set for i in range(1, len(nodelist), 2): items.append(self.com_node(nodelist[i])) return Set(items, lineno=items[0].lineno) else: # it's a dict for i in...
def com_dictsetmaker(self, nodelist): # dictsetmaker: (test ':' test (',' test ':' value)* [',']) | (test (',' test)* [',']) items = [] if len(nodelist) == 1 or nodelist[1] != ':': # it's a set for i in range(1, len(nodelist), 2): items.append(self.com_node(nodelist[i])) return Set(items, lineno=items[0].lineno) else: ...
18,119
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
18,120
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
18,121
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
18,122
def addsitedir(sitedir): sitedir, sitedircase = makepath(sitedir) if not dirs_in_sys_path.has_key(sitedircase): sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: return names.sort() for name in names: if name[-4:] == endsep + "pth": addpackage(sitedir, name)
def addsitedir(sitedir): sitedir, sitedircase = makepath(sitedir) if not _dirs_in_sys_path.has_key(sitedircase): sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: return names.sort() for name in names: if name[-4:] == endsep + "pth": addpackage(sitedir, name)
18,123
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dir...
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not _di...
18,124
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dir...
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dir...
18,125
def writefile(self, filename): self.fixlastline() try: f = open(filename, "w") chars = self.text.get("1.0", "end-1c") f.write(chars) f.close() ## print "saved to", `filename` return True except IOError, msg: tkMessageBox.showerror("I/O Error", str(msg), master=self.text) return False
def writefile(self, filename): self.fixlastline() try: f = open(filename, "w") f.write(chars) f.close() ## print "saved to", `filename` return True except IOError, msg: tkMessageBox.showerror("I/O Error", str(msg), master=self.text) return False
18,126
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
18,127
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
18,128
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
18,129
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
18,130
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
18,131
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
18,132
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
def expect(got_this, expect_this): if test_support.verbose: print '%r =?= %r ...' % (got_this, expect_this), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %r, but expected %r' %\ (got_this, expect_this) else: if test_support.verbose: print 'yes'
18,133
def addpackers(self): self.packer = MountPacker().init() self.unpacker = MountUnpacker().init('')
def addpackers(self): self.packer = MountPacker().init() self.unpacker = MountUnpacker().init('')
18,134
def mkcred(self, proc): if proc not in (1, 3, 4): # not Mnt/Unmnt/Unmntall return rpc.AUTH_NULL, '' if self.cred == None: self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default() return self.cred
def mkcred(self, proc): if proc not in (1, 3, 4): # not Mnt/Unmnt/Unmntall return rpc.AUTH_NULL, '' if self.cred == None: self.cred = rpc.AUTH_UNIX, rpc.make_auth_unix_default() return self.cred
18,135
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command)
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command)
18,136
def lower(self, belowthis=None): self.canvas.lower(self.id, belowthis)
def lower(self, belowthis=None): self.canvas.lower(self.id, belowthis)
18,137
def tkraise(self, abovethis=None): self.canvas.tkraise(self.id, abovethis)
def tkraise(self, abovethis=None): self.canvas.tkraise(self.id, abovethis)
18,138
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command)
def bind(self, sequence=None, command=None): return self.canvas.tag_bind(self.id, sequence, command)
18,139
def lower(self, belowThis=None): self._do('lower', belowThis)
def lower(self, belowThis=None): self._do('lower', belowThis)
18,140
def tkraise(self, aboveThis=None): self._do('raise', aboveThis)
def tkraise(self, aboveThis=None): self._do('raise', aboveThis)
18,141
def error(self, exception):
def error(self, exception):
18,142
def fatalError(self, exception):
def fatalError(self, exception):
18,143
def warning(self, exception):
def warning(self, exception):
18,144
def testWriteXML(): str = '<?xml version="1.0" ?>\n<a b="c"/>' dom = parseString(str) domstr = dom.toxml() dom.unlink() confirm(str == domstr)
def testWriteXML(): str = '<?xml version="1.0" ?><a b="c"/>' dom = parseString(str) domstr = dom.toxml() dom.unlink() confirm(str == domstr)
18,145
def testEncodings(): doc = parseString('<foo>&#x20ac;</foo>') confirm(doc.toxml() == u'<?xml version="1.0" ?>\n<foo>\u20ac</foo>' and doc.toxml('utf-8') == '<?xml version="1.0" encoding="utf-8"?>\n<foo>\xe2\x82\xac</foo>' and doc.toxml('iso-8859-15') == '<?xml version="1.0" encoding="iso-8859-15"?>\n<foo>\xa4</foo>', "...
def testEncodings(): doc = parseString('<foo>&#x20ac;</foo>') confirm(doc.toxml() == u'<?xml version="1.0" ?><foo>\u20ac</foo>' and doc.toxml('utf-8') == '<?xml version="1.0" encoding="utf-8"?><foo>\xe2\x82\xac</foo>' and doc.toxml('iso-8859-15') == '<?xml version="1.0" encoding="iso-8859-15"?><foo>\xa4</foo>', "testEn...
18,146
def NodeList(): return []
def NodeList(): return []
18,147
def getElementsByTagName(self, name): return _getElementsByTagNameHelper(self, name, [])
def getElementsByTagName(self, name): return _getElementsByTagNameHelper(self, name, [])
18,148
def getElementsByTagNameNS(self, namespaceURI, localName): return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
def getElementsByTagNameNS(self, namespaceURI, localName): return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
18,149
def getElementsByTagName(self, name): return _getElementsByTagNameHelper(self, name, [])
def getElementsByTagName(self, name): return _getElementsByTagNameHelper(self, name, [])
18,150
def getElementsByTagNameNS(self, namespaceURI, localName): return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
def getElementsByTagNameNS(self, namespaceURI, localName): return _getElementsByTagNameNSHelper(self, namespaceURI, localName, [])
18,151
def testConnectTimeout(self): # Test connect() timeout _timeout = 0.001 self.sock.settimeout(_timeout)
def testConnectTimeout(self): # Test connect() timeout _timeout = 0.001 self.sock.settimeout(_timeout)
18,152
def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None, continuation_ws=' '): """Create a MIME-compliant header that can contain many character sets.
def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None, continuation_ws=' ', errors='strict'): """Create a MIME-compliant header that can contain many character sets.
18,153
def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None, continuation_ws=' '): """Create a MIME-compliant header that can contain many character sets.
def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None, continuation_ws=' '): """Create a MIME-compliant header that can contain many character sets.
18,154
def append(self, s, charset=None): """Append a string to the MIME header.
def append(self, s, charset=None, errors='strict'): """Append a string to the MIME header.
18,155
def append(self, s, charset=None): """Append a string to the MIME header.
def append(self, s, charset=None): """Append a string to the MIME header.
18,156
def append(self, s, charset=None): """Append a string to the MIME header.
def append(self, s, charset=None): """Append a string to the MIME header.
18,157
def append(self, s, charset=None): """Append a string to the MIME header.
def append(self, s, charset=None): """Append a string to the MIME header.
18,158
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,159
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,160
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,161
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,162
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,163
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,164
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,165
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,166
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,167
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
18,168
def stat(path): """Stat a file, possibly out of the cache.""" if cache.has_key(path): return cache[path] cache[path] = ret = os.stat(path) return ret
def stat(path): """Stat a file, possibly out of the cache.""" ret = cache.get(path, None) if ret is None: cache[path] = ret = _os.stat(path) return ret
18,169
def reset(): """Reset the cache completely.""" global cache cache = {}
def reset(): """Reset the cache completely.""" global cache cache = {}
18,170
def forget(path): """Remove a given item from the cache, if it exists.""" if cache.has_key(path): del cache[path]
def forget(path): """Remove a given item from the cache, if it exists.""" try: del cache[path]
18,171
def forget(path): """Remove a given item from the cache, if it exists.""" if cache.has_key(path): del cache[path]
defexcept KeyError: pass forget(path):except KeyError: pass """Removeexcept KeyError: pass aexcept KeyError: pass givenexcept KeyError: pass itemexcept KeyError: pass fromexcept KeyError: pass theexcept KeyError: pass cache,except KeyError: pass ifexcept KeyError: pass itexcept KeyError: pass exists."""except KeyError:...
18,172
def forget_prefix(prefix): """Remove all pathnames with a given prefix.""" n = len(prefix) for path in cache.keys(): if path[:n] == prefix: del cache[path]
def forget_prefix(prefix): """Remove all pathnames with a given prefix.""" for path in cache.keys(): if path[:n] == prefix: del cache[path]
18,173
def forget_prefix(prefix): """Remove all pathnames with a given prefix.""" n = len(prefix) for path in cache.keys(): if path[:n] == prefix: del cache[path]
def forget_prefix(prefix): """Remove all pathnames with a given prefix.""" n = len(prefix) for path in cache.keys(): if path.startswith(prefix): forget(path)
18,174
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:...
def forget_dir(prefix): """Forget a directory and all entries except for entries in subdirs.""" from os.path import split, join prefix = split(join(prefix, "xxx"))[0] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:] if res...
18,175
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:...
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:] if rest[-1:] == '/': rest = rest[:-1] if '/' not in rest: d...
18,176
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path[:n] == prefix: rest = path[n:...
def forget_dir(prefix): """Forget about a directory and all entries in it, but not about entries in subdirectories.""" if prefix[-1:] == '/' and prefix != '/': prefix = prefix[:-1] forget(prefix) if prefix[-1:] != '/': prefix = prefix + '/' n = len(prefix) for path in cache.keys(): if path.startswith(prefix) and spli...
18,177
def forget_except_prefix(prefix): """Remove all pathnames except with a given prefix. Normally used with prefix = '/' after a chdir().""" n = len(prefix) for path in cache.keys(): if path[:n] != prefix: del cache[path]
def forget_except_prefix(prefix): """Remove all pathnames except with a given prefix. Normally used with prefix = '/' after a chdir(). """ for path in cache.keys(): if path[:n] != prefix: del cache[path]
18,178
def forget_except_prefix(prefix): """Remove all pathnames except with a given prefix. Normally used with prefix = '/' after a chdir().""" n = len(prefix) for path in cache.keys(): if path[:n] != prefix: del cache[path]
def forget_except_prefix(prefix): """Remove all pathnames except with a given prefix. Normally used with prefix = '/' after a chdir().""" n = len(prefix) for path in cache.keys(): if not path.startswith(prefix): forget(path)
18,179
def handle(self): """Handle a single HTTP request.
def handle(self): """Handle a single HTTP request.
18,180
def is_pure (self): return (self.has_pure_modules() and not self.has_ext_modules() and not self.has_c_libraries())
def is_pure (self): return (self.has_pure_modules() and not self.has_ext_modules() and not self.has_c_libraries())
18,181
def help_dialog(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') textView.TextViewer(self.top,'Help',fn)
def help_dialog(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') textView.TextViewer(self.top,'Help',fn)
18,182
def help_dialog(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') textView.TextViewer(self.top,'Help',fn)
def help_dialog(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') textView.TextViewer(self.top,'Help',fn)
18,183
def save(self, object, pers_save = 0): memo = self.memo
def save(self, object, pers_save = 0): memo = self.memo
18,184
def poll(self): if not self.async: raise error, 'Can only call poll() in async mode' if not self.busy_cmd: return if self.testready(): if self.cb: apply(self.cb, self.cb_arg)
def poll(self): if not self.async: raise error, 'Can only call poll() in async mode' if not self.busy_cmd: return if self.testready(): if self.cb: apply(self.cb, self.cb_arg)
18,185
def __init__ (self, indent_increment=2, max_help_position=24, width=80, short_first=1): HelpFormatter.__init__( self, indent_increment, max_help_position, width, short_first)
def __init__ (self, indent_increment=2, max_help_position=24, width=79, short_first=1): HelpFormatter.__init__( self, indent_increment, max_help_position, width, short_first)
18,186
def __init__ (self, indent_increment=0, max_help_position=24, width=80, short_first=0): HelpFormatter.__init__ ( self, indent_increment, max_help_position, width, short_first)
def __init__ (self, indent_increment=0, max_help_position=24, width=79, short_first=0): HelpFormatter.__init__ ( self, indent_increment, max_help_position, width, short_first)
18,187
def win32_ver(release='',version='',csd='',ptype=''): """ Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level and OS type (multi/single processor). As a hint: ptype returns 'Uniprocessor Free' on single processor NT machines and 'M...
def win32_ver(release='',version='',csd='',ptype=''): """ Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level and OS type (multi/single processor). As a hint: ptype returns 'Uniprocessor Free' on single processor NT machines and 'M...
18,188
def test_closure(func, closure, exc): try: new.function(func.func_code, {}, "", None, closure) except exc: pass else: print "corrupt closure accepted"
def test_closure(func, closure, exc): try: new.function(func.func_code, {}, "", None, closure) except exc: pass else: print "corrupt closure accepted"
18,189
def test_closure(func, closure, exc): try: new.function(func.func_code, {}, "", None, closure) except exc: pass else: print "corrupt closure accepted"
def test_closure(func, closure, exc): try: new.function(func.func_code, {}, "", None, closure) except exc: pass else: print "corrupt closure accepted"
18,190
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ...
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ...
18,191
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ...
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ...
18,192
def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracketfind.match(rawdata, i+1) if end is None: return -1 tag = starttagmatch.match(rawdata, i) if tag is None or tag.end(0) != end.end(0): self.syntax_error('garbage in starttag') return end.end(0) nstag = tagname = tag.group('tagn...
def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracketfind.match(rawdata, i+1) if end is None: return -1 tag = starttagmatch.match(rawdata, i) if tag is None or tag.end(0) != end.end(0): self.syntax_error('garbage in starttag') return end.end(0) nstag = tagname = tag.group('tagn...
18,193
def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracketfind.match(rawdata, i+1) if end is None: return -1 tag = starttagmatch.match(rawdata, i) if tag is None or tag.end(0) != end.end(0): self.syntax_error('garbage in starttag') return end.end(0) nstag = tagname = tag.group('tagn...
def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracketfind.match(rawdata, i+1) if end is None: return -1 tag = starttagmatch.match(rawdata, i) if tag is None or tag.end(0) != end.end(0): self.syntax_error('garbage in starttag') return end.end(0) nstag = tagname = tag.group('tagn...
18,194
def save_int(self, object, pack=struct.pack): if self.bin: # If the int is small enough to fit in a signed 4-byte 2's-comp # format, we can store it more efficiently than the general # case. # First one- and two-byte unsigned ints: if object >= 0: if object <= 0xff: self.write(BININT1 + chr(object)) return if object <=...
def save_int(self, object, pack=struct.pack): if self.bin: # If the int is small enough to fit in a signed 4-byte 2's-comp # format, we can store it more efficiently than the general # case. # First one- and two-byte unsigned ints: if object >= 0: if object <= 0xff: self.write(BININT1 + chr(object)) return if object <=...
18,195
def reset(self): self.__buf = ''
def reset(self): self.__buf = ''
18,196
def get_buffer(self): return self.__buf
def get_buffer(self): return self.__buf
18,197
def pack_uint(self, x): self.__buf = self.__buf + struct.pack('>L', x)
def pack_uint(self, x): self.__buf = self.__buf + struct.pack('>L', x)
18,198
def pack_bool(self, x): if x: self.__buf = self.__buf + '\0\0\0\1' else: self.__buf = self.__buf + '\0\0\0\0'
def pack_bool(self, x): if x: self.__buf = self.__buf + '\0\0\0\1' else: self.__buf = self.__buf + '\0\0\0\0'
18,199