rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if ok:
if fss:
def interact(options, title): """Let the user interact with the dialog""" try: # Try to go to the "correct" dir for GetDirectory os.chdir(options['dir'].as_pathname()) except os.error: pass d = GetNewDialog(DIALOG_ID, -1) htext = d.GetDialogItemAsControl(TITLE_ITEM) SetDialogItemText(htext, title) path_ctl = d.GetDialo...
4ba5f3d9042c7fe625c3ab94de13fc814606a4e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4ba5f3d9042c7fe625c3ab94de13fc814606a4e5/EditPythonPrefs.py
print >>sys.stderr, name, "exists:", os.path.exists(name)
def expect(got_this, expect_this): if test_support.verbose: print '%s =?= %s ...' % (`got_this`, `expect_this`), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %s, but expected %s' %\ (str(got_this), str(expect_this)) else: if test_support.verbose: print 'yes'
77a47db3968c843b6eed8bcf4b8f39d9c3d0a99d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/77a47db3968c843b6eed8bcf4b8f39d9c3d0a99d/test_largefile.py
try: path = win32api.GetFullPathName(path) except win32api.error: pass
if path: try: path = win32api.GetFullPathName(path) except win32api.error: pass else: path = os.getcwd()
def _abspath(path): if not isabs(path): path = join(os.getcwd(), path) return normpath(path)
5f5c2ee76076660a5b2cc97ff7cbef7240361ef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5f5c2ee76076660a5b2cc97ff7cbef7240361ef6/ntpath.py
if string.find(string.lower(name), 'xml') >= 0:
if string.lower(name) == 'xml':
def parse_proc(self, i): rawdata = self.rawdata end = procclose.search(rawdata, i) if end is None: return -1 j = end.start(0) if illegal.search(rawdata, i+2, j): self.syntax_error('illegal character in processing instruction') res = tagfind.match(rawdata, i+2) if res is None: raise RuntimeError, 'unexpected call to par...
876033a7e833e1df74fca7c9cc91b9a0541c127c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/876033a7e833e1df74fca7c9cc91b9a0541c127c/xmllib.py
assert re.sub('(?P<a>x)', '\g<a>\g<a>', 'xx') == 'xxxx'
assert re.sub('(?P<unk>x)', '\g<unk>\g<unk>', 'xx') == 'xxxx'
def bump_num(matchobj):
f8143768ade1ae498008a46491e2c6b5cca8d457 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8143768ade1ae498008a46491e2c6b5cca8d457/test_re.py
m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each)
m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?',each)
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ self.esmtp_features = {} self.putcmd("ehlo", name or self.local_hostname) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MTA's will disconnect on an ehlo. Toss an exc...
f64fb3766ea1bf2a3dd8a0f98b7a689336201509 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f64fb3766ea1bf2a3dd8a0f98b7a689336201509/smtplib.py
if ext in self.swig_ext():
if ext == ".i":
def swig_sources (self, sources):
017df766f2a9bcf9a57d1bb1efeeadc60dbc6cb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/017df766f2a9bcf9a57d1bb1efeeadc60dbc6cb8/build_ext.py
swig_files.append(source)
swig_sources.append(source)
def swig_sources (self, sources):
017df766f2a9bcf9a57d1bb1efeeadc60dbc6cb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/017df766f2a9bcf9a57d1bb1efeeadc60dbc6cb8/build_ext.py
if not swig_files:
if not swig_sources:
def swig_sources (self, sources):
017df766f2a9bcf9a57d1bb1efeeadc60dbc6cb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/017df766f2a9bcf9a57d1bb1efeeadc60dbc6cb8/build_ext.py
d = dict(items={})
d = dict({})
def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic...
d65fb152f1cb970df809fba08a4132871bd4aace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d65fb152f1cb970df809fba08a4132871bd4aace/test_descr.py
vereq(d, dict(items=d.iteritems()))
vereq(d, dict(d.iteritems())) d = dict({'one':1, 'two':2}) vereq(d, dict(one=1, two=2)) vereq(d, dict(**d)) vereq(d, dict({"one": 1}, two=2)) vereq(d, dict([("two", 2)], one=1)) vereq(d, dict([("one", 100), ("two", 200)], **d)) verify(d is not dict(**d))
def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic...
d65fb152f1cb970df809fba08a4132871bd4aace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d65fb152f1cb970df809fba08a4132871bd4aace/test_descr.py
try: dict(senseless={}) except TypeError: pass else: raise TestFailed("no TypeError from dict(senseless={})")
def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic...
d65fb152f1cb970df809fba08a4132871bd4aace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d65fb152f1cb970df809fba08a4132871bd4aace/test_descr.py
d = dict(items=Mapping())
d = dict(Mapping())
def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic...
d65fb152f1cb970df809fba08a4132871bd4aace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d65fb152f1cb970df809fba08a4132871bd4aace/test_descr.py
vereq(dict(items={1: 2}), {1: 2})
def keywords(): if verbose: print "Testing keyword args to basic type constructors ..." vereq(int(x=1), 1) vereq(float(x=2), 2.0) vereq(long(x=3), 3L) vereq(complex(imag=42, real=666), complex(666, 42)) vereq(str(object=500), '500') vereq(unicode(string='abc', errors='strict'), u'abc') vereq(tuple(sequence=range(3)), (...
d65fb152f1cb970df809fba08a4132871bd4aace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d65fb152f1cb970df809fba08a4132871bd4aace/test_descr.py
tuple, list, dict, file):
tuple, list, file):
def keywords(): if verbose: print "Testing keyword args to basic type constructors ..." vereq(int(x=1), 1) vereq(float(x=2), 2.0) vereq(long(x=3), 3L) vereq(complex(imag=42, real=666), complex(666, 42)) vereq(str(object=500), '500') vereq(unicode(string='abc', errors='strict'), u'abc') vereq(tuple(sequence=range(3)), (...
d65fb152f1cb970df809fba08a4132871bd4aace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d65fb152f1cb970df809fba08a4132871bd4aace/test_descr.py
if type(url) == Types.StringType:
if type(url) == types.StringType:
def checkonly(package, url, version, verbose=0): if verbose >= VERBOSE_EACHFILE: print '%s:'%package if type(url) == Types.StringType: ok, newversion, fp = _check1version(package, url, version, verbose) else: for u in url: ok, newversion, fp = _check1version(package, u, version, verbose) if ok >= 0 and verbose < VERBOS...
9ab54adfc5cb606b879d563127c9eafdeff9f31f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9ab54adfc5cb606b879d563127c9eafdeff9f31f/pyversioncheck.py
def _test():
def test_main():
def _test(): threads = [] print "Creating" for i in range(NUM_THREADS): t = TempFileGreedy() threads.append(t) t.start() print "Starting" startEvent.set() print "Reaping" ok = errors = 0 for t in threads: t.join() ok += t.ok_count errors += t.error_count if t.error_count: print '%s errors:\n%s' % (t.getName(), t.err...
3788417f1e46b7852ac48fee5c5fb9216c27eced /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3788417f1e46b7852ac48fee5c5fb9216c27eced/test_threadedtempfile.py
_test()
test_main()
def _test(): threads = [] print "Creating" for i in range(NUM_THREADS): t = TempFileGreedy() threads.append(t) t.start() print "Starting" startEvent.set() print "Reaping" ok = errors = 0 for t in threads: t.join() ok += t.ok_count errors += t.error_count if t.error_count: print '%s errors:\n%s' % (t.getName(), t.err...
3788417f1e46b7852ac48fee5c5fb9216c27eced /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3788417f1e46b7852ac48fee5c5fb9216c27eced/test_threadedtempfile.py
def handle(self): """Handle a single HTTP request. You normally don't need to override this method; see the class __doc__ string for information on how to handle specific HTTP commands such as GET and POST. """ self.raw_requestline = self.rfile.readline()
def parse_request(self): """Parse a request (internal). The request should be stored in self.raw_request; the results are in self.command, self.path, self.request_version and self.headers. Return value is 1 for success, 0 for failure; on failure, an error is sent back. """
def handle(self): """Handle a single HTTP request.
3dc5ebef964a116acb492860df90e1165b19cd39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3dc5ebef964a116acb492860df90e1165b19cd39/BaseHTTPServer.py
return
return 0
def handle(self): """Handle a single HTTP request.
3dc5ebef964a116acb492860df90e1165b19cd39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3dc5ebef964a116acb492860df90e1165b19cd39/BaseHTTPServer.py
return
return 0
def handle(self): """Handle a single HTTP request.
3dc5ebef964a116acb492860df90e1165b19cd39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3dc5ebef964a116acb492860df90e1165b19cd39/BaseHTTPServer.py
return
return 0
def handle(self): """Handle a single HTTP request.
3dc5ebef964a116acb492860df90e1165b19cd39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3dc5ebef964a116acb492860df90e1165b19cd39/BaseHTTPServer.py
mname = 'do_' + command
return 1 def handle(self): """Handle a single HTTP request. You normally don't need to override this method; see the class __doc__ string for information on how to handle specific HTTP commands such as GET and POST. """ self.raw_requestline = self.rfile.readline() if not self.parse_request(): return mname = 'do_' +...
def handle(self): """Handle a single HTTP request.
3dc5ebef964a116acb492860df90e1165b19cd39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3dc5ebef964a116acb492860df90e1165b19cd39/BaseHTTPServer.py
self.send_error(501, "Unsupported method (%s)" % `command`)
self.send_error(501, "Unsupported method (%s)" % `self.command`)
def handle(self): """Handle a single HTTP request.
3dc5ebef964a116acb492860df90e1165b19cd39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3dc5ebef964a116acb492860df90e1165b19cd39/BaseHTTPServer.py
upp_dispose_handler = NewWENewObjectProc(my_dispose_handler); upp_draw_handler = NewWENewObjectProc(my_draw_handler); upp_click_handler = NewWENewObjectProc(my_click_handler);
upp_dispose_handler = NewWEDisposeObjectProc(my_dispose_handler); upp_draw_handler = NewWEDrawObjectProc(my_draw_handler); upp_click_handler = NewWEClickObjectProc(my_click_handler);
def outputCheckNewArg(self): Output("""if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }""")
1c6c4b0f06a94c5c2a0bfcbf1f61f563c590c3fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1c6c4b0f06a94c5c2a0bfcbf1f61f563c590c3fd/wastesupport.py
if ( selector == weNewHandler ) handler = upp_new_handler; else if ( selector == weDisposeHandler ) handler = upp_dispose_handler; else if ( selector == weDrawHandler ) handler = upp_draw_handler; else if ( selector == weClickHandler ) handler = upp_click_handler;
if ( selector == weNewHandler ) handler = (UniversalProcPtr)upp_new_handler; else if ( selector == weDisposeHandler ) handler = (UniversalProcPtr)upp_dispose_handler; else if ( selector == weDrawHandler ) handler = (UniversalProcPtr)upp_draw_handler; else if ( selector == weClickHandler ) handler = (UniversalProcPtr)up...
def outputCheckNewArg(self): Output("""if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }""")
1c6c4b0f06a94c5c2a0bfcbf1f61f563c590c3fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1c6c4b0f06a94c5c2a0bfcbf1f61f563c590c3fd/wastesupport.py
def makefile(self, mode):
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket. This method offers only partial support for the makefile interface of a real socket. It only supports modes 'r' and 'rb' and the bufsize argument is ignored. The returned object contains *all* of the file data """
def makefile(self, mode): # hopefully, never have to write if mode != 'r' and mode != 'rb': raise UnimplementedFileMode()
a809ab51a1f0830bd85a8c4bda919585b9e6ec27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a809ab51a1f0830bd85a8c4bda919585b9e6ec27/httplib.py
opt_name = string.translate(opt_name, longopt_xlate) val = getattr(self, opt_name)
if self.negative_opt.has_key(opt_name): opt_name = string.translate(self.negative_opt[opt_name], longopt_xlate) val = not getattr(self, opt_name) else: opt_name = string.translate(opt_name, longopt_xlate) val = getattr(self, opt_name)
def dump_dirs (self, msg): if DEBUG: from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate(opt_name, longopt_xlate) val = getattr(self, opt_name) print " %s: %s" % (opt_name, val)
2da9ba2b28b00baa0cece6ddf7f00f4553c4ea41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2da9ba2b28b00baa0cece6ddf7f00f4553c4ea41/install.py
attempdirs = ['/usr/tmp', '/tmp', pwd]
attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd]
def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0, '\\TEMP') e...
7c2f04ab85b94d92a6eb385bac9dd81794496b22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c2f04ab85b94d92a6eb385bac9dd81794496b22/tempfile.py
(script, type) = self.tk.splitlist( self.tk.call('after', 'info', id))
data = self.tk.call('after', 'info', id) script = self.tk.splitlist(data)[0]
def after_cancel(self, id): """Cancel scheduling of function identified with ID.
65c7667201d31e2ac6edd8d694034869832dcfb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/65c7667201d31e2ac6edd8d694034869832dcfb2/Tkinter.py
@bigmemtest(minsize=_2G, memuse=8)
@bigmemtest(minsize=_2G, memuse=9)
def test_repr_large(self, size): return self.basic_test_repr(size)
c30db97d491406a6344c69607b9e51ca88a71765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c30db97d491406a6344c69607b9e51ca88a71765/test_bigmem.py
@bigmemtest(minsize=_2G + 10, memuse=8)
@bigmemtest(minsize=_2G + 10, memuse=9)
def test_index(self, size): l = [1L, 2L, 3L, 4L, 5L] * (size // 5) self.assertEquals(l.index(1), 0) self.assertEquals(l.index(5, size - 5), size - 1) self.assertEquals(l.index(5, size - 5, size), size - 1) self.assertRaises(ValueError, l.index, 1, size - 4, size) self.assertRaises(ValueError, l.index, 6L)
c30db97d491406a6344c69607b9e51ca88a71765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c30db97d491406a6344c69607b9e51ca88a71765/test_bigmem.py
except (ImportError, AttributeError): def _set_cloexec(fd): pass
def _set_cloexec(fd): flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0) if flags >= 0: # flags read successfully, modify flags |= _fcntl.FD_CLOEXEC _fcntl.fcntl(fd, _fcntl.F_SETFD, flags)
a8047a377355243008b7bb2fd756862c2ccb251b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a8047a377355243008b7bb2fd756862c2ccb251b/tempfile.py
value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value == output and type(value) is type(output):
value = f(*args) self.assertEqual(output, value) self.assert_(type(output) is type(value))
def test(method, input, output, *args): if verbose: print '%s.%s%s =? %s... ' % (repr(input), method, args, repr(output)), try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value == output and type(value) is type(output): # if the original i...
2297ca3284c57a984832427dbc81d0141ceff94c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2297ca3284c57a984832427dbc81d0141ceff94c/test_unicode.py
try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] if value is input: if verbose: print 'no' print '*',f, `input`, `output`, `value` return if value != output or type(value) is not type(output): if verbose: print 'no' print '*',f, `input`, `output`, `value` if e...
f = getattr(input, method) value = f(*args) self.assertEqual(output, value) self.assert_(input is not value) def test_capitalize(self): self.checkmethod('capitalize', u' hello ', u' hello ') self.checkmethod('capitalize', u'Hello ', u'Hello ') self.checkmethod('capitalize', u'hello ', u'Hello ') self.checkmethod('capi...
def __repr__(self): return 'usub(%r)' % unicode.__repr__(self)
2297ca3284c57a984832427dbc81d0141ceff94c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2297ca3284c57a984832427dbc81d0141ceff94c/test_unicode.py
return None codecs.register(search_function) self.assertRaises(TypeError, "hello".decode, "test.unicode1") self.assertRaises(TypeError, unicode, "hello", "test.unicode2") self.assertRaises(TypeError, u"hello".encode, "test.unicode1") self.assertRaises(TypeError, u"hello".encode, "test.unicode2") import imp self.assert...
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
2297ca3284c57a984832427dbc81d0141ceff94c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2297ca3284c57a984832427dbc81d0141ceff94c/test_unicode.py
else: pass verify('...%(foo)s...' % {'foo':u"abc"} == u'...abc...') verify('...%(foo)s...' % {'foo':"abc"} == '...abc...') verify('...%(foo)s...' % {u'foo':"abc"} == '...abc...') verify('...%(foo)s...' % {u'foo':u"abc"} == u'...abc...') verify('...%(foo)s...' % {u'foo':u"abc",'def':123} == u'...abc...') verify('......
out = BitBucket() print >>out, u'abc' print >>out, u'abc', u'def' print >>out, u'abc', 'def' print >>out, 'abc', u'def' print >>out, u'abc\n' print >>out, u'abc\n', print >>out, u'abc\n', print >>out, u'def\n' print >>out, u'def\n' def test_mul(self): self.checkmethod('__mul__', u'abc', u'', -1) self.checkmethod('__m...
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
2297ca3284c57a984832427dbc81d0141ceff94c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2297ca3284c57a984832427dbc81d0141ceff94c/test_unicode.py
verify(inc(1) == 2)
verify(inc(1) == 11)
def adder(y): return global_nest_x + y
f9891cc01c9cb82b881327139ef71c1dc3722448 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f9891cc01c9cb82b881327139ef71c1dc3722448/test_scope.py
if type(value) != type([]):
if type(value) not in (type([]), type( () )):
def post_to_server(self, data, auth=None): ''' Post a query to the server, and return a string response. '''
ca253f47eee6c9b98d38daa53c09fc0a4722d6e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca253f47eee6c9b98d38daa53c09fc0a4722d6e9/register.py
if value.sign == 1: self._sign = 0 else: self._sign = 1
self._sign = value.sign
def __new__(cls, value="0", context=None): """Create a decimal point instance.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
diff = cmp(abs(op1), abs(op2))
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
if diff == 0:
if op1.int == op2.int:
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
if diff < 0:
if op1.int < op2.int:
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
if op1.sign == -1: result.sign = -1
if op1.sign == 1: result.sign = 1
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
result.sign = 1
result.sign = 0
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
elif op1.sign == -1: result.sign = -1 op1.sign, op2.sign = (1, 1)
elif op1.sign == 1: result.sign = 1 op1.sign, op2.sign = (0, 0)
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
result.sign = 1
result.sign = 0
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
if op2.sign == 1:
if op2.sign == 0:
def __add__(self, other, context=None): """Returns self + other.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
if sign: sign = -1 else: sign = 1 adjust = 0
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
otherside = otherside._rescale(exp, context=context, watchexp=0)
otherside = otherside._rescale(exp, context=context, watchexp=0)
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
def to_integral(self, a): """Rounds to an integer.
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1
elif isinstance(value, Decimal): self.sign = value._sign
def __init__(self, value=None): if value is None: self.sign = None self.int = 0 self.exp = None if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1 cum = 0 for digit in value._int: cum = cum * 10 + digit self.int = cum self.exp = value._exp if isinstance(value, tuple): self.sign = value[0]...
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
for digit in value._int:
for digit in value._int:
def __init__(self, value=None): if value is None: self.sign = None self.int = 0 self.exp = None if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1 cum = 0 for digit in value._int: cum = cum * 10 + digit self.int = cum self.exp = value._exp if isinstance(value, tuple): self.sign = value[0]...
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
if isinstance(value, tuple):
else:
def __init__(self, value=None): if value is None: self.sign = None self.int = 0 self.exp = None if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1 cum = 0 for digit in value._int: cum = cum * 10 + digit self.int = cum self.exp = value._exp if isinstance(value, tuple): self.sign = value[0]...
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
def __neg__(self): if self.sign == 1: return _WorkRep( (-1, self.int, self.exp) ) else: return _WorkRep( (1, self.int, self.exp) ) def __abs__(self): if self.sign == -1: return -self else: return self def __cmp__(self, other): if self.exp != other.exp: raise ValueError("Operands not normalized: %r, %r" % (self, othe...
def __repr__(self): return "(%r, %r, %r)" % (self.sign, self.int, self.exp)
b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b7ed2df9f8b3eaa226b68d6c2ebfcb1ddb522d57/decimal.py
self._parser.ProcessingInstructionHandler = \ self._cont_handler.processingInstruction self._parser.CharacterDataHandler = self._cont_handler.characters
self._reset_cont_handler()
def reset(self): if self._namespaces: self._parser = expat.ParserCreate(None, " ") self._parser.StartElementHandler = self.start_element_ns self._parser.EndElementHandler = self.end_element_ns else: self._parser = expat.ParserCreate() self._parser.StartElementHandler = self.start_element self._parser.EndElementHandler ...
4626ec0f40696dd05f0fc774b0b47caa575067aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4626ec0f40696dd05f0fc774b0b47caa575067aa/expatreader.py
self._parser.CommentHandler = self._lex_handler_prop.comment self._parser.StartCdataSectionHandler = self._lex_handler_prop.startCDATA self._parser.EndCdataSectionHandler = self._lex_handler_prop.endCDATA
self._reset_lex_handler_prop()
def reset(self): if self._namespaces: self._parser = expat.ParserCreate(None, " ") self._parser.StartElementHandler = self.start_element_ns self._parser.EndElementHandler = self.end_element_ns else: self._parser = expat.ParserCreate() self._parser.StartElementHandler = self.start_element self._parser.EndElementHandler ...
4626ec0f40696dd05f0fc774b0b47caa575067aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4626ec0f40696dd05f0fc774b0b47caa575067aa/expatreader.py
if string.lower(filename[-3:]) == '.py' and os.path.exists(filename):
for suffix, mode, kind in imp.get_suffixes(): if 'b' in mode and string.lower(filename[-len(suffix):]) == suffix: return None if os.path.exists(filename):
def getsourcefile(object): """Return the Python source file an object was defined in, if it exists.""" filename = getfile(object) if string.lower(filename[-4:]) in ['.pyc', '.pyo']: filename = filename[:-4] + '.py' if string.lower(filename[-3:]) == '.py' and os.path.exists(filename): return filename
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
"""Return an absolute path to the source file or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" return os.path.normcase(os.path.abspath(getsourcefile(object) or getfile(object)))
"""Return an absolute path to the source or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" return os.path.normcase( os.path.abspath(getsourcefile(object) or getfile(object)))
def getabsfile(object): """Return an absolute path to the source file or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" return os.path.normcase(os.path.abspath(getsourcefile(object) or getfile(object)))
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
"""Try to guess which module an object was defined in."""
"""Return the module an object was defined in, or None if not found."""
def getmodule(object): """Try to guess which module an object was defined in.""" if isclass(object): return sys.modules.get(object.__module__) try: file = getabsfile(object) except TypeError: return None if modulesbyfile.has_key(file): return sys.modules[modulesbyfile[file]] for module in sys.modules.values(): if hasat...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
try:
if hasattr(main, object.__name__):
def getmodule(object): """Try to guess which module an object was defined in.""" if isclass(object): return sys.modules.get(object.__module__) try: file = getabsfile(object) except TypeError: return None if modulesbyfile.has_key(file): return sys.modules[modulesbyfile[file]] for module in sys.modules.values(): if hasat...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
if mainobject is object: return main except AttributeError: pass
if mainobject is object: return main
def getmodule(object): """Try to guess which module an object was defined in.""" if isclass(object): return sys.modules.get(object.__module__) try: file = getabsfile(object) except TypeError: return None if modulesbyfile.has_key(file): return sys.modules[modulesbyfile[file]] for module in sys.modules.values(): if hasat...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
try:
if hasattr(builtin, object.__name__):
def getmodule(object): """Try to guess which module an object was defined in.""" if isclass(object): return sys.modules.get(object.__module__) try: file = getabsfile(object) except TypeError: return None if modulesbyfile.has_key(file): return sys.modules[modulesbyfile[file]] for module in sys.modules.values(): if hasat...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
if builtinobject is object: return builtin except AttributeError: pass
if builtinobject is object: return builtin
def getmodule(object): """Try to guess which module an object was defined in.""" if isclass(object): return sys.modules.get(object.__module__) try: file = getabsfile(object) except TypeError: return None if modulesbyfile.has_key(file): return sys.modules[modulesbyfile[file]] for module in sys.modules.values(): if hasat...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
lines = file.readlines() file.close()
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
try: lnum = object.co_firstlineno - 1 except AttributeError:
if not hasattr(object, 'co_firstlineno'):
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
else: while lnum > 0: if string.split(lines[lnum])[:1] == ['def']: break lnum = lnum - 1 return lines, lnum
lnum = object.co_firstlineno - 1 while lnum > 0: if string.split(lines[lnum])[:1] == ['def']: break lnum = lnum - 1 return lines, lnum
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
except: return None
except IOError: return None
def getcomments(object): """Get lines of comments immediately preceding an object's source code.""" try: lines, lnum = findsource(object) except: return None if ismodule(object): # Look for a comment block at the top of the file. start = 0 if lines[0][:2] == '#!': start = 1 while start < len(lines) and string.strip(li...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
except IOError: lines = index = None
def getframeinfo(frame, context=1): """Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of the current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. The optional second ar...
d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py
bytes = "" while 1: line = self.rfile.readline() bytes = bytes + line if line == '\r\n' or line == '\n' or line == '': break
def parse_request(self): """Parse a request (internal).
74e32f228fdbfa857e026c1254123fe9614f86cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/74e32f228fdbfa857e026c1254123fe9614f86cc/BaseHTTPServer.py
hfile = cStringIO.StringIO(bytes) self.headers = self.MessageClass(hfile)
self.headers = self.MessageClass(self.rfile, 0)
def parse_request(self): """Parse a request (internal).
74e32f228fdbfa857e026c1254123fe9614f86cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/74e32f228fdbfa857e026c1254123fe9614f86cc/BaseHTTPServer.py
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
sqlite_inc_paths = [ '/usr/include',
sqlite_inc_paths = [ '/usr/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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
MIN_SQLITE_VERSION_NUMBER = 3000008 MIN_SQLITE_VERSION = "3.0.8"
MIN_SQLITE_VERSION_NUMBER = (3, 0, 8) MIN_SQLITE_VERSION = ".".join([str(x) for x in MIN_SQLITE_VERSION_NUMBER])
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
f = open(f).read() m = re.search(r"
incf = open(f).read() m = re.search( r'\s*.*
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
sqlite_version = int(m.group(1)) if sqlite_version >= MIN_SQLITE_VERSION_NUMBER:
sqlite_version = m.group(1) sqlite_version_tuple = tuple([int(x) for x in sqlite_version.split(".")]) if sqlite_version_tuple >= MIN_SQLITE_VERSION_NUMBER:
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
elif sqlite_version == 3000000: if sqlite_setup_debug: print "found buggy SQLITE_VERSION_NUMBER, checking" m = re.search(r' f) if m: sqlite_version = m.group(1) if sqlite_version >= MIN_SQLITE_VERSION: print "%s/sqlite3.h: version %s"%(d, sqlite_version) sqlite_incdir = d break
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
if sqlite_setup_debug:
if sqlite_setup_debug:
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
elif sqlite_setup_debug: print "sqlite: %s had no SQLITE_VERSION"%(f,)
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
sqlite_defines.append(('PYSQLITE_VERSION',
sqlite_defines.append(('PYSQLITE_VERSION',
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
sqlite_defines.append(('PYSQLITE_VERSION',
sqlite_defines.append(('PYSQLITE_VERSION',
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
sqlite_defines.append(('PY_MAJOR_VERSION',
sqlite_defines.append(('PY_MAJOR_VERSION',
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
sqlite_defines.append(('PY_MINOR_VERSION',
sqlite_defines.append(('PY_MINOR_VERSION',
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
include_dirs=["Modules/_sqlite",
include_dirs=["Modules/_sqlite",
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')
e25005bba7396fd747cf8a1e8599dbd4d921ef70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e25005bba7396fd747cf8a1e8599dbd4d921ef70/setup.py
tmp_file.close()
_sync_close(tmp_file)
def add(self, message): """Add message and return assigned key.""" tmp_file = self._create_tmp() try: self._dump_message(message, tmp_file) finally: tmp_file.close() if isinstance(message, MaildirMessage): subdir = message.get_subdir() suffix = self.colon + message.get_info() if suffix == self.colon: suffix = '' else: ...
9642fb1c136c4c0b78f4a639661c003e4acc6ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9642fb1c136c4c0b78f4a639661c003e4acc6ae3/mailbox.py
new_file.close()
_sync_close(new_file)
def flush(self): """Write any pending changes to disk.""" if not self._pending: return self._lookup() new_file = _create_temporary(self._path) try: new_toc = {} self._pre_mailbox_hook(new_file) for key in sorted(self._toc.keys()): start, stop = self._toc[key] self._file.seek(start) self._pre_message_hook(new_file) new_...
9642fb1c136c4c0b78f4a639661c003e4acc6ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9642fb1c136c4c0b78f4a639661c003e4acc6ae3/mailbox.py
self._file.close()
self._file.close()
def close(self): """Flush and close the mailbox.""" self.flush() if self._locked: self.unlock() self._file.close()
9642fb1c136c4c0b78f4a639661c003e4acc6ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9642fb1c136c4c0b78f4a639661c003e4acc6ae3/mailbox.py
f.close()
_sync_close(f)
def add(self, message): """Add message and return assigned key.""" keys = self.keys() if len(keys) == 0: new_key = 1 else: new_key = max(keys) + 1 new_path = os.path.join(self._path, str(new_key)) f = _create_carefully(new_path) try: if self._locked: _lock_file(f) try: self._dump_message(message, f) if isinstance(messa...
9642fb1c136c4c0b78f4a639661c003e4acc6ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9642fb1c136c4c0b78f4a639661c003e4acc6ae3/mailbox.py
f.close()
_sync_close(f)
def __setitem__(self, key, message): """Replace the keyed message; raise KeyError if it doesn't exist.""" path = os.path.join(self._path, str(key)) try: f = open(path, 'rb+') except IOError, e: if e.errno == errno.ENOENT: raise KeyError('No message with key: %s' % key) else: raise try: if self._locked: _lock_file(f) tr...
9642fb1c136c4c0b78f4a639661c003e4acc6ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9642fb1c136c4c0b78f4a639661c003e4acc6ae3/mailbox.py
self._file.close()
_sync_close(self._file)
def unlock(self): """Unlock the mailbox if it is locked.""" if self._locked: _unlock_file(self._file) self._file.close() del self._file self._locked = False
9642fb1c136c4c0b78f4a639661c003e4acc6ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9642fb1c136c4c0b78f4a639661c003e4acc6ae3/mailbox.py
f.close()
_sync_close(f)
def set_sequences(self, sequences): """Set sequences using the given name-to-key-list dictionary.""" f = open(os.path.join(self._path, '.mh_sequences'), 'r+') try: os.close(os.open(f.name, os.O_WRONLY | os.O_TRUNC)) for name, keys in sequences.iteritems(): if len(keys) == 0: continue f.write('%s:' % name) prev = None c...
9642fb1c136c4c0b78f4a639661c003e4acc6ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9642fb1c136c4c0b78f4a639661c003e4acc6ae3/mailbox.py
def walktree(name, change): if os.path.isfile(name): for ext, cr, tp in list: if name[-len(ext):] == ext: fs = macfs.FSSpec(name) curcrtp = fs.GetCreatorType() if curcrtp <> (cr, tp): if change: fs.SetCreatorType(cr, tp) print 'Fixed ', name else: print 'Wrong', curcrtp, name elif os.path.isdir(name): print '->', name ...
def mkalias(src, dst): """Create a finder alias""" srcfss = macfs.FSSpec(src) dstfss = macfs.FSSpec(dst) alias = srcfss.NewAlias() srcfinfo = srcfss.GetFInfo() Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1) h = Res.FSpOpenResFile(dstfss, 3) resource = Res.Resource(alias.data) resource.AddResourc...
def walktree(name, change): if os.path.isfile(name): for ext, cr, tp in list: if name[-len(ext):] == ext: fs = macfs.FSSpec(name) curcrtp = fs.GetCreatorType() if curcrtp <> (cr, tp): if change: fs.SetCreatorType(cr, tp) print 'Fixed ', name else: print 'Wrong', curcrtp, name elif os.path.isdir(name): print '->', name ...
14842d631807964ee4e0c5633be5723b57b8f135 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14842d631807964ee4e0c5633be5723b57b8f135/ConfigurePython.py
def run(change): fss, ok = macfs.GetDirectory() if not ok: sys.exit(0) walktree(fss.as_pathname(), change)
EasyDialogs.Message('All done!')
def run(change): fss, ok = macfs.GetDirectory() if not ok: sys.exit(0) walktree(fss.as_pathname(), change)
14842d631807964ee4e0c5633be5723b57b8f135 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14842d631807964ee4e0c5633be5723b57b8f135/ConfigurePython.py
run(1)
main()
def run(change): fss, ok = macfs.GetDirectory() if not ok: sys.exit(0) walktree(fss.as_pathname(), change)
14842d631807964ee4e0c5633be5723b57b8f135 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14842d631807964ee4e0c5633be5723b57b8f135/ConfigurePython.py
InteractiveInterpreter.__init__(self)
locals = sys.modules['__main__'].__dict__ InteractiveInterpreter.__init__(self, locals=locals)
def __init__(self, tkconsole): self.tkconsole = tkconsole InteractiveInterpreter.__init__(self)
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
filename = self.stuffsource(source) self.more = 0 return InteractiveInterpreter.runsource(self, source, filename) def stuffsource(self, source):
def runsource(self, source): # Extend base class to stuff the source in the line cache filename = "<pyshell#%d>" % self.gid self.gid = self.gid + 1 lines = string.split(source, "\n") linecache.cache[filename] = len(source)+1, 0, lines, filename self.more = 0 return InteractiveInterpreter.runsource(self, source, filenam...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
self.more = 0 return InteractiveInterpreter.runsource(self, source, filename)
return filename
def runsource(self, source): # Extend base class to stuff the source in the line cache filename = "<pyshell#%d>" % self.gid self.gid = self.gid + 1 lines = string.split(source, "\n") linecache.cache[filename] = len(source)+1, 0, lines, filename self.more = 0 return InteractiveInterpreter.runsource(self, source, filenam...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
if char in string.letters + string.digits + "_":
if char and char in string.letters + string.digits + "_":
def showsyntaxerror(self, filename=None): # Extend base class to color the offending position # (instead of printing it and pointing at it with a caret) text = self.tkconsole.text stuff = self.unpackerror() if not stuff: self.tkconsole.resetoutput() InteractiveInterpreter.showsyntaxerror(self, filename) return msg, lin...
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py
ok = type == SyntaxError
ok = type is SyntaxError
def unpackerror(self): type, value, tb = sys.exc_info() ok = type == SyntaxError if ok: try: msg, (dummy_filename, lineno, offset, line) = value except: ok = 0 if ok: return msg, lineno, offset, line else: return None
9e37a41814a378d7017bd5b336151f30a46ac96a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9e37a41814a378d7017bd5b336151f30a46ac96a/PyShell.py