rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if login and password:
if password:
# Look for a machine, default, or macdef top-level keyword
b34ef94d460ec0dcf8bdd12da8834bf097f826f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b34ef94d460ec0dcf8bdd12da8834bf097f826f6/netrc.py
self.para.words.append(self.nextfont, text, \ self.d.textwidth(text), space, space, \ self.ascent, self.descent)
self.para.words.append((self.nextfont, text, self.d.textwidth(text), space, space, self.ascent, self.descent))
def addword(self, text, space): if self.nospace and not text: return self.nospace = 0 self.blanklines = 0 if not self.para: self.para = self.newpara() self.para.indent_left = self.leftindent self.para.just = self.just self.nextfont = self.font space = int(space * self.space) self.para.words.append(self.nextfont, text, ...
d28de23bda3a6badc23f7b693a5e6982eb4cc9db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d28de23bda3a6badc23f7b693a5e6982eb4cc9db/fmt.py
self.window.show( \
self.window.show(
def showanchor(self, id): for i in range(len(self.paralist)): p = self.paralist[i] if p.hasanchor(id): long1 = i, 0 long2 = i, len(p.extract()) hit = long1, long2 self.setselection(hit) self.window.show( \ (p.left, p.top), (p.right, p.bottom)) break
d28de23bda3a6badc23f7b693a5e6982eb4cc9db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d28de23bda3a6badc23f7b693a5e6982eb4cc9db/fmt.py
sys.ps1 = "[DEBUG ON]>>> "
sys.ps1 = "[DEBUG ON]\n>>> "
def open_debugger(self): import Debugger self.interp.setdebugger(Debugger.Debugger(self)) sys.ps1 = "[DEBUG ON]>>> " self.showprompt() self.top.tkraise() self.text.focus_set()
adfe773d2c0ab1aa9f692956ed8f7fec0caaf940 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/adfe773d2c0ab1aa9f692956ed8f7fec0caaf940/PyShell.py
self.top.tkraise() self.text.focus_set()
def open_debugger(self): import Debugger self.interp.setdebugger(Debugger.Debugger(self)) sys.ps1 = "[DEBUG ON]>>> " self.showprompt() self.top.tkraise() self.text.focus_set()
adfe773d2c0ab1aa9f692956ed8f7fec0caaf940 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/adfe773d2c0ab1aa9f692956ed8f7fec0caaf940/PyShell.py
return '<Coerce %s>' % self.arg
return '<CoerceNumber %s>' % repr(self.arg)
def __repr__(self): return '<Coerce %s>' % self.arg
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
if isinstance(other, Coerce):
if isinstance(other, CoerceNumber):
def __coerce__(self, other): if isinstance(other, Coerce): return self.arg, other.arg else: return (self.arg, other)
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
class Cmp:
class MethodNumber:
def __coerce__(self, other): if isinstance(other, Coerce): return self.arg, other.arg else: return (self.arg, other)
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
return '<Cmp %s>' % self.arg
return '<MethodNumber %s>' % repr(self.arg) def __add__(self,other): return self.arg + other def __radd__(self,other): return other + self.arg def __sub__(self,other): return self.arg - other def __rsub__(self,other): return other - self.arg def __mul__(self,other): return self.arg * other def __rmul__(self,other...
def __repr__(self): return '<Cmp %s>' % self.arg
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
class RCmp: def __init__(self,arg): self.arg = arg
def __cmp__(self, other): return cmp(self.arg, other)
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
def __repr__(self): return '<RCmp %s>' % self.arg
candidates = [ 2, 2.2, 2L, 2+4j, [1], (2,), None, MethodNumber(1), CoerceNumber(8)]
def __repr__(self): return '<RCmp %s>' % self.arg
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
def __rcmp__(self, other): return cmp(other, self.arg)
infix_binops = [ '+', '-', '*', '/', '**', '%' ] prefix_binops = [ 'divmod' ]
def __rcmp__(self, other): return cmp(other, self.arg)
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
candidates = [2, 2.2, 2L, 2+4j, [1], (2,), None, Empty(), Coerce(3), Cmp(4), RCmp(5)] def test():
def do_infix_binops():
def __rcmp__(self, other): return cmp(other, self.arg)
fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py
def swig_sources (self, sources):
f3bd747c4e36dd067de98dfc9c96ffb49a64d920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3bd747c4e36dd067de98dfc9c96ffb49a64d920/build_ext.py
new_sources.append(base + ".c")
new_sources.append(base + target_ext)
def swig_sources (self, sources):
f3bd747c4e36dd067de98dfc9c96ffb49a64d920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3bd747c4e36dd067de98dfc9c96ffb49a64d920/build_ext.py
swig_cmd = [swig, "-python", "-dnone", "-ISWIG"]
swig_cmd = [swig, "-python", "-dnone", "-ISWIG"] if self.swig_cpp: swig_cmd.append ("-c++")
def swig_sources (self, sources):
f3bd747c4e36dd067de98dfc9c96ffb49a64d920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3bd747c4e36dd067de98dfc9c96ffb49a64d920/build_ext.py
self.announce ("swigging %s to %s" % (src, obj)) self.spawn(swig_cmd + ["-o", swig_targets[source], source])
target = swig_targets[source] self.announce ("swigging %s to %s" % (source, target)) self.spawn(swig_cmd + ["-o", target, source])
def swig_sources (self, sources):
f3bd747c4e36dd067de98dfc9c96ffb49a64d920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3bd747c4e36dd067de98dfc9c96ffb49a64d920/build_ext.py
def msvc_prelink_hack (self, sources, ext, extra_args):
f3bd747c4e36dd067de98dfc9c96ffb49a64d920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3bd747c4e36dd067de98dfc9c96ffb49a64d920/build_ext.py
/* 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 []
#ifdef WITHOUT_FRAMEWORKS
2aadb891e7c8192ad538413e13caa0c59fb720ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2aadb891e7c8192ad538413e13caa0c59fb720ec/mltescan.py
// ADD declarations //extern PyObject *_CFTypeRefObj_New(CFTypeRef); //extern int _CFTypeRefObj_Convert(PyObject *, CFTypeRef *);
def makeblacklisttypes(self): return [ "TXNTab", "TXNMargins", "TXNControlData", "TXNATSUIFeatures", "TXNATSUIVariations", "TXNAttributeData", "TXNTypeAttributes", "TXNMatchTextRecord", "TXNBackground", "UniChar", "TXNFindUPP", ]
#ifdef WITHOUT_FRAMEWORKS
2aadb891e7c8192ad538413e13caa0c59fb720ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2aadb891e7c8192ad538413e13caa0c59fb720ec/mltescan.py
// // /* ** 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")]), ] if __name__ == "__main__": main()
#ifdef NOTYET_USE_TOOLBOX_OBJECT_GLUE
2aadb891e7c8192ad538413e13caa0c59fb720ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2aadb891e7c8192ad538413e13caa0c59fb720ec/mltescan.py
text = text.translate(self.whitespace_trans)
if isinstance(text, str): text = text.translate(self.whitespace_trans) elif isinstance(text, unicode): text = text.translate(self.unicode_whitespace_trans)
def _munge_whitespace(self, text): """_munge_whitespace(text : string) -> string
2e74541d7e715f3333a3d2bf0e9cac79f3871e0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e74541d7e715f3333a3d2bf0e9cac79f3871e0c/textwrap.py
args=(), kwargs={}, verbose=None):
args=(), kwargs=None, verbose=None):
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}, verbose=None): assert group is None, "group argument must be None for now" _Verbose.__init__(self, verbose) self.__target = target self.__name = str(name or _newname()) self.__args = args self.__kwargs = kwargs self.__daemonic = self._set_daemon...
a4a8b820aa32638e9f65efcb73e7559dad76028f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4a8b820aa32638e9f65efcb73e7559dad76028f/threading.py
def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail
7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py
for tz in ('UTC','GMT','Luna/Tycho'): environ['TZ'] = 'US/Eastern' time.tzset() environ['TZ'] = tz time.tzset() self.failUnlessEqual( time.gmtime(xmas2002),time.localtime(xmas2002) ) self.failUnlessEqual(time.timezone,time.altzone) self.failUnlessEqual(time.daylight,0) self.failUnlessEqual(time.timezone,0) self.failUnl...
environ['TZ'] = eastern time.tzset() environ['TZ'] = utc time.tzset() self.failUnlessEqual( time.gmtime(xmas2002), time.localtime(xmas2002) ) self.failUnlessEqual(time.daylight, 0) self.failUnlessEqual(time.timezone, 0) self.failUnlessEqual(time.localtime(xmas2002).tm_isdst, 0)
def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail
7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py
environ['TZ'] = 'US/Eastern'
environ['TZ'] = eastern
def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail
7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py
self.failIfEqual(time.gmtime(xmas2002),time.localtime(xmas2002)) self.failUnlessEqual(time.tzname,('EST','EDT')) self.failUnlessEqual(len(time.tzname),2) self.failUnlessEqual(time.daylight,1) self.failUnlessEqual(time.timezone,18000) self.failUnlessEqual(time.altzone,14400) self.failUnlessEqual(time.localtime(xmas2002)...
self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) self.failUnlessEqual(time.tzname, ('EST', 'EDT')) self.failUnlessEqual(len(time.tzname), 2) self.failUnlessEqual(time.daylight, 1) self.failUnlessEqual(time.timezone, 18000) self.failUnlessEqual(time.altzone, 14400) self.failUnlessEqual(time.localtime(xm...
def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail
7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py
environ['TZ'] = 'Australia/Melbourne'
environ['TZ'] = victoria
def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail
7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py
self.failIfEqual(time.gmtime(xmas2002),time.localtime(xmas2002)) self.failUnless(time.tzname[0] in ('EST','AEST')) self.failUnless(time.tzname[1] in ('EST','EDT','AEDT')) self.failUnlessEqual(len(time.tzname),2) self.failUnlessEqual(time.daylight,1) self.failUnlessEqual(time.timezone,-36000) self.failUnlessEqual(time.a...
self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) self.failUnless(time.tzname[0] == 'AEST', str(time.tzname[0])) self.failUnless(time.tzname[1] == 'AEDT', str(time.tzname[1])) self.failUnlessEqual(len(time.tzname), 2) self.failUnlessEqual(time.daylight, 1) self.failUnlessEqual(time.timezone, -36000) sel...
def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail
7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py
del environ['TZ'] time.tzset() if time.timezone == 0: environ['TZ'] = 'US/Eastern' else: environ['TZ'] = 'UTC' time.tzset() nonlocal = time.localtime(xmas2002) del environ['TZ'] time.tzset() local = time.localtime(xmas2002) self.failIfEqual(local,nonlocal) self.failUnlessEqual(len(time.tzname),2) time.daylight t...
def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail
7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py
def __delitem__(self, key): del self.data[key.upper()]
try: unsetenv except NameError: def __delitem__(self, key): del self.data[key.upper()] else: def __delitem__(self, key): unsetenv(key) del self.data[key.upper()]
def __delitem__(self, key): del self.data[key.upper()]
c524d952da928f745203876f2e67f651c2bc7246 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c524d952da928f745203876f2e67f651c2bc7246/os.py
class MissingSectionHeaderError(Error):
class InterpolationDepthError(Error): def __init__(self, option, section, rawval): Error.__init__(self, "Value interpolation too deeply recursive:\n" "\tsection: [%s]\n" "\toption : %s\n" "\trawval : %s\n" % (section, option, rawval)) self.option = option self.section = section class ParsingError(Error): def __init__(...
def __init__(self, reference, option, section, rawval): Error.__init__(self, "Bad value substitution:\n" "\tsection: [%s]\n" "\toption : %s\n" "\tkey : %s\n" "\trawval : %s\n" % (section, option, reference, rawval)) self.reference = reference self.option = option self.section = section
2a37f9f862b81056601584f53a2d5ef88c85d566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a37f9f862b81056601584f53a2d5ef88c85d566/ConfigParser.py
class ParsingError(Error): def __init__(self, filename): Error.__init__(self, 'File contains parsing errors: %s' % filename) self.filename = filename self.errors = [] def append(self, lineno, line): self.errors.append((lineno, line)) self._msg = self._msg + '\n\t[line %2d]: %s' % (lineno, line)
def __init__(self, filename, lineno, line): Error.__init__( self, 'File contains no section headers.\nfile: %s, line: %d\n%s' % (filename, lineno, line)) self.filename = filename self.lineno = lineno self.line = line
2a37f9f862b81056601584f53a2d5ef88c85d566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a37f9f862b81056601584f53a2d5ef88c85d566/ConfigParser.py
return self.__sections.has_key(section)
return section in self.sections()
def has_section(self, section): """Indicate whether the named section is present in the configuration.
2a37f9f862b81056601584f53a2d5ef88c85d566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a37f9f862b81056601584f53a2d5ef88c85d566/ConfigParser.py
try: opts = self.__sections[section] except KeyError: raise NoSectionError(section) return opts.has_key(option)
return option in self.options(section)
def has_option(self, section, option): """Return whether the given section has the given option.""" try: opts = self.__sections[section] except KeyError: raise NoSectionError(section) return opts.has_key(option)
2a37f9f862b81056601584f53a2d5ef88c85d566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a37f9f862b81056601584f53a2d5ef88c85d566/ConfigParser.py
def get(self, section, option, raw=0, vars=None): """Get an option value for a given section.
2a37f9f862b81056601584f53a2d5ef88c85d566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a37f9f862b81056601584f53a2d5ef88c85d566/ConfigParser.py
return value
break if value.find("%(") >= 0: raise InterpolationDepthError(option, section, rawval) return value
def get(self, section, option, raw=0, vars=None): """Get an option value for a given section.
2a37f9f862b81056601584f53a2d5ef88c85d566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a37f9f862b81056601584f53a2d5ef88c85d566/ConfigParser.py
r'(?P<header>[-\w_.*,(){}]+)'
r'(?P<header>[-\w_.*,(){} ]+)'
def remove_section(self, section): """Remove a file section.""" if self.__sections.has_key(section): del self.__sections[section] return 1 else: return 0
2a37f9f862b81056601584f53a2d5ef88c85d566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a37f9f862b81056601584f53a2d5ef88c85d566/ConfigParser.py
gen.startElementNS((ns_uri, "doc"), "ns:doc", {}) gen.endElementNS((ns_uri, "doc"), "ns:doc")
gen.startElementNS((ns_uri, "doc"), "ns1:doc", {}) gen.endElementNS((ns_uri, "doc"), "ns1:doc")
def test_xmlgen_ns(): result = StringIO() gen = XMLGenerator(result) gen.startDocument() gen.startPrefixMapping("ns1", ns_uri) gen.startElementNS((ns_uri, "doc"), "ns:doc", {}) gen.endElementNS((ns_uri, "doc"), "ns:doc") gen.endPrefixMapping("ns1") gen.endDocument() return result.getvalue() == start + ('<ns1:doc xmln...
6a7768ae4f90a79d79f4221f676281021f5f6f69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6a7768ae4f90a79d79f4221f676281021f5f6f69/test_sax.py
formlength = formlength - 8 - chunk.chunksize if chunk.chunksize & 1: formlength = formlength - 1
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ...
4150ede53c42edb3e77373414f9c6ee070bfa366 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4150ede53c42edb3e77373414f9c6ee070bfa366/aifc.py
def gather(self): "Collect and return the contents of the window." result = "" for y in range(self.maxy+1): self.win.move(y, 0) stop = self._end_of_line(y) #sys.stderr.write("y=%d, _end_of_line(y)=%d\n" % (y, stop)) if stop == 0 and self.stripspaces: continue for x in range(self.maxx+1): if self.stripspaces and x == st...
9d51fc89729b1438a0e7c873bac8e919c4863cb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9d51fc89729b1438a0e7c873bac8e919c4863cb6/textpad.py
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
def page(self, title, contents): """Format an HTML page.""" return '''
59ed448bc64219e7db140b5c9e3c819703184a10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59ed448bc64219e7db140b5c9e3c819703184a10/pydoc.py
<table width="100%%" cellspacing=0 cellpadding=2 border=0>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
def heading(self, title, fgcol, bgcol, extras=''): """Format a page heading.""" return '''
59ed448bc64219e7db140b5c9e3c819703184a10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59ed448bc64219e7db140b5c9e3c819703184a10/pydoc.py
<p><table width="100%%" cellspacing=0 cellpadding=2 border=0>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
def section(self, title, fgcol, bgcol, contents, width=10, prelude='', marginalia=None, gap='&nbsp;&nbsp;'): """Format a section with a heading.""" if marginalia is None: marginalia = '<tt>' + '&nbsp;' * width + '</tt>' result = '''
59ed448bc64219e7db140b5c9e3c819703184a10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59ed448bc64219e7db140b5c9e3c819703184a10/pydoc.py
return '<table width="100%%"><tr>%s</tr></table>' % result
return '<table width="100%%" summary="list"><tr>%s</tr></table>' % result
def multicolumn(self, list, format, cols=4): """Format a list of items into a multi-column list.""" result = '' rows = (len(list)+cols-1)/cols for col in range(cols): result = result + '<td width="%d%%" valign=top>' % (100/cols) for i in range(rows*col, rows*col+rows): if i < len(list): result = result + format(list[i]...
59ed448bc64219e7db140b5c9e3c819703184a10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59ed448bc64219e7db140b5c9e3c819703184a10/pydoc.py
decl = '<em>lambda</em>'
title = '<strong>%s</strong> <em>lambda</em> ' % name
def docroutine(self, object, name=None, mod=None, funcs={}, classes={}, methods={}, cl=None): """Produce HTML documentation for a function or method object.""" realname = object.__name__ name = name or realname anchor = (cl and cl.__name__ or '') + '-' + name note = '' skipdocs = 0 if inspect.ismethod(object): imclass ...
59ed448bc64219e7db140b5c9e3c819703184a10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59ed448bc64219e7db140b5c9e3c819703184a10/pydoc.py
# dlltool --dllname python15.dll --def python15.def \
70367d3a6caf2a26cc62243e696c5ce2beca32c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/70367d3a6caf2a26cc62243e696c5ce2beca32c9/cygwinccompiler.py
linker_so=('%s -mcygwin -mdll -static' %
linker_so=('%s -mcygwin -mdll' %
def __init__ (self, verbose=0, dry_run=0, force=0):
70367d3a6caf2a26cc62243e696c5ce2beca32c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/70367d3a6caf2a26cc62243e696c5ce2beca32c9/cygwinccompiler.py
linker_so='%s -mno-cygwin -mdll -static %s'
linker_so='%s -mno-cygwin -mdll %s'
def __init__ (self, verbose=0, dry_run=0, force=0):
70367d3a6caf2a26cc62243e696c5ce2beca32c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/70367d3a6caf2a26cc62243e696c5ce2beca32c9/cygwinccompiler.py
client address as self.client_request, and the server (in case it
client address as self.client_address, and the server (in case it
def process_request(self, request, client_address): """Start a new thread to process the request.""" import thread thread.start_new_thread(self.finish_request, (request, client_address))
fdb3d1a75e44bda10039376d0e94025633514b1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fdb3d1a75e44bda10039376d0e94025633514b1f/SocketServer.py
self.info = list(self.interesting_lines(1))
self.info = [(0, -1, "", False)]
def __init__(self, editwin): self.editwin = editwin self.text = editwin.text self.textfont = self.text["font"] self.label = None # Dummy line, which starts the "block" of the whole document: self.info = list(self.interesting_lines(1)) self.lastfirstline = 1 visible = idleConf.GetOption("extensions", "CodeContext", "vis...
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
There is a dummy block start, with indentation -1 and text "". Return the indent level, text (including leading whitespace), and the block opening keyword.
def get_line_info(self, linenum): """Get the line indent value, text, and any block start keyword
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
if linenum == 0: return -1, "", True
def get_line_info(self, linenum): """Get the line indent value, text, and any block start keyword
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline."""
def interesting_lines(self, firstline, stopline=1, stopindent=0): """ Find the context lines, starting at firstline. Will not return lines whose index is smaller than stopline or whose indentation is smaller than stopindent. stopline should always be >= 1, so the dummy block start will never be returned (This function ...
def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline.""" # The indentation level we are currently in: lastindent = INFINITY # For a line to be interesting, it must begin with a block opening # keyword, and have less indentation than lastindent. for line_index in xrange(...
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
for line_index in xrange(firstline, -1, -1):
for line_index in xrange(firstline, stopline-1, -1):
def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline.""" # The indentation level we are currently in: lastindent = INFINITY # For a line to be interesting, it must begin with a block opening # keyword, and have less indentation than lastindent. for line_index in xrange(...
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
if opener and line_index < firstline: yield line_index, text
if opener and line_index < firstline and indent >= stopindent: lines.append((line_index, indent, text, opener)) if lastindent <= stopindent: break lines.reverse() return lines, lastindent
def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline.""" # The indentation level we are currently in: lastindent = INFINITY # For a line to be interesting, it must begin with a block opening # keyword, and have less indentation than lastindent. for line_index in xrange(...
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
tmpstack = [] for line_index, text in self.interesting_lines(firstline): while self.info[-1][0] > line_index: del self.info[-1] if self.info[-1][0] == line_index: break tmpstack.append((line_index, text)) while tmpstack: self.info.append(tmpstack.pop())
def update_label(self): firstline = int(self.text.index("@0,0").split('.')[0]) if self.lastfirstline == firstline: return self.lastfirstline = firstline tmpstack = [] for line_index, text in self.interesting_lines(firstline): # Remove irrelevant self.info items, and when we reach a relevant # item (which must happen be...
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
[x[1] for x in self.info[-self.numlines:]]
[x[2] for x in self.info[-self.numlines:]]
def update_label(self): firstline = int(self.text.index("@0,0").split('.')[0]) if self.lastfirstline == firstline: return self.lastfirstline = firstline tmpstack = [] for line_index, text in self.interesting_lines(firstline): # Remove irrelevant self.info items, and when we reach a relevant # item (which must happen be...
74910225df9af42487009882543544e5d9c01988 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74910225df9af42487009882543544e5d9c01988/CodeContext.py
_res = (PyObject *)PyUnicode_FromUnicode(data, size);
_res = (PyObject *)PyUnicode_FromUnicode(data, size-1);
def outputRepr(self): Output() Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[100];") Output("""sprintf(buf, "<CFURL object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""") Output("return PyString_FromString(buf);") OutRbrace()
d9e50f554f4ce51681cc399e7ff55cd716898322 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d9e50f554f4ce51681cc399e7ff55cd716898322/cfsupport.py
OutLbrace() Output("OSErr _err = ResError();") Output("if (_err != noErr) return PyMac_Error(_err);") OutRbrace()
if self.returntype.__class__ != OSErrType: OutLbrace() Output("OSErr _err = ResError();") Output("if (_err != noErr) return PyMac_Error(_err);") OutRbrace()
def checkit(self): OutLbrace() Output("OSErr _err = ResError();") Output("if (_err != noErr) return PyMac_Error(_err);") OutRbrace() FunctionGenerator.checkit(self) # XXX
cb6cf13261cd7e9566e2682077a214f9788129bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cb6cf13261cd7e9566e2682077a214f9788129bd/ressupport.py
class ResFunction(ResMixIn, FunctionGenerator): pass class ResMethod(ResMixIn, MethodGenerator): pass
class ResFunction(ResMixIn, OSErrFunctionGenerator): pass class ResMethod(ResMixIn, OSErrMethodGenerator): pass
def checkit(self): OutLbrace() Output("OSErr _err = ResError();") Output("if (_err != noErr) return PyMac_Error(_err);") OutRbrace() FunctionGenerator.checkit(self) # XXX
cb6cf13261cd7e9566e2682077a214f9788129bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cb6cf13261cd7e9566e2682077a214f9788129bd/ressupport.py
"<function <lambda> at 0x"))
"<function <lambda"))
def test_lambda(self): self.failUnless(repr(lambda x: x).startswith( "<function <lambda> at 0x")) # XXX anonymous functions? see func_repr
dd32138e7dc66633b8804cd8e59ada5f9f5472c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dd32138e7dc66633b8804cd8e59ada5f9f5472c1/test_repr.py
dummy, fp = os.popen4(cmd, "r") dummy.close()
child = popen2.Popen4(cmd) child.tochild.close()
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 dummy, fp = os.popen4(cmd, "r") dummy.close() while 1: line = fp.readline() if not line: break if ...
450bd873ac9a7d44d24498b67cd111ce77334e85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/450bd873ac9a7d44d24498b67cd111ce77334e85/pimp.py
line = fp.readline()
line = child.fromchild.readline()
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 dummy, fp = os.popen4(cmd, "r") dummy.close() while 1: line = fp.readline() if not line: break if ...
450bd873ac9a7d44d24498b67cd111ce77334e85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/450bd873ac9a7d44d24498b67cd111ce77334e85/pimp.py
rv = fp.close() return rv
return child.wait()
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 dummy, fp = os.popen4(cmd, "r") dummy.close() while 1: line = fp.readline() if not line: break if ...
450bd873ac9a7d44d24498b67cd111ce77334e85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/450bd873ac9a7d44d24498b67cd111ce77334e85/pimp.py
return "install %s: running \"%s\" failed" % self.fullname()
return "install %s: running \"%s\" failed" % \ (self.fullname(), installcmd)
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-instal...
450bd873ac9a7d44d24498b67cd111ce77334e85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/450bd873ac9a7d44d24498b67cd111ce77334e85/pimp.py
u = madunicode(u"12345") verify(unicode(u) == u"12345")
base = u"12345" u = madunicode(base) verify(unicode(u) == base)
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__(u"".join(L)) return self._rev
7a29bd58614da9fc478d7167ba918d92c2dcca7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a29bd58614da9fc478d7167ba918d92c2dcca7e/test_descr.py
mod = __import__(modname, globals(), locals(), _import_tail)
mod = __import__('encodings.' + modname, globals(), locals(), _import_tail)
def search_function(encoding): # Cache lookup entry = _cache.get(encoding, _unknown) if entry is not _unknown: return entry # Import the module: # # First look in the encodings package, then try to lookup the # encoding in the aliases mapping and retry the import using the # default import module lookup scheme with t...
fc4c24c142bc86e457fe828c86defd1d7eceed65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fc4c24c142bc86e457fe828c86defd1d7eceed65/__init__.py
write32(self.fileobj, self.crc)
write32u(self.fileobj, LOWU32(self.crc))
def close(self): if self.mode == WRITE: self.fileobj.write(self.compress.flush()) write32(self.fileobj, self.crc) # self.size may exceed 2GB, or even 4GB write32u(self.fileobj, LOWU32(self.size)) self.fileobj = None elif self.mode == READ: self.fileobj = None if self.myfileobj: self.myfileobj.close() self.myfileobj = N...
62decc9f4966c060a3d4bcf762d8940d666496c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62decc9f4966c060a3d4bcf762d8940d666496c5/gzip.py
self.assertRaises(IndexError, s.__setitem__, -1, "bar") self.assertRaises(IndexError, s.__setitem__, 3, "bar")
self.assertRaises(IndexError, s.__delitem__, -1) self.assertRaises(IndexError, s.__delitem__, 3)
def test_delitem(self): s = self.type2test("foo") self.assertRaises(IndexError, s.__setitem__, -1, "bar") self.assertRaises(IndexError, s.__setitem__, 3, "bar") del s[0] self.assertEqual(s, "oo") del s[1] self.assertEqual(s, "o") del s[0] self.assertEqual(s, "")
1fd4db9c6cf100570736663923e20c7d619cc80c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1fd4db9c6cf100570736663923e20c7d619cc80c/test_userstring.py
"lib", "python" + sys.version[:3])
"lib", "python" + get_python_version())
def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the ...
0ff98b9346f77d6888c29e5c787c5b1b75023efc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ff98b9346f77d6888c29e5c787c5b1b75023efc/sysconfig.py
self.enter() self.dispatch(t.body) self.leave()
self.write(")") self.enter() self.dispatch(t.body) self.leave() def _For(self, t): self.fill("for ") self.dispatch(t.target) self.write(" in ") self.dispatch(t.iter) self.enter() self.dispatch(t.body) self.leave() if t.orelse: self.fill("else") self.enter() self.dispatch(t.orelse) self.leave
self.fill("def "+t.name + "(")
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
def _For(self, t): self.fill("for ") self.dispatch(t.target) self.write(" in ") self.dispatch(t.iter)
def _While(self, t): self.fill("while ") self.dispatch(t.test)
def _For(self, t): self.fill("for ") self.dispatch(t.target) self.write(" in ") self.dispatch(t.iter) self.enter() self.dispatch(t.body) self.leave() if t.orelse: self.fill("else") self.enter() self.dispatch(t.orelse) self.leave
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
"RShift":"<<", "BitOr":"|", "BitXor":"^", "BitAnd":"&", "FloorDiv":"//"}
"LShift":">>", "RShift":"<<", "BitOr":"|", "BitXor":"^", "BitAnd":"&", "FloorDiv":"//", "Pow": "**"}
def _UnaryOp(self, t): self.write(self.unop[t.op.__class__.__name__]) self.write("(") self.dispatch(t.operand) self.write(")")
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
self.dispatch(t.stararg)
self.dispatch(t.starargs)
def _Call(self, t): self.dispatch(t.func) self.write("(") comma = False for e in t.args: if comma: self.write(", ") else: comma = True self.dispatch(e) for e in t.keywords: if comma: self.write(", ") else: comma = True self.dispatch(e) if t.starargs: if comma: self.write(", ") else: comma = True self.write("*") self.di...
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
self.dispatch(t.stararg)
self.dispatch(t.kwargs)
def _Call(self, t): self.dispatch(t.func) self.write("(") comma = False for e in t.args: if comma: self.write(", ") else: comma = True self.dispatch(e) for e in t.keywords: if comma: self.write(", ") else: comma = True self.dispatch(e) if t.starargs: if comma: self.write(", ") else: comma = True self.write("*") self.di...
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
self.write("**"+self.kwarg) self.write(")") def roundtrip(filename):
self.write("**"+t.kwarg) def _keyword(self, t): self.write(t.arg) self.write("=") self.dispatch(t.value) def _Lambda(self, t): self.write("lambda ") self.dispatch(t.args) self.write(": ") self.dispatch(t.body) def roundtrip(filename, output=sys.stdout):
def _arguments(self, t): first = True nonDef = len(t.args)-len(t.defaults) for a in t.args[0:nonDef]: if first:first = False else: self.write(", ") self.dispatch(a) for a,d in zip(t.args[nonDef:], t.defaults): if first:first = False else: self.write(", ") self.dispatch(a), self.write("=") self.dispatch(d) if t.vararg: ...
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
Unparser(tree)
Unparser(tree, output) def testdir(a): try: names = [n for n in os.listdir(a) if n.endswith('.py')] except OSError: print >> sys.stderr, "Directory not readable: %s" % a else: for n in names: fullname = os.path.join(a, n) if os.path.isfile(fullname): output = cStringIO.StringIO() print 'Testing %s' % fullname try: r...
def roundtrip(filename): source = open(filename).read() tree = compile(source, filename, "exec", 0x400) Unparser(tree)
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
roundtrip(sys.argv[1])
main(sys.argv[1:])
def roundtrip(filename): source = open(filename).read() tree = compile(source, filename, "exec", 0x400) Unparser(tree)
3fa6c090d8767caf37aa07761e4c9d98f306d65d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3fa6c090d8767caf37aa07761e4c9d98f306d65d/unparse.py
else: raise TestFailed, '1 and 1 is false instead of false'
else: raise TestFailed, '1 and 1 is false instead of true'
def f(): pass
7dcf9f89d331f5445d4972fa186778ed868945bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7dcf9f89d331f5445d4972fa186778ed868945bc/test_types.py
pass
if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] elif type(self.include_dirs) is StringType: self.include_dirs = string.split(self.include_dirs, os.pathsep) if self.libraries is None: self.libraries = [] elif type(self.libraries) is StringType: self.libraries = [self.libraries] i...
def finalize_options (self): pass
2e38a50db173e61e9bf3ea0332645cb8f081dcc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e38a50db173e61e9bf3ea0332645cb8f081dcc5/config.py
o = PyString_FromStringAndSize((char *)&qd.arrow, sizeof(qd.arrow)); if (o == NULL || PyDict_SetItemString(d, "arrow", o) != 0) Py_FatalError("can't initialize Qd.arrow"); o = PyString_FromStringAndSize((char *)&qd.black, sizeof(qd.black)); if (o == NULL || PyDict_SetItemString(d, "black", o) != 0) Py_FatalError("can'...
o = QDGA_New(); if (o == NULL || PyDict_SetItemString(d, "qd", o) != 0) Py_FatalError("can't initialize Qd.qd");
def getargsCheck(self, name): pass
bdd0747193e9e08d94e146f65254a885bdb6178b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bdd0747193e9e08d94e146f65254a885bdb6178b/qdsupport.py
_sys.stderr.write("Exception in thread %s:\n%s\n" % (self.getName(), _format_exc()))
if _sys: _sys.stderr.write("Exception in thread %s:\n%s\n" % (self.getName(), _format_exc())) else: exc_type, exc_value, exc_tb = self.__exc_info() try: print>>self.__stderr, ( "Exception in thread " + self.getName() + " (most likely raised during interpreter shutdown):") print>>self.__stderr, ( "Traceback (most...
def __bootstrap(self): try: self.__started = True _active_limbo_lock.acquire() _active[_get_ident()] = self del _limbo[self] _active_limbo_lock.release() if __debug__: self._note("%s.__bootstrap(): thread started", self)
cc4e935ea593cede10cb1316e3faeabd708abca7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc4e935ea593cede10cb1316e3faeabd708abca7/threading.py
port.connect(HOST, PORT)
port.connect(host, PORT)
def main(): try: optlist, args = getopt.getopt(sys.argv[1:], 'ls') except getopt.error, msg: sys.stderr.write(msg + '\n') sys.exit(2) player = cd.open() prstatus(player) size = player.bestreadsize() if optlist: for opt, arg in optlist: if opt == '-l': prtrackinfo(player) elif opt == '-s': prstatus(player) return sys...
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
frame = 0
frame = '0'
def main(): try: optlist, args = getopt.getopt(sys.argv[1:], 'ls') except getopt.error, msg: sys.stderr.write(msg + '\n') sys.exit(2) player = cd.open() prstatus(player) size = player.bestreadsize() if optlist: for opt, arg in optlist: if opt == '-l': prtrackinfo(player) elif opt == '-s': prstatus(player) return sys...
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
min, sec, frame = player.getstatus()[5:8]
min, sec, frame = player.getstatus()[3]
def main(): try: optlist, args = getopt.getopt(sys.argv[1:], 'ls') except getopt.error, msg: sys.stderr.write(msg + '\n') sys.exit(2) player = cd.open() prstatus(player) size = player.bestreadsize() if optlist: for opt, arg in optlist: if opt == '-l': prtrackinfo(player) elif opt == '-s': prstatus(player) return sys...
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
start_min, start_sec, start_frame, \ total_min, total_sec, total_frame = info[i] print 'Track', zfill(i+1), \ triple(start_min, start_sec, start_frame), \ triple(total_min, total_sec, total_frame)
start, total = info[i] print 'Track', zfill(i+1), triple(start), triple(total)
def prtrackinfo(player): info = [] while 1: try: info.append(player.gettrackinfo(len(info) + 1)) except RuntimeError: break for i in range(len(info)): start_min, start_sec, start_frame, \ total_min, total_sec, total_frame = info[i] print 'Track', zfill(i+1), \ triple(start_min, start_sec, start_frame), \ triple(total_m...
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
state, track, min, sec, frame, abs_min, abs_sec, abs_frame, \ total_min, total_sec, total_frame, first, last, scsi_audio, \ cur_block, dum1, dum2, dum3 = player.getstatus()
state, track, curtime, abstime, totaltime, first, last, \ scsi_audio, cur_block, dummy = player.getstatus()
def prstatus(player): state, track, min, sec, frame, abs_min, abs_sec, abs_frame, \ total_min, total_sec, total_frame, first, last, scsi_audio, \ cur_block, dum1, dum2, dum3 = player.getstatus() print 'Status:', if 0 <= state < len(statedict): print statedict[state] else: print state print 'Track: ', track print 'Time:...
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
print 'Time: ', triple(min, sec, frame) print 'Abs: ', triple(abs_min, abs_sec, abs_frame) print 'Total: ', triple(total_min, total_sec, total_frame)
print 'Time: ', triple(curtime) print 'Abs: ', triple(abstime) print 'Total: ', triple(totaltime)
def prstatus(player): state, track, min, sec, frame, abs_min, abs_sec, abs_frame, \ total_min, total_sec, total_frame, first, last, scsi_audio, \ cur_block, dum1, dum2, dum3 = player.getstatus() print 'Status:', if 0 <= state < len(statedict): print statedict[state] else: print state print 'Track: ', track print 'Time:...
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
print 'Future:', (dum1, dum2, dum3)
print 'Future:', dummy
def prstatus(player): state, track, min, sec, frame, abs_min, abs_sec, abs_frame, \ total_min, total_sec, total_frame, first, last, scsi_audio, \ cur_block, dum1, dum2, dum3 = player.getstatus() print 'Status:', if 0 <= state < len(statedict): print statedict[state] else: print state print 'Track: ', track print 'Time:...
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
def triple(a, b, c):
def triple((a, b, c)):
def triple(a, b, c): return zfill(a) + ':' + zfill(b) + ':' + zfill(c)
f4be726da206ed1c34817a7b63a0c6e0281879ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4be726da206ed1c34817a7b63a0c6e0281879ee/sendcd.py
def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') header = input.read(AS_HEADER_LENGTH) try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header error: %s"%arg if verbose: print 'Magic: 0x%8.8x'%magic pr...
class AppleSingle(object): datafork = None resourcefork = None def __init__(self, fileobj, verbose=False): header = fileobj.read(AS_HEADER_LENGTH)
def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') # Should we also test for FSSpecs or FSRefs? header = input.read(AS_HEADER_LENGTH) try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header error: %s"%arg i...
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
id, offset, length = struct.unpack(AS_ENTRY_FORMAT, hdr)
magic, version, ig, nentry = struct.unpack(AS_HEADER_FORMAT, header)
def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') # Should we also test for FSSpecs or FSRefs? header = input.read(AS_HEADER_LENGTH) try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header error: %s"%arg i...
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
raise Error, "Unpack entry error: %s"%arg
raise Error, "Unpack header error: %s" % (arg,)
def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') # Should we also test for FSSpecs or FSRefs? header = input.read(AS_HEADER_LENGTH) try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header error: %s"%arg i...
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
print 'Fork %d, offset %d, length %d'%(id, offset, length) input.seek(offset) if length == 0: data = ''
print 'Magic: 0x%8.8x' % (magic,) print 'Version: 0x%8.8x' % (version,) print 'Entries: %d' % (nentry,) if magic != AS_MAGIC: raise Error, "Unknown AppleSingle magic number 0x%8.8x" % (magic,) if version != AS_VERSION: raise Error, "Unknown AppleSingle version number 0x%8.8x" % (version,) if nentry <= 0: raise Error,...
def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') # Should we also test for FSSpecs or FSRefs? header = input.read(AS_HEADER_LENGTH) try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header error: %s"%arg i...
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
data = input.read(length) if len(data) != length: raise Error, 'Short read: expected %d bytes got %d'%(length, len(data)) if id == AS_DATAFORK: if verbose: print ' (data fork)' if not resonly: didwork = 1 fp = open(output, 'wb') fp.write(data)
if self.datafork is not None: fp = open(path, 'wb') fp.write(self.datafork)
def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') # Should we also test for FSSpecs or FSRefs? header = input.read(AS_HEADER_LENGTH) try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header error: %s"%arg i...
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
elif id == AS_RESOURCEFORK: didwork = 1 if verbose: print ' (resource fork)' if resonly: fp = open(output, 'wb') else: fp = MacOS.openrf(output, 'wb') fp.write(data) fp.close() elif id in AS_IGNORE: if verbose: print ' (ignored)' else: raise Error, 'Unknown fork type %d'%id if not didwork: raise Error, 'No useful for...
if self.resourcefork is not None: fp = MacOS.openrf(path, '*wb') fp.write(self.resourcefork) fp.close() def decode(infile, outpath, resonly=False, verbose=False): """decode(infile, outpath [, resonly=False, verbose=False])
def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') # Should we also test for FSSpecs or FSRefs? header = input.read(AS_HEADER_LENGTH) try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header error: %s"%arg i...
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
resonly = 1
resonly = True
def _test(): if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4: print 'Usage: applesingle.py [-r] applesinglefile decodedfile' sys.exit(1) if sys.argv[1] == '-r': resonly = 1 del sys.argv[1] else: resonly = 0 decode(sys.argv[1], sys.argv[2], resonly=resonly)
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
resonly = 0
resonly = False
def _test(): if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4: print 'Usage: applesingle.py [-r] applesinglefile decodedfile' sys.exit(1) if sys.argv[1] == '-r': resonly = 1 del sys.argv[1] else: resonly = 0 decode(sys.argv[1], sys.argv[2], resonly=resonly)
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py
def _test(): if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4: print 'Usage: applesingle.py [-r] applesinglefile decodedfile' sys.exit(1) if sys.argv[1] == '-r': resonly = 1 del sys.argv[1] else: resonly = 0 decode(sys.argv[1], sys.argv[2], resonly=resonly)
3997f58a0c147cee83203ef731e2541c10557335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3997f58a0c147cee83203ef731e2541c10557335/applesingle.py