rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
self.assertEqual(p.stderr.read(), "strawberry")
self.assertEqual(remove_stderr_debug_decorations(p.stderr.read()), "strawberry")
def test_stderr_pipe(self): # stderr redirection p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stderr.write("strawberry")'], stderr=subprocess.PIPE) self.assertEqual(p.stderr.read(), "strawberry")
05a5f9b6bd5da2d785236574266f2d3a4e794e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05a5f9b6bd5da2d785236574266f2d3a4e794e5d/test_subprocess.py
self.assertEqual(os.read(d, 1024), "strawberry")
self.assertEqual(remove_stderr_debug_decorations(os.read(d, 1024)), "strawberry")
def test_stderr_filedes(self): # stderr is set to open file descriptor tf = tempfile.TemporaryFile() d = tf.fileno() p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stderr.write("strawberry")'], stderr=d) p.wait() os.lseek(d, 0, 0) self.assertEqual(os.read(d, 1024), "strawberry")
05a5f9b6bd5da2d785236574266f2d3a4e794e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05a5f9b6bd5da2d785236574266f2d3a4e794e5d/test_subprocess.py
self.assertEqual(tf.read(), "strawberry")
self.assertEqual(remove_stderr_debug_decorations(tf.read()), "strawberry")
def test_stderr_fileobj(self): # stderr is set to open file object tf = tempfile.TemporaryFile() p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stderr.write("strawberry")'], stderr=tf) p.wait() tf.seek(0) self.assertEqual(tf.read(), "strawberry")
05a5f9b6bd5da2d785236574266f2d3a4e794e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05a5f9b6bd5da2d785236574266f2d3a4e794e5d/test_subprocess.py
self.assertEqual(p.stdout.read(), "appleorange")
output = p.stdout.read() stripped = remove_stderr_debug_decorations(output) self.assertEqual(stripped, "appleorange")
def test_stdout_stderr_pipe(self): # capture stdout and stderr to the same pipe p = subprocess.Popen([sys.executable, "-c", 'import sys;' \ 'sys.stdout.write("apple");' \ 'sys.stdout.flush();' \ 'sys.stderr.write("orange")'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) self.assertEqual(p.stdout.read(), "appleoran...
05a5f9b6bd5da2d785236574266f2d3a4e794e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05a5f9b6bd5da2d785236574266f2d3a4e794e5d/test_subprocess.py
self.assertEqual(tf.read(), "appleorange")
output = tf.read() stripped = remove_stderr_debug_decorations(output) self.assertEqual(stripped, "appleorange")
def test_stdout_stderr_file(self): # capture stdout and stderr to the same open file tf = tempfile.TemporaryFile() p = subprocess.Popen([sys.executable, "-c", 'import sys;' \ 'sys.stdout.write("apple");' \ 'sys.stdout.flush();' \ 'sys.stderr.write("orange")'], stdout=tf, stderr=tf) p.wait() tf.seek(0) self.assertEqual(...
05a5f9b6bd5da2d785236574266f2d3a4e794e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05a5f9b6bd5da2d785236574266f2d3a4e794e5d/test_subprocess.py
self.assertEqual(stderr, "pineapple")
self.assertEqual(remove_stderr_debug_decorations(stderr), "pineapple")
def test_communicate(self): p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' \ 'sys.stderr.write("pineapple");' \ 'sys.stdout.write(sys.stdin.read())'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = p.communicate("banana") self.assertEqual(stdout, "banana") self.a...
05a5f9b6bd5da2d785236574266f2d3a4e794e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05a5f9b6bd5da2d785236574266f2d3a4e794e5d/test_subprocess.py
self.assertEqual(stderr, "")
self.assertEqual(remove_stderr_debug_decorations(stderr), "")
def test_writes_before_communicate(self): # stdin.write before communicate() p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' \ 'sys.stdout.write(sys.stdin.read())'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.stdin.write("banana") (stdout, stderr) = p.communicate("split") self...
05a5f9b6bd5da2d785236574266f2d3a4e794e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05a5f9b6bd5da2d785236574266f2d3a4e794e5d/test_subprocess.py
UserDict.UserDict.__init__(self, *args, **kw)
def __init__(self, *args, **kw): UserDict.UserDict.__init__(self, *args, **kw) def remove(wr, selfref=ref(self)): self = selfref() if self is not None: del self.data[wr.key] self._remove = remove
d29ba07a5d4470043b148a64d05a5f127d1bd30f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d29ba07a5d4470043b148a64d05a5f127d1bd30f/weakref.py
self.min_readsize = 64
def __init__(self, filename=None, mode=None, compresslevel=9, fileobj=None): """Constructor for the GzipFile class.
94857c88febb30ed9845f0b48036d4df50580a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94857c88febb30ed9845f0b48036d4df50580a91/gzip.py
if size < 0: size = sys.maxint readsize = self.min_readsize else: readsize = size bufs = ""
if size < 0: size = sys.maxint bufs = [] readsize = min(100, size)
def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
94857c88febb30ed9845f0b48036d4df50580a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94857c88febb30ed9845f0b48036d4df50580a91/gzip.py
if size == 0: return bufs
if size == 0: return "".join(bufs)
def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
94857c88febb30ed9845f0b48036d4df50580a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94857c88febb30ed9845f0b48036d4df50580a91/gzip.py
if size is not None: if i==-1 and len(c) > size: i=size-1 elif size <= i: i = size -1
def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
94857c88febb30ed9845f0b48036d4df50580a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94857c88febb30ed9845f0b48036d4df50580a91/gzip.py
if size <= i: i = size - 1 self._unread(c[i+1:]) return bufs + c[:i+1] else: if len(c) > size: i = size - 1 bufs = bufs + c size = size - len(c) readsize = min(size, int(readsize * 1.1)) if readsize > self.min_readsize: self.min_readsize = readsize
bufs.append(c[:i+1]) self._unread(c[i+1:]) return ''.join(bufs) bufs.append(c) size = size - len(c) readsize = min(size, readsize * 2)
def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
94857c88febb30ed9845f0b48036d4df50580a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94857c88febb30ed9845f0b48036d4df50580a91/gzip.py
libraries, extradirs, extraexportsymbols)
libraries, extradirs, extraexportsymbols, outputdir)
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier...
579f673323af12f7aa8ee186776b73f9976097f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/579f673323af12f7aa8ee186776b73f9976097f9/genpluginprojects.py
libraries, extradirs, extraexportsymbols)
libraries, extradirs, extraexportsymbols, outputdir)
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier...
579f673323af12f7aa8ee186776b73f9976097f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/579f673323af12f7aa8ee186776b73f9976097f9/genpluginprojects.py
genpluginproject("ppc", "Icn", libraries=["IconServicesLib"])
genpluginproject("ppc", "Icn", libraries=["IconServicesLib"], outputdir="::Lib:Carbon")
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier...
579f673323af12f7aa8ee186776b73f9976097f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/579f673323af12f7aa8ee186776b73f9976097f9/genpluginprojects.py
print x return x
def __del__(self): x = self.ref() print x return x
5382205e1df06237bd89657d5d238a7c7348d929 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5382205e1df06237bd89657d5d238a7c7348d929/test_descr.py
if (not check_intermediate) or len(plist) < 2:
if not check_intermediate:
def __init__(self, master, name, destroy_physically=1, check_intermediate=1): if check_intermediate: path = master._subwidget_name(name) try: path = path[len(master._w)+1:] plist = path.split('.') except: plist = []
c5c78594932f31d6eaadbf386cb39048eae8f945 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5c78594932f31d6eaadbf386cb39048eae8f945/Tix.py
waste = self.rfile.read(1)
if not self.rfile.read(1): break
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...
7a40b14b65083150d38e48641c61432e7d35308f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7a40b14b65083150d38e48641c61432e7d35308f/CGIHTTPServer.py
waste = self.rfile._sock.recv(1)
if not self.rfile._sock.recv(1): break
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...
7a40b14b65083150d38e48641c61432e7d35308f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7a40b14b65083150d38e48641c61432e7d35308f/CGIHTTPServer.py
if userhome.endswith('/'): i += 1
userhome = userhome.rstrip('/')
def expanduser(path): """Expand ~ and ~user constructions. If user or $HOME is unknown, do nothing.""" if not path.startswith('~'): return path i = path.find('/', 1) if i < 0: i = len(path) if i == 1: if 'HOME' not in os.environ: import pwd userhome = pwd.getpwuid(os.getuid()).pw_dir else: userhome = os.environ['HOME'...
e9741338182beae2cc4669963c8ac2a866500c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e9741338182beae2cc4669963c8ac2a866500c28/posixpath.py
eq(folders, map(normF, ['deep', 'deep/f1', 'deep/f2', 'deep/f2/f3', 'inbox', 'wide']))
tfolders = map(normF, ['deep', 'deep/f1', 'deep/f2', 'deep/f2/f3', 'inbox', 'wide']) tfolders.sort() eq(folders, tfolders)
def test_listfolders(self): mh = getMH() eq = self.assertEquals
d30a0d8c957bf3aa04e2e3f3d6f94ed594592fc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d30a0d8c957bf3aa04e2e3f3d6f94ed594592fc4/test_mhlib.py
with private names and those defined in other modules. + C.__doc__ for all classes C in M.__dict__.values(), except those with private names and those defined in other modules.
defined in other modules. + C.__doc__ for all classes C in M.__dict__.values(), except those defined in other modules.
def _test(): import doctest, M # replace M with your module's name return doctest.testmod(M) # ditto
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
their contained methods and nested classes. Private names reached from M's globals are skipped, but all names reached from M.__test__ are searched. By default, a name is considered to be private if it begins with an underscore (like "_my_func") but doesn't both begin and end with (at least) two underscores (like "__i...
their contained methods and nested classes. All names reached from M.__test__ are searched. Optionally, functions with private names can be skipped (unless listed in M.__test__) by supplying a function to the "isprivate" argument that will identify private functions. For convenience, one such function is supplied. ...
def _test(): import doctest, M # replace M with your module's name return doctest.testmod(M) # ditto
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
whether a name is private. The default function is doctest.is_private; see its docs for details.
whether a name is private. The default function is to assume that no functions are private. The "isprivate" arg may be set to doctest.is_private in order to skip over functions marked as private using an underscore naming convention; see its docs for details.
def __init__(self, mod=None, globs=None, verbose=None, isprivate=None, optionflags=0): """mod=None, globs=None, verbose=None, isprivate=None,
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
isprivate = is_private
isprivate = lambda prefix, base: 0
def __init__(self, mod=None, globs=None, verbose=None, isprivate=None, optionflags=0): """mod=None, globs=None, verbose=None, isprivate=None,
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
>>> t = Tester(globs={}, verbose=0)
>>> t = Tester(globs={}, verbose=0, isprivate=is_private)
... def bar(self):
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
Again, but with a custom isprivate function allowing _f: >>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
Again, but with the default isprivate function allowing _f: >>> t = Tester(globs={}, verbose=0)
... def bar(self):
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
>>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
>>> t = Tester(globs={}, verbose=0)
... def bar(self):
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
>>> testmod(m1)
>>> testmod(m1, isprivate=is_private)
... def bar(self):
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
with m.__doc__. Private names are skipped.
with m.__doc__. Unless isprivate is specified, private names are not skipped.
def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0): """m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0 Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), sta...
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
doctest.is_private; see its docs for details.
treat all functions as public. Optionally, "isprivate" can be set to doctest.is_private to skip over functions marked as private using the underscore naming convention; see its docs for details.
def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0): """m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0 Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), sta...
69ea6631db2503d0aa159a5cd267f7e1a492a14a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69ea6631db2503d0aa159a5cd267f7e1a492a14a/doctest.py
c, noise = noise[0], noise[1:] res = res + c return res + noise + line res = "" for line in map(addnoise, lines): b = binascii.a2b_base64(line) res = res + b verify(res == testdata)
self.fail("binascii.a2b_qp(**{1:1}) didn't raise TypeError") self.assertEqual(binascii.a2b_qp("= "), "") self.assertEqual(binascii.a2b_qp("=="), "=") self.assertEqual(binascii.a2b_qp("=AX"), "=AX") self.assertRaises(TypeError, binascii.b2a_qp, foo="bar") self.assertEqual(binascii.a2b_qp("=00\r\n=00"), "\x00\r\n\x00") s...
def addnoise(line): noise = fillers ratio = len(line) // len(noise) res = "" while line and noise: if len(line) // len(noise) > ratio: c, line = line[0], line[1:] else: c, noise = noise[0], noise[1:] res = res + c return res + noise + line
46cb568c7f48672eda08b3d15f7013b06a02b01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/46cb568c7f48672eda08b3d15f7013b06a02b01f/test_binascii.py
verify(binascii.a2b_base64(fillers) == '')
def test_main(): test_support.run_unittest(BinASCIITest)
def addnoise(line): noise = fillers ratio = len(line) // len(noise) res = "" while line and noise: if len(line) // len(noise) > ratio: c, line = line[0], line[1:] else: c, noise = noise[0], noise[1:] res = res + c return res + noise + line
46cb568c7f48672eda08b3d15f7013b06a02b01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/46cb568c7f48672eda08b3d15f7013b06a02b01f/test_binascii.py
print "uu test" MAX_UU = 45 lines = [] for i in range(0, len(testdata), MAX_UU): b = testdata[i:i+MAX_UU] a = binascii.b2a_uu(b) lines.append(a) print a, res = "" for line in lines: b = binascii.a2b_uu(line) res = res + b verify(res == testdata) crc = binascii.crc32("Test the CRC-32 of") crc = binascii.crc32(" this ...
if __name__ == "__main__": test_main()
def addnoise(line): noise = fillers ratio = len(line) // len(noise) res = "" while line and noise: if len(line) // len(noise) > ratio: c, line = line[0], line[1:] else: c, noise = noise[0], noise[1:] res = res + c return res + noise + line
46cb568c7f48672eda08b3d15f7013b06a02b01f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/46cb568c7f48672eda08b3d15f7013b06a02b01f/test_binascii.py
def small(text): return '<small>' + text + '</small>' def strong(text): return '<strong>' + text + '</strong>' def grey(text): return '<font color="
def small(text): if text: return '<small>' + text + '</small>' else: return '' def strong(text): if text: return '<strong>' + text + '</strong>' else: return '' def grey(text): if text: return '<font color=" else: return ''
def small(text): return '<small>' + text + '</small>'
d73dbf6662d0071e92013361f41cd3db0b0ca4b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d73dbf6662d0071e92013361f41cd3db0b0ca4b2/cgitb.py
'<big><big><strong>%s</strong></big></big>' % str(etype),
'<big><big>%s</big></big>' % strong(pydoc.html.escape(str(etype))),
def html((etype, evalue, etb), context=5): """Return a nice HTML document describing a given traceback.""" import os, types, time, traceback, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.tim...
d73dbf6662d0071e92013361f41cd3db0b0ca4b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d73dbf6662d0071e92013361f41cd3db0b0ca4b2/cgitb.py
function calls leading up to the error, in the order they occurred.'''
function calls leading up to the error, in the order they occurred.</p>'''
def html((etype, evalue, etb), context=5): """Return a nice HTML document describing a given traceback.""" import os, types, time, traceback, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.tim...
d73dbf6662d0071e92013361f41cd3db0b0ca4b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d73dbf6662d0071e92013361f41cd3db0b0ca4b2/cgitb.py
frames.append('''<p>
frames.append('''
def reader(lnum=[lnum]): highlight[lnum[0]] = 1 try: return linecache.getline(file, lnum[0]) finally: lnum[0] += 1
d73dbf6662d0071e92013361f41cd3db0b0ca4b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d73dbf6662d0071e92013361f41cd3db0b0ca4b2/cgitb.py
suffix_map = db.encodings_map
suffix_map = db.suffix_map
def init(files=None): global guess_extension, guess_type global suffix_map, types_map, encodings_map global inited inited = 1 db = MimeTypes() if files is None: files = knownfiles for file in files: if os.path.isfile(file): db.readfp(open(file)) encodings_map = db.encodings_map suffix_map = db.encodings_map types_map =...
807d40861edf883a7f5bdd83bb6dc3b92e639f62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/807d40861edf883a7f5bdd83bb6dc3b92e639f62/mimetypes.py
def main(): input = "MacTextEditor.h" output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.gentypetest(SHORT+"typetest.py") scanner.close() print "=== Done scanning and generating, now importing the generated code... ===" exec "import " +...
MODNAME = 'Mlte'
def main(): input = "MacTextEditor.h" output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.gentypetest(SHORT+"typetest.py") scanner.close() print "=== Done scanning and generating, now importing the generated code... ===" exec "import " +...
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
class MyScanner(Scanner_OSX):
MODPREFIX = MODNAME INPUTFILE = string.lower(MODPREFIX) + 'gen.py' OUTPUTFILE = MODNAME + "module.c"
def main(): input = "MacTextEditor.h" output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" scanner = MyScanner(input, output, defsoutput) scanner.scan() scanner.gentypetest(SHORT+"typetest.py") scanner.close() print "=== Done scanning and generating, now importing the generated code... ===" exec "import " +...
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
def destination(self, type, name, arglist): classname = "Function" listname = "functions" if arglist: t, n, m = arglist[0] if t in OBJECTS and m == "InMode": classname = "Method" listname = t + "_methods" return classname, listname
from macsupport import *
def destination(self, type, name, arglist): classname = "Function" listname = "functions" if arglist: t, n, m = arglist[0] if t in OBJECTS and m == "InMode": classname = "Method" listname = t + "_methods" return classname, listname
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
def writeinitialdefs(self): self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
def writeinitialdefs(self): self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
def makeblacklistnames(self): return [ ]
includestuff = includestuff + """
def makeblacklistnames(self): return [ ]
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
def makegreylist(self): return []
/* For now we declare them forward here. They'll go to mactoolbox later */ staticforward PyObject *TXNObj_New(TXNObject); staticforward int TXNObj_Convert(PyObject *, TXNObject *); staticforward PyObject *TXNFontMenuObj_New(TXNFontMenuObject); staticforward int TXNFontMenuObj_Convert(PyObject *, TXNFontMenuObject *);
def makegreylist(self): return []
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
def makeblacklisttypes(self): return [ "TXNTab", "TXNMargins", "TXNControlData", "TXNATSUIFeatures", "TXNATSUIVariations", "TXNAttributeData", "TXNTypeAttributes", "TXNMatchTextRecord", "TXNBackground", "UniChar", "TXNFindUPP", ]
// ADD declarations //extern PyObject *_CFTypeRefObj_New(CFTypeRef); //extern int _CFTypeRefObj_Convert(PyObject *, CFTypeRef *);
def makeblacklisttypes(self): return [ "TXNTab", # TBD "TXNMargins", # TBD "TXNControlData", #TBD "TXNATSUIFeatures", #TBD "TXNATSUIVariations", #TBD "TXNAttributeData", #TBD "TXNTypeAttributes", #TBD "TXNMatchTextRecord", #TBD "TXNBackground", #TBD "UniChar", #TBD "TXNFindUPP", ]
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
def makerepairinstructions(self): return [ ([("void", "*", "OutMode"), ("ByteCount", "*", "InMode")], [("MlteInBuffer", "*", "InMode")]), ] if __name__ == "__main__": main()
// // /* ** Parse/generate ADD records */ """ initstuff = initstuff + """ // PyMac_INIT_TOOLBOX_OBJECT_NEW(xxxx); """ TXNObject = OpaqueByValueType("TXNObject", "TXNObj") TXNFontMenuObject = OpaqueByValueType("TXNFontMenuObject", "TXNFontMenuObj") TXNFrameID = Type("TXNFrameID", "l") TXNVersionValue = Type("TXNVer...
def makerepairinstructions(self): return [ ([("void", "*", "OutMode"), ("ByteCount", "*", "InMode")], [("MlteInBuffer", "*", "InMode")]), ]
7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7cb7b5d4ad4ecc45411476c23090ffddbfcfa35e/mltesupport.py
cmdclass = {'build_ext':PyBuildExt},
cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall},
def main(): setup(name = 'Python standard library', version = '%d.%d' % sys.version_info[:2], cmdclass = {'build_ext':PyBuildExt}, # The struct module is defined here, because build_ext won't be # called unless there's at least one extension module defined. ext_modules=[Extension('struct', ['structmodule.c'])], # Scri...
11ebaff9a39bcd9ea5f9e5ba6024eb948ceecb48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11ebaff9a39bcd9ea5f9e5ba6024eb948ceecb48/setup.py
'__module__', '__name__']: return 0
'__module__', '__name__', '__slots__']: return 0
def visiblename(name, all=None): """Decide whether to show documentation on a variable.""" # Certain special names are redundant. if name in ['__builtins__', '__doc__', '__file__', '__path__', '__module__', '__name__']: return 0 # Private names are hidden, but special names are displayed. if name.startswith('__') and n...
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
def spillproperties(msg, attrs, predicate):
def spilldescriptors(msg, attrs, predicate):
def spillproperties(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: push(self._docproperty(name, value, mod)) return attrs
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
push(self._docproperty(name, value, mod))
push(self._docdescriptor(name, value, mod))
def spillproperties(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: push(self._docproperty(name, value, mod)) return attrs
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
inspect.classify_class_attrs(object))
classify_class_attrs(object))
def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None if doc is...
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
attrs = spillproperties('Properties %s' % tag, attrs, lambda t: t[1] == 'property')
attrs = spilldescriptors('Data descriptors %s' % tag, attrs, lambda t: t[1] == 'data descriptor')
def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None if doc is...
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
def _docproperty(self, name, value, mod):
def _docdescriptor(self, name, value, mod):
def _docproperty(self, name, value, mod): results = [] push = results.append
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
for attr, tag in [('fget', '<em>get</em>'), ('fset', '<em>set</em>'), ('fdel', '<em>delete</em>')]: func = getattr(value, attr) if func is not None: base = self.document(func, tag, mod) push('<dd>%s</dd>\n' % base)
def _docproperty(self, name, value, mod): results = [] push = results.append
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
return self._docproperty(name, object, mod)
return self._docdescriptor(name, object, mod)
def docproperty(self, object, name=None, mod=None, cl=None): """Produce html documentation for a property.""" return self._docproperty(name, object, mod)
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
def spillproperties(msg, attrs, predicate):
def spilldescriptors(msg, attrs, predicate):
def spillproperties(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: push(self._docproperty(name, value, mod)) return attrs
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
push(self._docproperty(name, value, mod))
push(self._docdescriptor(name, value, mod))
def spillproperties(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: push(self._docproperty(name, value, mod)) return attrs
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
inspect.classify_class_attrs(object))
classify_class_attrs(object))
def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None push(self.docother(getattr(object, name), name, mod, 70, doc) + ...
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
attrs = spillproperties("Properties %s:\n" % tag, attrs, lambda t: t[1] == 'property')
attrs = spilldescriptors("Data descriptors %s:\n" % tag, attrs, lambda t: t[1] == 'data descriptor')
def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None push(self.docother(getattr(object, name), name, mod, 70, doc) + ...
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
def _docproperty(self, name, value, mod):
def _docdescriptor(self, name, value, mod):
def _docproperty(self, name, value, mod): results = [] push = results.append
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
push(name) need_blank_after_doc = 0
push(self.bold(name)) push('\n')
def _docproperty(self, name, value, mod): results = [] push = results.append
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
need_blank_after_doc = 1 for attr, tag in [('fget', '<get>'), ('fset', '<set>'), ('fdel', '<delete>')]: func = getattr(value, attr) if func is not None: if need_blank_after_doc: push('') need_blank_after_doc = 0 base = self.document(func, tag, mod) push(self.indent(base)) return '\n'.join(results)
push('\n') return ''.join(results)
def _docproperty(self, name, value, mod): results = [] push = results.append
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
return self._docproperty(name, object, mod)
return self._docdescriptor(name, object, mod)
def docproperty(self, object, name=None, mod=None, cl=None): """Produce text documentation for a property.""" return self._docproperty(name, object, mod)
d11e9bddf58ab4c0de85be5a7c233b9b332feaad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d11e9bddf58ab4c0de85be5a7c233b9b332feaad/pydoc.py
while not is_all_white(line):
while lineno > 0 and not is_all_white(line):
def find_paragraph(text, mark): lineno, col = map(int, string.split(mark, ".")) line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) while is_all_white(line): lineno = lineno + 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) first_lineno = lineno while not is_all_white(line): lineno = lineno + 1 line =...
5c7ab29b14b7b83a8627295c506af51f5726c692 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c7ab29b14b7b83a8627295c506af51f5726c692/FormatParagraph.py
if userhome.endswith('/'): i += 1
userhome = userhome.rstrip('/')
def expanduser(path): """Expand ~ and ~user constructions. If user or $HOME is unknown, do nothing.""" if not path.startswith('~'): return path i = path.find('/', 1) if i < 0: i = len(path) if i == 1: if 'HOME' not in os.environ: import pwd userhome = pwd.getpwuid(os.getuid()).pw_dir else: userhome = os.environ['HOME'...
4d0f558111d60d80e10612b0f0ff19d95122fbab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d0f558111d60d80e10612b0f0ff19d95122fbab/posixpath.py
zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file.
zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file.
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
try: import zipfile except ImportError: zipfile = None
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
try: spawn(["zip", "-rq", zip_filename, base_dir], dry_run=dry_run) except DistutilsExecError:
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
if zipfile is None: if verbose: zipoptions = "-r" else: zipoptions = "-rq"
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
import zipfile except ImportError:
spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run) except DistutilsExecError:
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
("unable to create zip file '%s': " + "could neither find a standalone zip utility nor " + "import the 'zipfile' module") % zip_filename
("unable to create zip file '%s': " "could neither import the 'zipfile' module nor " "find a standalone zip utility") % zip_filename
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
log.info("creating '%s' and adding '%s' to it",
else: log.info("creating '%s' and adding '%s' to it",
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP "zip" utility (if installed and found on the default search path) or the "zipfile" Python module (if available). If ne...
a274097dcd7a450c7e3ee66369100b9f1367e1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a274097dcd7a450c7e3ee66369100b9f1367e1ea/archive_util.py
exts.append( Extension('_md5', ['md5module.c', 'md5c.c']) )
exts.append( Extension('_md5', ['md5module.c', 'md5.c']) )
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')
5ba393550bf3bd06da3b71af6ccbab8f44c5b32c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5ba393550bf3bd06da3b71af6ccbab8f44c5b32c/setup.py
def poll (timeout=0.0, map=None):
def poll(timeout=0.0, map=None):
def poll (timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.iteritems(): if obj.readable(): r.append(fd) if obj.writable(): w.append(fd) try: r, w, e = select.select(r, w, e, timeout) except select.error, err: if err[0] != EINTR: raise for fd in r: obj = map.get...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
for fd, obj in map.iteritems():
for fd, obj in map.items():
def poll (timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.iteritems(): if obj.readable(): r.append(fd) if obj.writable(): w.append(fd) try: r, w, e = select.select(r, w, e, timeout) except select.error, err: if err[0] != EINTR: raise for fd in r: obj = map.get...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
def poll2 (timeout=0.0, map=None):
def poll2(timeout=0.0, map=None):
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.iteritems(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.appen...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
map=socket_map
map = socket_map
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.iteritems(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.appen...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
for fd, obj in map.iteritems():
for fd, obj in map.items():
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.iteritems(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.appen...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
l.append ((fd, flags)) r = poll.poll (l, timeout)
l.append((fd, flags)) r = poll.poll(l, timeout)
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.iteritems(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.appen...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
def poll3 (timeout=0.0, map=None):
def poll3(timeout=0.0, map=None):
def poll3 (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.iteritems(): flags = 0 if obj.readable(): flags = selec...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
map=socket_map
map = socket_map
def poll3 (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.iteritems(): flags = 0 if obj.readable(): flags = selec...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
for fd, obj in map.iteritems():
for fd, obj in map.items():
def poll3 (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.iteritems(): flags = 0 if obj.readable(): flags = selec...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
r = pollster.poll (timeout)
r = pollster.poll(timeout)
def poll3 (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.iteritems(): flags = 0 if obj.readable(): flags = selec...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
def loop (timeout=30.0, use_poll=0, map=None):
def loop(timeout=30.0, use_poll=0, map=None):
def loop (timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll: if hasattr (select, 'poll'): poll_fun = poll3 else: poll_fun = poll2 else: poll_fun = poll while map: poll_fun (timeout, map)
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
if hasattr (select, 'poll'):
if hasattr(select, 'poll'):
def loop (timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll: if hasattr (select, 'poll'): poll_fun = poll3 else: poll_fun = poll2 else: poll_fun = poll while map: poll_fun (timeout, map)
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
poll_fun (timeout, map)
poll_fun(timeout, map)
def loop (timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll: if hasattr (select, 'poll'): poll_fun = poll3 else: poll_fun = poll2 else: poll_fun = poll while map: poll_fun (timeout, map)
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
def __init__ (self, sock=None, map=None):
def __init__(self, sock=None, map=None):
def __init__ (self, sock=None, map=None): if sock: self.set_socket (sock, map) # I think it should inherit this anyway self.socket.setblocking (0) self.connected = 1 # XXX Does the constructor require that the socket passed # be connected? try: self.addr = sock.getpeername() except socket.error: # The addr isn't crucia...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
self.set_socket (sock, map)
self.set_socket(sock, map)
def __init__ (self, sock=None, map=None): if sock: self.set_socket (sock, map) # I think it should inherit this anyway self.socket.setblocking (0) self.connected = 1 # XXX Does the constructor require that the socket passed # be connected? try: self.addr = sock.getpeername() except socket.error: # The addr isn't crucia...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
self.socket.setblocking (0)
self.socket.setblocking(0)
def __init__ (self, sock=None, map=None): if sock: self.set_socket (sock, map) # I think it should inherit this anyway self.socket.setblocking (0) self.connected = 1 # XXX Does the constructor require that the socket passed # be connected? try: self.addr = sock.getpeername() except socket.error: # The addr isn't crucia...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
def __repr__ (self):
def __repr__(self):
def __repr__ (self): status = [self.__class__.__module__+"."+self.__class__.__name__] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr is not None: try: status.append ('%s:%d' % self.addr) except TypeError: status.append (repr(self.addr)) return ...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
status.append ('listening')
status.append('listening')
def __repr__ (self): status = [self.__class__.__module__+"."+self.__class__.__name__] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr is not None: try: status.append ('%s:%d' % self.addr) except TypeError: status.append (repr(self.addr)) return ...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
status.append ('connected')
status.append('connected')
def __repr__ (self): status = [self.__class__.__module__+"."+self.__class__.__name__] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr is not None: try: status.append ('%s:%d' % self.addr) except TypeError: status.append (repr(self.addr)) return ...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
status.append ('%s:%d' % self.addr)
status.append('%s:%d' % self.addr)
def __repr__ (self): status = [self.__class__.__module__+"."+self.__class__.__name__] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr is not None: try: status.append ('%s:%d' % self.addr) except TypeError: status.append (repr(self.addr)) return ...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
status.append (repr(self.addr)) return '<%s at % def add_channel (self, map=None):
status.append(repr(self.addr)) return '<%s at % def add_channel(self, map=None):
def __repr__ (self): status = [self.__class__.__module__+"."+self.__class__.__name__] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr is not None: try: status.append ('%s:%d' % self.addr) except TypeError: status.append (repr(self.addr)) return ...
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
map=socket_map
map = socket_map
def add_channel (self, map=None): #self.log_info ('adding channel %s' % self) if map is None: map=socket_map map [self._fileno] = self
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
def del_channel (self, map=None):
def del_channel(self, map=None):
def del_channel (self, map=None): fd = self._fileno if map is None: map=socket_map if map.has_key (fd): #self.log_info ('closing channel %d:%s' % (fd, self)) del map [fd]
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
map=socket_map if map.has_key (fd):
map = socket_map if map.has_key(fd):
def del_channel (self, map=None): fd = self._fileno if map is None: map=socket_map if map.has_key (fd): #self.log_info ('closing channel %d:%s' % (fd, self)) del map [fd]
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py