rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def write(self, s): # Override base class write self.tkconsole.console.write(s) | da7b9c92feedbd56478e5ce885bb5ba812478f4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da7b9c92feedbd56478e5ce885bb5ba812478f4a/PyShell.py | ||
self.fileobj.write(struct.pack("<L", self.pos)) | self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFFL)) | def close(self): """Close the _Stream object. No operation should be done on it afterwards. """ if self.closed: return | fa94ed634bdb3105cc30589284474c78315d2069 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa94ed634bdb3105cc30589284474c78315d2069/tarfile.py |
"""bsdTableDB.open(filename, dbhome, create=0, truncate=0, mode=0600) | """bsdTableDB(filename, dbhome, create=0, truncate=0, mode=0600) | def __init__(self, filename, dbhome, create=0, truncate=0, mode=0600, recover=0, dbflags=0): """bsdTableDB.open(filename, dbhome, create=0, truncate=0, mode=0600) Open database name in the dbhome BerkeleyDB directory. Use keyword arguments when calling this constructor. """ self.db = None myflags = DB_THREAD if create:... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
"""CreateTable(table, columns) - Create a new table in the database | """CreateTable(table, columns) - Create a new table in the database. | def CreateTable(self, table, columns): """CreateTable(table, columns) - Create a new table in the database raises TableDBError if it already exists or for other DB errors. """ assert isinstance(columns, ListType) txn = None try: # checking sanity of the table and column names here on # table creation will prevent probl... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
- Create a new table in the database. | Create a new table in the database. | def CreateOrExtendTable(self, table, columns): """CreateOrExtendTable(table, columns) | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
"""Modify(table, conditions) - Modify in rows matching 'conditions' using mapping functions in 'mappings' * conditions is a dictionary keyed on column names containing condition functions expecting the data string as an argument and returning a boolean. * mappings is a dictionary keyed on column names containint condit... | """Modify(table, conditions={}, mappings={}) - Modify items in rows matching 'conditions' using mapping functions in 'mappings' * table - the table name * conditions - a dictionary keyed on column names containing a condition callable expecting the data string as an argument and returning a boolean. * mappings - a dic... | def Modify(self, table, conditions={}, mappings={}): """Modify(table, conditions) - Modify in rows matching 'conditions' using mapping functions in 'mappings' * conditions is a dictionary keyed on column names containing condition functions expecting the data string as an argument and returning a boolean. * mappings is... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
except DBError, dberror: | except: | def Modify(self, table, conditions={}, mappings={}): """Modify(table, conditions) - Modify in rows matching 'conditions' using mapping functions in 'mappings' * conditions is a dictionary keyed on column names containing condition functions expecting the data string as an argument and returning a boolean. * mappings is... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
* conditions is a dictionary keyed on column names containing condition functions expecting the data string as an argument and returning a boolean. | * conditions - a dictionary keyed on column names containing condition functions expecting the data string as an argument and returning a boolean. | def Delete(self, table, conditions={}): """Delete(table, conditions) - Delete items matching the given conditions from the table. * conditions is a dictionary keyed on column names containing condition functions expecting the data string as an argument and returning a boolean. """ try: matching_rowids = self.__Select(t... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
"""Select(table, conditions) - retrieve specific row data | """Select(table, columns, conditions) - retrieve specific row data | def Select(self, table, columns, conditions={}): """Select(table, conditions) - retrieve specific row data Returns a list of row column->value mapping dictionaries. * columns is a list of which column data to return. If columns is None, all columns will be returned. * conditions is a dictionary keyed on column names c... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
* columns is a list of which column data to return. If | * columns - a list of which column data to return. If | def Select(self, table, columns, conditions={}): """Select(table, conditions) - retrieve specific row data Returns a list of row column->value mapping dictionaries. * columns is a list of which column data to return. If columns is None, all columns will be returned. * conditions is a dictionary keyed on column names c... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
* conditions is a dictionary keyed on column names | * conditions - a dictionary keyed on column names | def Select(self, table, columns, conditions={}): """Select(table, conditions) - retrieve specific row data Returns a list of row column->value mapping dictionaries. * columns is a list of which column data to return. If columns is None, all columns will be returned. * conditions is a dictionary keyed on column names c... | 1953a7405024a0548dde1705171b2008920216d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1953a7405024a0548dde1705171b2008920216d7/dbtables.py |
try: printable = value is None or not str(value) except: printable = False if printable: | valuestr = _some_str(value) if value is None or not valuestr: | def _format_final_exc_line(etype, value): """Return a list of a single line -- normal case for format_exception_only""" try: printable = value is None or not str(value) except: printable = False if printable: line = "%s\n" % etype else: line = "%s: %s\n" % (etype, _some_str(value)) return line | 988b47b6fb342b4e3f79391d570f190e595a2836 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/988b47b6fb342b4e3f79391d570f190e595a2836/traceback.py |
line = "%s: %s\n" % (etype, _some_str(value)) | line = "%s: %s\n" % (etype, valuestr) | def _format_final_exc_line(etype, value): """Return a list of a single line -- normal case for format_exception_only""" try: printable = value is None or not str(value) except: printable = False if printable: line = "%s\n" % etype else: line = "%s: %s\n" % (etype, _some_str(value)) return line | 988b47b6fb342b4e3f79391d570f190e595a2836 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/988b47b6fb342b4e3f79391d570f190e595a2836/traceback.py |
class _Environ(UserDict.UserDict): | class _Environ(UserDict.IterableUserDict): | def unsetenv(key): putenv(key, "") | e74c5ff780c10cd35cd29d5a58d799c8ea85b31c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e74c5ff780c10cd35cd29d5a58d799c8ea85b31c/os.py |
uchunks = [unicode(s, str(charset)) for s, charset in self._chunks] return u''.join(uchunks) | uchunks = [] lastcs = None for s, charset in self._chunks: nextcs = charset if uchunks: if lastcs is not None: if nextcs is None or nextcs == 'us-ascii': uchunks.append(USPACE) nextcs = None elif nextcs is not None and nextcs <> 'us-ascii': uchunks.append(USPACE) lastcs = nextcs uchunks.append(unicode(s, str(charse... | def __unicode__(self): """Helper for the built-in unicode function.""" # charset item is a Charset instance so we need to stringify it. uchunks = [unicode(s, str(charset)) for s, charset in self._chunks] return u''.join(uchunks) | c1ab8b3d8649d387bad4c5de5932f2afde14216b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c1ab8b3d8649d387bad4c5de5932f2afde14216b/Header.py |
def test_main(): test.test_support.run_unittest(BuiltinTest, TestSorted) | def test_main(verbose=None): test_classes = (BuiltinTest, TestSorted) run_unittest(*test_classes) if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in xrange(len(counts)): run_unittest(*test_classes) gc.collect() counts[i] = sys.gettotalrefcount() print counts | def test_main(): test.test_support.run_unittest(BuiltinTest, TestSorted) | 89c6ad986d7fe61560d046dee0a270b93466b02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/89c6ad986d7fe61560d046dee0a270b93466b02b/test_builtin.py |
test_main() | test_main(verbose=True) | def test_main(): test.test_support.run_unittest(BuiltinTest, TestSorted) | 89c6ad986d7fe61560d046dee0a270b93466b02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/89c6ad986d7fe61560d046dee0a270b93466b02b/test_builtin.py |
self._color = color | self._set_color(color) | def color(self, *args): if not args: raise Error, "no color arguments" if len(args) == 1: color = args[0] if type(color) == type(""): # Test the color first try: id = self._canvas.create_line(0, 0, 0, 0, fill=color) except Tkinter.TclError: raise Error, "bad color string: %s" % `color` self._color = color return try: r... | 1171524d5e42a034eb78910abbcfc78ee00546d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1171524d5e42a034eb78910abbcfc78ee00546d6/turtle.py |
self._color = " | self._set_color(" def _set_color(self,color): self._color = color self._draw_turtle() | def color(self, *args): if not args: raise Error, "no color arguments" if len(args) == 1: color = args[0] if type(color) == type(""): # Test the color first try: id = self._canvas.create_line(0, 0, 0, 0, fill=color) except Tkinter.TclError: raise Error, "bad color string: %s" % `color` self._color = color return try: r... | 1171524d5e42a034eb78910abbcfc78ee00546d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1171524d5e42a034eb78910abbcfc78ee00546d6/turtle.py |
if self._tracing: | if self._tracing: | def _goto(self, x1, y1): x0, y0 = start = self._position self._position = map(float, (x1, y1)) if self._filling: self._path.append(self._position) if self._drawing: if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) distance = hypot(dx, dy) nhops = int(distance) item = self._canvas.create_line(x0, y0, x0, y0, wi... | 1171524d5e42a034eb78910abbcfc78ee00546d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1171524d5e42a034eb78910abbcfc78ee00546d6/turtle.py |
arrow="last", | def _goto(self, x1, y1): x0, y0 = start = self._position self._position = map(float, (x1, y1)) if self._filling: self._path.append(self._position) if self._drawing: if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) distance = hypot(dx, dy) nhops = int(distance) item = self._canvas.create_line(x0, y0, x0, y0, wi... | 1171524d5e42a034eb78910abbcfc78ee00546d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1171524d5e42a034eb78910abbcfc78ee00546d6/turtle.py | |
sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) sys.stderr = sys.__stderr__ | save_stderr = sys.stderr try: sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) finally: sys.stderr = save_stderr | def assertParseFail(self, cmdline_args, expected_output): """Assert the parser fails with the expected message.""" sys.stderr = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stderr) sys.stderr = sys.__stderr__ | 54b934e963d7972f62c3625b723cb51a21647124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54b934e963d7972f62c3625b723cb51a21647124/test_optparse.py |
sys.stdout = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stdout) sys.stdout = sys.__stdout__ | save_stdout = sys.stdout try: sys.stdout = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stdout) finally: sys.stdout = save_stdout | def assertStdoutEquals(self, cmdline_args, expected_output): """Assert the parser prints the expected output on stdout.""" sys.stdout = StringIO() self.assertRaises(self.parser.parse_args, (cmdline_args,), None, SystemExit, expected_output, self.redirected_stdout) sys.stdout = sys.__stdout__ | 54b934e963d7972f62c3625b723cb51a21647124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54b934e963d7972f62c3625b723cb51a21647124/test_optparse.py |
sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.assertHelp(parser, expected_usage + "\n" + "options:\n" " --version show program's version numbe... | save_argv = sys.argv[:] try: sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.assertHelp(parser, expected_usage + "\n" + "options:\n" " --version ... | def test_default_progname(self): # Make sure that program name taken from sys.argv[0] by default. sys.argv[0] = "/foo/bar/baz.py" parser = OptionParser("usage: %prog ...", version="%prog 1.2") expected_usage = "usage: baz.py ...\n" self.assertUsage(parser, expected_usage) self.assertVersion(parser, "baz.py 1.2") self.a... | 54b934e963d7972f62c3625b723cb51a21647124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54b934e963d7972f62c3625b723cb51a21647124/test_optparse.py |
updated is a tuple naming the attributes off the wrapper that | updated is a tuple naming the attributes of the wrapper that | def update_wrapper(wrapper, wrapped, assigned = WRAPPER_ASSIGNMENTS, updated = WRAPPER_UPDATES): """Update a wrapper function to look like the wrapped function wrapper is the function to be updated wrapped is the original function assigned is a tuple naming the attributes assigned directly from the wrapped function to... | a58611c7583aa7a5f8d1db54b30006e4d7d9deec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a58611c7583aa7a5f8d1db54b30006e4d7d9deec/functools.py |
bp = bdb.Breakpoint.bpbynumber[int(i)] | try: i = int(i) except ValueError: print 'Breakpoint index %r is not a number' % i continue if not (0 <= i < len(bdb.Breakpoint.bpbynumber)): print 'No breakpoint numbered', i continue bp = bdb.Breakpoint.bpbynumber[i] | def do_enable(self, arg): args = arg.split() for i in args: bp = bdb.Breakpoint.bpbynumber[int(i)] if bp: bp.enable() | 6308d0d9da083ab2f10fc25b6acfb01043c04ae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6308d0d9da083ab2f10fc25b6acfb01043c04ae5/pdb.py |
bp = bdb.Breakpoint.bpbynumber[int(i)] | try: i = int(i) except ValueError: print 'Breakpoint index %r is not a number' % i continue if not (0 <= i < len(bdb.Breakpoint.bpbynumber)): print 'No breakpoint numbered', i continue bp = bdb.Breakpoint.bpbynumber[i] | def do_disable(self, arg): args = arg.split() for i in args: bp = bdb.Breakpoint.bpbynumber[int(i)] if bp: bp.disable() | 6308d0d9da083ab2f10fc25b6acfb01043c04ae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6308d0d9da083ab2f10fc25b6acfb01043c04ae5/pdb.py |
path = [module.__filename__] | head, tail = os.path.split(module.__filename__) path = [head] | def reload(self, module, path=None): if path is None and hasattr(module, '__filename__'): path = [module.__filename__] return ihooks.ModuleImporter.reload(self, module, path) | 47331cb9c86c5b11d386486dc4e95efa775b235a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/47331cb9c86c5b11d386486dc4e95efa775b235a/rexec.py |
suffix = ['.html', '.txt'][self.format=="html"] | suffix = ['.txt', '.html'][self.format=="html"] | def handle(self, info=None): info = info or sys.exc_info() if self.format == "html": self.file.write(reset()) | d97b9c8ad3940fcb543d8cd4d99687b5d311fc87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d97b9c8ad3940fcb543d8cd4d99687b5d311fc87/cgitb.py |
def start_a(self, attributes): self.link_attr(attributes, 'href') | def check_name_id( self, attributes ): """ Check the name or id attributes on an element. """ | def start_a(self, attributes): self.link_attr(attributes, 'href') | 2afe5246f2a2897da6602dbcf286b67c150d0f2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2afe5246f2a2897da6602dbcf286b67c150d0f2a/webchecker.py |
if name == "name": | if name == "name" or name == "id": | def start_a(self, attributes): self.link_attr(attributes, 'href') | 2afe5246f2a2897da6602dbcf286b67c150d0f2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2afe5246f2a2897da6602dbcf286b67c150d0f2a/webchecker.py |
self.checker.message("WARNING: duplicate name %s in %s", | self.checker.message("WARNING: duplicate ID name %s in %s", | def start_a(self, attributes): self.link_attr(attributes, 'href') | 2afe5246f2a2897da6602dbcf286b67c150d0f2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2afe5246f2a2897da6602dbcf286b67c150d0f2a/webchecker.py |
(S_IFLNK, "l", S_IFREG, "-", S_IFBLK, "b", S_IFDIR, "d", S_IFCHR, "c", S_IFIFO, "p"), (TUREAD, "r"), (TUWRITE, "w"), (TUEXEC, "x", TSUID, "S", TUEXEC|TSUID, "s"), (TGREAD, "r"), (TGWRITE, "w"), (TGEXEC, "x", TSGID, "S", TGEXEC|TSGID, "s"), (TOREAD, "r"), (TOWRITE, "w"), (TOEXEC, "x", TSVTX, "T", TOEXEC|TSVTX, "t"... | ((S_IFLNK, "l"), (S_IFREG, "-"), (S_IFBLK, "b"), (S_IFDIR, "d"), (S_IFCHR, "c"), (S_IFIFO, "p")), ((TUREAD, "r"),), ((TUWRITE, "w"),), ((TUEXEC|TSUID, "s"), (TSUID, "S"), (TUEXEC, "x")), ((TGREAD, "r"),), ((TGWRITE, "w"),), ((TGEXEC|TSGID, "s"), (TSGID,... | def copyfileobj(src, dst, length=None): """Copy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. """ if length == 0: return if length is None: shutil.copyfileobj(src, dst) return BUFSIZE = 16 * 1024 blocks, remainder = divmod(length, BUFSIZE) for b in xrange(blocks): buf = src.... | c5ffa82ed17230e5ba7c9259db606ac64bbb4806 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5ffa82ed17230e5ba7c9259db606ac64bbb4806/tarfile.py |
s = "" for t in filemode_table: while True: if mode & t[0] == t[0]: s += t[1] elif len(t) > 2: t = t[2:] continue else: s += "-" break return s | perm = [] for table in filemode_table: for bit, char in table: if mode & bit == bit: perm.append(char) break else: perm.append("-") return "".join(perm) | def filemode(mode): """Convert a file's mode to a string of the form -rwxrwxrwx. Used by TarFile.list() """ s = "" for t in filemode_table: while True: if mode & t[0] == t[0]: s += t[1] elif len(t) > 2: t = t[2:] continue else: s += "-" break return s | c5ffa82ed17230e5ba7c9259db606ac64bbb4806 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5ffa82ed17230e5ba7c9259db606ac64bbb4806/tarfile.py |
assert u"%r, %r" % (u"abc", "abc") == u"u'abc', 'abc'" | value = u"%r, %r" % (u"abc", "abc") if value != u"u'abc', 'abc'": print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")' | test('capwords', u'abc\t def \nghi', u'Abc Def Ghi') | 6b096315daae01cf10bf6b6f3074de1bb0c20fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b096315daae01cf10bf6b6f3074de1bb0c20fec/test_unicode.py |
assert u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"} == u'abc, def' | try: value = u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"} except KeyError: print '*** formatting failed for "%s"' % "u'abc, def'" else: assert value == u'abc, def' | test('capwords', u'abc\t def \nghi', u'Abc Def Ghi') | 6b096315daae01cf10bf6b6f3074de1bb0c20fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b096315daae01cf10bf6b6f3074de1bb0c20fec/test_unicode.py |
raise AssertionError, "'...%s......' % u'abc' failed to raise an exception" | print "*** formatting failed ...%s......' % u'abc' failed to raise an exception" | test('capwords', u'abc\t def \nghi', u'Abc Def Ghi') | 6b096315daae01cf10bf6b6f3074de1bb0c20fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b096315daae01cf10bf6b6f3074de1bb0c20fec/test_unicode.py |
def checkit(source, opts, morecmds=[]): """Check the LaTeX formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters ... | 2895447fca2aef1afccba7ad2a4ca58238b78043 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2895447fca2aef1afccba7ad2a4ca58238b78043/texcheck.py | ||
print 'Done checking %d lines.' % (lineno,) | print 'Done checking %d lines.' % (lastline,) | def checkit(source, opts, morecmds=[]): """Check the LaTeX formatting in a sequence of lines. Opts is a mapping of options to option values if any: -m munge parenthesis and brackets -f forward slash warnings to be skipped -d delimiters only checking -v verbose listing on delimiters ... | 2895447fca2aef1afccba7ad2a4ca58238b78043 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2895447fca2aef1afccba7ad2a4ca58238b78043/texcheck.py |
_cleanup() | for inst in _active[:]: inst.wait() | def _test(): teststr = "abc\n" print "testing popen2..." r, w = popen2('cat') w.write(teststr) w.close() assert r.read() == teststr print "testing popen3..." r, w, e = popen3(['cat']) w.write(teststr) w.close() assert r.read() == teststr assert e.read() == "" _cleanup() assert not _active print "All OK" | 0fc4a406432343eafbe88ca5ad132112e7bb1559 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0fc4a406432343eafbe88ca5ad132112e7bb1559/popen2.py |
saved_dist_files = self.distributuion.dist_files[:] | saved_dist_files = self.distribution.dist_files[:] | def run (self): | a6e7ef2744130450543d0189a51bfd9f89038050 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a6e7ef2744130450543d0189a51bfd9f89038050/bdist_rpm.py |
if data[0][-1] in (',', '.') or data[0].lower() in _daynames: | if data[0].endswith(',') or data[0].lower() in _daynames: | def parsedate_tz(data): """Convert a date string to a time tuple. Accounts for military timezones. """ data = data.split() if data[0][-1] in (',', '.') or data[0].lower() in _daynames: # There's a dayname here. Skip it del data[0] if len(data) == 3: # RFC 850 date, deprecated stuff = data[0].split('-') if len(stuff) =... | f8f431d3443fe9e5d94fc6c1b9aeb75b1d2d6b65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f8f431d3443fe9e5d94fc6c1b9aeb75b1d2d6b65/_parseaddr.py |
if inst.poll(_deadstate=sys.maxint) >= 0: | res = inst.poll(_deadstate=sys.maxint) if res is not None and res >= 0: | def _cleanup(): for inst in _active[:]: if inst.poll(_deadstate=sys.maxint) >= 0: try: _active.remove(inst) except ValueError: # This can happen if two threads create a new Popen instance. # It's harmless that it was already removed, so ignore. pass | fa26ce2dc62c8f19c06bb9e5ec244a34fe28c6cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa26ce2dc62c8f19c06bb9e5ec244a34fe28c6cd/subprocess.py |
self._dkeys = self._dict.keys() self._dkeys.sort() | def __init__(self, *args): unittest.TestCase.__init__(self, *args) self._dkeys = self._dict.keys() self._dkeys.sort() | e77de0e1a5b6f2edbb35d3ba3573344546f33727 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e77de0e1a5b6f2edbb35d3ba3573344546f33727/test_dumbdbm.py | |
_delete_files() | def test_dumbdbm_creation(self): _delete_files() f = dumbdbm.open(_fname, 'c') self.assertEqual(f.keys(), []) for key in self._dict: f[key] = self._dict[key] self.read_helper(f) f.close() | e77de0e1a5b6f2edbb35d3ba3573344546f33727 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e77de0e1a5b6f2edbb35d3ba3573344546f33727/test_dumbdbm.py | |
self.assertEqual(keys, self._dkeys) | dkeys = self._dict.keys() dkeys.sort() self.assertEqual(keys, dkeys) | def keys_helper(self, f): keys = f.keys() keys.sort() self.assertEqual(keys, self._dkeys) return keys | e77de0e1a5b6f2edbb35d3ba3573344546f33727 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e77de0e1a5b6f2edbb35d3ba3573344546f33727/test_dumbdbm.py |
if stdin == None and stdout == None and stderr == None: | if stdin is None and stdout is None and stderr is None: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin == None and stdout == None and stderr == None: return (None, None, None, None, None, None) | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stdin == None: | if stdin is None: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin == None and stdout == None and stderr == None: return (None, None, None, None, None, None) | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
elif type(stdin) == int: | elif isinstance(stdin, int): | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin == None and stdout == None and stderr == None: return (None, None, None, None, None, None) | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stdout == None: | if stdout is None: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin == None and stdout == None and stderr == None: return (None, None, None, None, None, None) | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
elif type(stdout) == int: | elif isinstance(stdout, int): | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin == None and stdout == None and stderr == None: return (None, None, None, None, None, None) | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stderr == None: | if stderr is None: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin == None and stdout == None and stderr == None: return (None, None, None, None, None, None) | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
elif type(stderr) == int: | elif isinstance(stderr, int): | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin == None and stdout == None and stderr == None: return (None, None, None, None, None, None) | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if startupinfo == None: | if startupinfo is None: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)""" | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if p2cread != None: | if p2cread is not None: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)""" | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if c2pwrite != None: | if c2pwrite is not None: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)""" | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if errwrite != None: | if errwrite is not None: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)""" | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if self.returncode == None: | if self.returncode is None: | def poll(self): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode == None: if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0: self.returncode = GetExitCodeProcess(self._handle) _active.remove(self) return self.returncode | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if self.returncode == None: | if self.returncode is None: | def wait(self): """Wait for child process to terminate. Returns returncode attribute.""" if self.returncode == None: obj = WaitForSingleObject(self._handle, INFINITE) self.returncode = GetExitCodeProcess(self._handle) _active.remove(self) return self.returncode | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if input != None: | if input is not None: | def communicate(self, input=None): """Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stdout != None: | if stdout is not None: | def communicate(self, input=None): """Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stderr != None: | if stderr is not None: | def communicate(self, input=None): """Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stdin == None: | if stdin is None: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ p2cread, p2cwrite = None, None c2pread, c2pwrite = None, None errread, errwrite = None, None | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
elif type(stdin) == int: | elif isinstance(stdin, int): | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ p2cread, p2cwrite = None, None c2pread, c2pwrite = None, None errread, errwrite = None, None | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stdout == None: | if stdout is None: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ p2cread, p2cwrite = None, None c2pread, c2pwrite = None, None errread, errwrite = None, None | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
elif type(stdout) == int: | elif isinstance(stdout, int): | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ p2cread, p2cwrite = None, None c2pread, c2pwrite = None, None errread, errwrite = None, None | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stderr == None: | if stderr is None: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ p2cread, p2cwrite = None, None c2pread, c2pwrite = None, None errread, errwrite = None, None | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
elif type(stderr) == int: | elif isinstance(stderr, int): | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ p2cread, p2cwrite = None, None c2pread, c2pwrite = None, None errread, errwrite = None, None | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if executable == None: | if executable is None: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (POSIX version)""" | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if cwd != None: | if cwd is not None: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (POSIX version)""" | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if env == None: | if env is None: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (POSIX version)""" | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if self.returncode == None: | if self.returncode is None: | def poll(self): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode == None: try: pid, sts = os.waitpid(self.pid, os.WNOHANG) if pid == self.pid: self._handle_exitstatus(sts) except os.error: pass return self.returncode | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if self.returncode == None: | if self.returncode is None: | def wait(self): """Wait for child process to terminate. Returns returncode attribute.""" if self.returncode == None: pid, sts = os.waitpid(self.pid, 0) self._handle_exitstatus(sts) return self.returncode | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stdout != None: | if stdout is not None: | def communicate(self, input=None): """Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
if stderr != None: | if stderr is not None: | def communicate(self, input=None): """Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. | d9d8e95d201f8665ecddddf49cd22a62908564ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d9d8e95d201f8665ecddddf49cd22a62908564ee/subprocess.py |
while True: | while self.pos < len(self.field): | def getaddrlist(self): """Parse all addresses. | 9918d0f2e74673e04e9e9f53bde21cb70cf8ed9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9918d0f2e74673e04e9e9f53bde21cb70cf8ed9a/_parseaddr.py |
break | result.append(('', '')) | def getaddrlist(self): """Parse all addresses. | 9918d0f2e74673e04e9e9f53bde21cb70cf8ed9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9918d0f2e74673e04e9e9f53bde21cb70cf8ed9a/_parseaddr.py |
exts.append( Extension('gestalt', ['gestaltmodule.c']) ) | exts.append( Extension('gestalt', ['gestaltmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | 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') | 499f43632dbd218075c4f07047e5f4bd10a9dd3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/499f43632dbd218075c4f07047e5f4bd10a9dd3c/setup.py |
exts.append( Extension('_CF', ['cf/_CFmodule.c']) ) exts.append( Extension('_Res', ['res/_Resmodule.c']) ) | exts.append( Extension('_CF', ['cf/_CFmodule.c'], extra_link_args=['-framework', 'CoreFoundation']) ) exts.append( Extension('_Res', ['res/_Resmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | 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') | 499f43632dbd218075c4f07047e5f4bd10a9dd3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/499f43632dbd218075c4f07047e5f4bd10a9dd3c/setup.py |
print time.strftime(LAST_CHANGED, time.localtime(now)) | print time.strftime(LAST_CHANGED, time.localtime(latest)) | def last_changed(self, files): | 62d7cc8895b1602d168334edb8a615f0c13f60cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62d7cc8895b1602d168334edb8a615f0c13f60cd/faqwiz.py |
code, modname = compilesuite(suite, major, minor, language, script, fname, basepackage) if modname: suitelist.append((code, modname)) | code, suite, fss, modname, precompinfo = precompilesuite(suite, basepackage) if not code: continue allprecompinfo = allprecompinfo + precompinfo suiteinfo = suite, fss, modname suitelist.append((code, modname)) allsuites.append(suiteinfo) for suiteinfo in allsuites: compilesuite(suiteinfo, major, minor, language, scrip... | def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) fss = macfs.FSSpec(fname) creatorsignature, dummy = fss.GetCreatorType() packagename = identify(os.path.basename(fname)) if la... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
fp.write("\t'%s' : '%s.%s',\n"%(code, packagename, modname)) | fp.write("\t'%s' : ('%s.%s', '%s'),\n"%(code, packagename, modname, modname)) | def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) fss = macfs.FSSpec(fname) creatorsignature, dummy = fss.GetCreatorType() packagename = identify(os.path.basename(fname)) if la... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
fp.write(",\n\t%s_Events"%modname) fp.write(",\n\taetools.TalkTo):\n") | fp.write(",\n\t\t%s_Events"%modname) fp.write(",\n\t\taetools.TalkTo):\n") | def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) fss = macfs.FSSpec(fname) creatorsignature, dummy = fss.GetCreatorType() packagename = identify(os.path.basename(fname)) if la... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
def compilesuite(suite, major, minor, language, script, fname, basepackage=None): """Generate code for a single suite""" | def precompilesuite(suite, basepackage=None): """Parse a single suite without generating the output. This step is needed so we can resolve recursive references by suites to enums/comps/etc declared in other suites""" | def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) fss = macfs.FSSpec(fname) creatorsignature, dummy = fss.GetCreatorType() packagename = identify(os.path.basename(fname)) if la... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
return None, None | return None, None, None, None, None | def compilesuite(suite, major, minor, language, script, fname, basepackage=None): """Generate code for a single suite""" [name, desc, code, level, version, events, classes, comps, enums] = suite modname = identify(name) if len(modname) > 28: modname = modname[:27] fss, ok = macfs.StandardPutFile('Python output file', ... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
fp = open(fss.as_pathname(), 'w') fss.SetCreatorType('Pyth', 'TEXT') fp.write('"""Suite %s: %s\n' % (name, desc)) fp.write("Level %d, version %d\n\n" % (level, version)) fp.write("Generated from %s\n"%fname) fp.write("AETE/AEUT resource version %d/%d, language %d, script %d\n" % \ (major, minor, language, script)) fp.... | def compilesuite(suite, major, minor, language, script, fname, basepackage=None): """Generate code for a single suite""" [name, desc, code, level, version, events, classes, comps, enums] = suite modname = identify(name) if len(modname) > 28: modname = modname[:27] fss, ok = macfs.StandardPutFile('Python output file', ... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py | |
fp.write('from %s import *\n'%basepackage._code_to_fullname[code]) | def compilesuite(suite, major, minor, language, script, fname, basepackage=None): """Generate code for a single suite""" [name, desc, code, level, version, events, classes, comps, enums] = suite modname = identify(name) if len(modname) > 28: modname = modname[:27] fss, ok = macfs.StandardPutFile('Python output file', ... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py | |
compileclassheader(fp, modname, basemodule) | def compilesuite(suite, major, minor, language, script, fname, basepackage=None): """Generate code for a single suite""" [name, desc, code, level, version, events, classes, comps, enums] = suite modname = identify(name) if len(modname) > 28: modname = modname[:27] fss, ok = macfs.StandardPutFile('Python output file', ... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py | |
if events: for event in events: compileevent(fp, event, enumsneeded) else: fp.write("\tpass\n\n") objc = ObjectCompiler(fp, basemodule) | for event in events: findenumsinevent(event, enumsneeded) objc = ObjectCompiler(None, basemodule) | def compilesuite(suite, major, minor, language, script, fname, basepackage=None): """Generate code for a single suite""" [name, desc, code, level, version, events, classes, comps, enums] = suite modname = identify(name) if len(modname) > 28: modname = modname[:27] fss, ok = macfs.StandardPutFile('Python output file', ... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
if module and hasattr(module, classname): fp.write("class %s(%s):\n\n"%(classname, classname)) | if module: modshortname = string.split(module.__name__, '.')[-1] baseclassname = '%s_Events'%modshortname fp.write("class %s(%s):\n\n"%(classname, baseclassname)) | def compileclassheader(fp, name, module=None): """Generate class boilerplate""" classname = '%s_Events'%name if module and hasattr(module, classname): fp.write("class %s(%s):\n\n"%(classname, classname)) else: fp.write("class %s:\n\n"%classname) | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
def __init__(self, fp, basesuite=None): | def __init__(self, fp, basesuite=None, othernamemappers=None): | def __init__(self, fp, basesuite=None): self.fp = fp self.propnames = {} self.classnames = {} self.propcodes = {} self.classcodes = {} self.compcodes = {} self.enumcodes = {} self.othersuites = [] self.basesuite = basesuite | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
self.propnames = {} self.classnames = {} self.propcodes = {} self.classcodes = {} self.compcodes = {} self.enumcodes = {} self.othersuites = [] | def __init__(self, fp, basesuite=None): self.fp = fp self.propnames = {} self.classnames = {} self.propcodes = {} self.classcodes = {} self.compcodes = {} self.enumcodes = {} self.othersuites = [] self.basesuite = basesuite | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py | |
if type == 'property': if self.propcodes.has_key(code): return self.propcodes[code], self.propcodes[code], None if self.basesuite and self.basesuite._propdeclarations.has_key(code): name = self.basesuite._propdeclarations[code].__name__ return name, name, None for s in self.othersuites: if s._propdeclarations.has_k... | for mapper in self.namemappers: if mapper.hascode(type, code): return mapper.findcodename(type, code) for mapper in self.othernamemappers: if mapper.hascode(type, code): self.othernamemappers.remove(mapper) self.namemappers.append(mapper) if self.fp: self.fp.write("import %s\n"%mapper.modulename) break else: if sel... | def findcodename(self, type, code): while 1: if type == 'property': # First we check whether we ourselves have defined it if self.propcodes.has_key(code): return self.propcodes[code], self.propcodes[code], None # Next we check whether our base suite module has defined it if self.basesuite and self.basesuite._propdeclar... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
if self.classcodes.has_key(code): | if self.namemappers[0].hascode('class', code): | def compileclass(self, cls): [name, code, desc, properties, elements] = cls pname = identify(name) if self.classcodes.has_key(code): # plural forms and such self.fp.write("\n%s = %s\n"%(pname, self.classcodes[code])) self.classnames[pname] = code else: self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
self.fp.write("\n%s = %s\n"%(pname, self.classcodes[code])) self.classnames[pname] = code | othername, dummy, dummy = self.namemappers[0].findcodename('class', code) if self.fp: self.fp.write("\n%s = %s\n"%(pname, othername)) | def compileclass(self, cls): [name, code, desc, properties, elements] = cls pname = identify(name) if self.classcodes.has_key(code): # plural forms and such self.fp.write("\n%s = %s\n"%(pname, self.classcodes[code])) self.classnames[pname] = code else: self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.fp.write('\t"""%s - %s """\n' % (name, desc)) self.fp.write('\twant = %s\n' % `code`) self.classnames[pname] = code self.classcodes[code] = pname | if self.fp: self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.fp.write('\t"""%s - %s """\n' % (name, desc)) self.fp.write('\twant = %s\n' % `code`) self.namemappers[0].addnamecode('class', pname, code) | def compileclass(self, cls): [name, code, desc, properties, elements] = cls pname = identify(name) if self.classcodes.has_key(code): # plural forms and such self.fp.write("\n%s = %s\n"%(pname, self.classcodes[code])) self.classnames[pname] = code else: self.fp.write('\nclass %s(aetools.ComponentItem):\n' % pname) self.... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
if self.propcodes.has_key(code): self.fp.write(" | if self.namemappers[0].hascode('property', code): if self.fp: self.fp.write(" | def compileproperty(self, prop): [name, code, what] = prop if code == 'c@#!': # Something silly with plurals. Skip it. return pname = identify(name) if self.propcodes.has_key(code): self.fp.write("# repeated property %s %s\n"%(pname, what[1])) else: self.fp.write("class %s(aetools.NProperty):\n" % pname) self.fp.write(... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
self.fp.write("class %s(aetools.NProperty):\n" % pname) self.fp.write('\t"""%s - %s """\n' % (name, what[1])) self.fp.write("\twhich = %s\n" % `code`) self.fp.write("\twant = %s\n" % `what[0]`) self.propnames[pname] = code self.propcodes[code] = pname | if self.fp: self.fp.write("class %s(aetools.NProperty):\n" % pname) self.fp.write('\t"""%s - %s """\n' % (name, what[1])) self.fp.write("\twhich = %s\n" % `code`) self.fp.write("\twant = %s\n" % `what[0]`) self.namemappers[0].addnamecode('property', pname, code) | def compileproperty(self, prop): [name, code, what] = prop if code == 'c@#!': # Something silly with plurals. Skip it. return pname = identify(name) if self.propcodes.has_key(code): self.fp.write("# repeated property %s %s\n"%(pname, what[1])) else: self.fp.write("class %s(aetools.NProperty):\n" % pname) self.fp.write(... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
self.fp.write(" | if self.fp: self.fp.write(" | def compileelement(self, elem): [code, keyform] = elem self.fp.write("# element %s as %s\n" % (`code`, keyform)) | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
if self.classcodes[code] != cname: | if self.namemappers[0].hascode('class', code) and \ self.namemappers[0].findcodename('class', code)[0] != cname: | def fillclasspropsandelems(self, cls): [name, code, desc, properties, elements] = cls cname = identify(name) if self.classcodes[code] != cname: # This is an other name (plural or so) for something else. Skip. return plist = [] elist = [] for prop in properties: [pname, pcode, what] = prop if pcode == 'c@#!': continue p... | b18e37723e6f3e7fe6bae03f14e954721df23eaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b18e37723e6f3e7fe6bae03f14e954721df23eaf/gensuitemodule.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.