rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if isdir(name) and not islink(name):
st = os.lstat(name) if stat.S_ISDIR(st[stat.ST_MODE]):
def walk(top, func, arg): """walk(top,func,arg) calls func(arg, d, files) for each directory "d"
84a74595f784c5a6f8138bed0235a5b86d175edb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84a74595f784c5a6f8138bed0235a5b86d175edb/posixpath.py
y.__dict__.update(state)
if hasattr(y, '__setstate__'): y.__setstate__(state) else: y.__dict__.update(state)
def _reconstruct(x, info, deep, memo=None): if isinstance(info, str): return x assert isinstance(info, tuple) if memo is None: memo = {} n = len(info) assert n in (2, 3) callable, args = info[:2] if n > 2: state = info[2] else: state = {} if deep: args = deepcopy(args, memo) y = callable(*args) if state: if deep: state = deepcopy(state, memo) y.__dict__.update(state) return y
3e3583c345e35d72a394f751bbee33257880fbd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3e3583c345e35d72a394f751bbee33257880fbd4/copy.py
methods = Pack.__dict__.keys() methods = methods + Grid.__dict__.keys() methods = methods + Place.__dict__.keys()
methods = Pack.__dict__.keys() methods = methods + Grid.__dict__.keys() methods = methods + Place.__dict__.keys()
def __init__(self, master=None, cnf=None, **kw): if cnf is None: cnf = {} if kw: cnf = _cnfmerge((cnf, kw)) fcnf = {} for k in cnf.keys(): if type(k) == ClassType or k == 'name': fcnf[k] = cnf[k] del cnf[k] self.frame = apply(Frame, (master,), fcnf) self.vbar = Scrollbar(self.frame, name='vbar') self.vbar.pack(side=RIGHT, fill=Y) cnf['name'] = 'text' apply(Text.__init__, (self, self.frame), cnf) self.pack(side=LEFT, fill=BOTH, expand=1) self['yscrollcommand'] = self.vbar.set self.vbar['command'] = self.yview
1990943095b9fbb7cd7324a9cb36c4f757fd1288 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1990943095b9fbb7cd7324a9cb36c4f757fd1288/ScrolledText.py
newurl = basejoin("http:" + url, newurl)
newurl = basejoin(self.type + ":" + url, newurl)
def redirect_internal(self, url, fp, errcode, errmsg, headers, data): if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return void = fp.read() fp.close() # In case the server sent a relative URL, join with original: newurl = basejoin("http:" + url, newurl) if data is None: return self.open(newurl) else: return self.open(newurl, data)
5d87d4729596b0c385e3fa50581ee100396cae2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5d87d4729596b0c385e3fa50581ee100396cae2d/urllib.py
del _active[_get_ident()]
if _sys.modules.has_key('dummy_threading'): try: del _active[_get_ident()] except KeyError: pass else: del _active[_get_ident()]
def __delete(self): _active_limbo_lock.acquire() del _active[_get_ident()] _active_limbo_lock.release()
8b3d92a9777d7ea5805c5e3cf0d6b0474fab2d01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b3d92a9777d7ea5805c5e3cf0d6b0474fab2d01/threading.py
if (not check_intermediate) or len(plist) < 2:
if not check_intermediate:
def __init__(self, master, name, destroy_physically=1, check_intermediate=1): if check_intermediate: path = master._subwidget_name(name) try: path = path[len(master._w)+1:] plist = path.split('.') except: plist = []
0e64202fd7e8802fc99fff5243b06ca4602f7f94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0e64202fd7e8802fc99fff5243b06ca4602f7f94/Tix.py
elif o[-6:] == '.lproj': files = os.listdir(o) for f in files: if f[-4:] == '.nib': nibname = os.path.split(f)[1][:-4] cocoainfo = """ <key>NSMainNibFile</key> <string>%s</string> <key>NSPrincipalClass</key> <string>NSApplication</string>""" % nibname
def process_common_macho(template, progress, code, rsrcname, destname, is_update, raw=0, others=[]): # First make sure the name ends in ".app" if destname[-4:] != '.app': destname = destname + '.app' # Now deduce the short name shortname = os.path.split(destname)[1] if shortname[-4:] == '.app': # Strip the .app suffix shortname = shortname[:-4] # And deduce the .plist and .icns names plistname = None icnsname = None if rsrcname and rsrcname[-5:] == '.rsrc': tmp = rsrcname[:-5] plistname = tmp + '.plist' if os.path.exists(plistname): icnsname = tmp + '.icns' if not os.path.exists(icnsname): icnsname = None else: plistname = None # Start with copying the .app framework if not is_update: exceptlist = ["Contents/Info.plist", "Contents/Resources/English.lproj/InfoPlist.strings", "Contents/Resources/python.rsrc", ] copyapptree(template, destname, exceptlist, progress) # Now either use the .plist file or the default if progress: progress.label('Create info.plist') progress.inc(0) if plistname: shutil.copy2(plistname, os.path.join(destname, 'Contents', 'Info.plist')) if icnsname: icnsdest = os.path.split(icnsname)[1] icnsdest = os.path.join(destname, os.path.join('Contents', 'Resources', icnsdest)) shutil.copy2(icnsname, icnsdest) # XXXX Wrong. This should be parsed from plist file. Also a big hack:-) if shortname == 'PythonIDE': ownertype = 'Pide' else: ownertype = 'PytA' # XXXX Should copy .icns file else: cocoainfo = '' for o in others: if o[-4:] == '.nib': nibname = os.path.split(o)[1][:-4] cocoainfo = """ <key>NSMainNibFile</key> <string>%s</string> <key>NSPrincipalClass</key> <string>NSApplication</string>""" % nibname plistname = os.path.join(template, 'Contents', 'Resources', 'Applet-Info.plist') plistdata = open(plistname).read() plistdata = plistdata % {'appletname':shortname, 'cocoainfo':cocoainfo} ofp = open(os.path.join(destname, 'Contents', 'Info.plist'), 'w') ofp.write(plistdata) ofp.close() ownertype = 'PytA' # Create the PkgInfo file if progress: progress.label('Create PkgInfo') progress.inc(0) ofp = open(os.path.join(destname, 'Contents', 'PkgInfo'), 'wb') ofp.write('APPL' + ownertype) ofp.close() if progress: progress.label("Copy resources...") progress.set(20) resfilename = 'python.rsrc' # XXXX later: '%s.rsrc' % shortname try: output = Res.FSOpenResourceFile( os.path.join(destname, 'Contents', 'Resources', resfilename), u'', WRITE) except MacOS.Error: fsr, dummy = Res.FSCreateResourceFile( os.path.join(destname, 'Contents', 'Resources'), unicode(resfilename), '') output = Res.FSOpenResourceFile(fsr, u'', WRITE) # Copy the resources from the target specific resource template, if any typesfound, ownertype = [], None try: input = macresource.open_pathname(rsrcname) except (MacOS.Error, ValueError): pass if progress: progress.inc(50) else: typesfound, ownertype = copyres(input, output, [], 0, progress) Res.CloseResFile(input) # Check which resource-types we should not copy from the template skiptypes = []
94caa78ebf5e52716b383236f1a737a6bed57bf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/94caa78ebf5e52716b383236f1a737a6bed57bf6/buildtools.py
except (Carbon.File.error, ValueError):
except (Carbon.File.Error, ValueError):
def findtemplate(template=None): """Locate the applet template along sys.path""" if MacOS.runtimemodel == 'macho': if template: return template return findtemplate_macho() if not template: template=TEMPLATE for p in sys.path: file = os.path.join(p, template) try: file, d1, d2 = Carbon.File.FSResolveAliasFile(file, 1) break except (Carbon.File.error, ValueError): continue else: raise BuildError, "Template %s not found on sys.path" % `template` file = file.as_pathname() return file
769e1ff4a134cce66f4bd8ead4c56668ec6bfe30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/769e1ff4a134cce66f4bd8ead4c56668ec6bfe30/buildtools.py
Res.FSCreateResourceFile(destdir, destfile, RESOURCE_FORK_NAME)
Res.FSCreateResourceFile(destdir, unicode(destfile), RESOURCE_FORK_NAME)
def process_common(template, progress, code, rsrcname, destname, is_update, copy_codefragment, raw=0, others=[]): if MacOS.runtimemodel == 'macho': return process_common_macho(template, progress, code, rsrcname, destname, is_update, raw, others) if others: raise BuildError, "Extra files only allowed for MachoPython applets" # Create FSSpecs for the various files template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1) template = template_fsr.as_pathname() # Copy data (not resources, yet) from the template if progress: progress.label("Copy data fork...") progress.set(10) if copy_codefragment: tmpl = open(template, "rb") dest = open(destname, "wb") data = tmpl.read() if data: dest.write(data) dest.close() tmpl.close() del dest del tmpl # Open the output resource fork if progress: progress.label("Copy resources...") progress.set(20) try: output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) except MacOS.Error: destdir, destfile = os.path.split(destname) Res.FSCreateResourceFile(destdir, destfile, RESOURCE_FORK_NAME) output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) # Copy the resources from the target specific resource template, if any typesfound, ownertype = [], None try: input = Res.FSOpenResourceFile(rsrcname, RESOURCE_FORK_NAME, READ) except (MacOS.Error, ValueError): pass if progress: progress.inc(50) else: if is_update: skip_oldfile = ['cfrg'] else: skip_oldfile = [] typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress) Res.CloseResFile(input) # Check which resource-types we should not copy from the template skiptypes = [] if 'vers' in typesfound: skiptypes.append('vers') if 'SIZE' in typesfound: skiptypes.append('SIZE') if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4', 'icl8', 'ics4', 'ics8', 'ICN#', 'ics#'] if not copy_codefragment: skiptypes.append('cfrg')
769e1ff4a134cce66f4bd8ead4c56668ec6bfe30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/769e1ff4a134cce66f4bd8ead4c56668ec6bfe30/buildtools.py
dset_fss = Carbon.File.FSSpec(destname)
dest_fss = Carbon.File.FSSpec(destname)
def process_common(template, progress, code, rsrcname, destname, is_update, copy_codefragment, raw=0, others=[]): if MacOS.runtimemodel == 'macho': return process_common_macho(template, progress, code, rsrcname, destname, is_update, raw, others) if others: raise BuildError, "Extra files only allowed for MachoPython applets" # Create FSSpecs for the various files template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1) template = template_fsr.as_pathname() # Copy data (not resources, yet) from the template if progress: progress.label("Copy data fork...") progress.set(10) if copy_codefragment: tmpl = open(template, "rb") dest = open(destname, "wb") data = tmpl.read() if data: dest.write(data) dest.close() tmpl.close() del dest del tmpl # Open the output resource fork if progress: progress.label("Copy resources...") progress.set(20) try: output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) except MacOS.Error: destdir, destfile = os.path.split(destname) Res.FSCreateResourceFile(destdir, destfile, RESOURCE_FORK_NAME) output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) # Copy the resources from the target specific resource template, if any typesfound, ownertype = [], None try: input = Res.FSOpenResourceFile(rsrcname, RESOURCE_FORK_NAME, READ) except (MacOS.Error, ValueError): pass if progress: progress.inc(50) else: if is_update: skip_oldfile = ['cfrg'] else: skip_oldfile = [] typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress) Res.CloseResFile(input) # Check which resource-types we should not copy from the template skiptypes = [] if 'vers' in typesfound: skiptypes.append('vers') if 'SIZE' in typesfound: skiptypes.append('SIZE') if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4', 'icl8', 'ics4', 'ics8', 'ICN#', 'ics#'] if not copy_codefragment: skiptypes.append('cfrg')
769e1ff4a134cce66f4bd8ead4c56668ec6bfe30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/769e1ff4a134cce66f4bd8ead4c56668ec6bfe30/buildtools.py
self.interaction(frame, None)
if self.bp_commands(frame): self.interaction(frame, None) def bp_commands(self,frame): """ Call every command that was set for the current active breakpoint (if there is one) Returns True if the normal interaction function must be called, False otherwise """ if getattr(self,"currentbp",False) and self.currentbp in self.commands: currentbp = self.currentbp self.currentbp = 0 lastcmd_back = self.lastcmd self.setup(frame, None) for line in self.commands[currentbp]: self.onecmd(line) self.lastcmd = lastcmd_back if not self.commands_silent[currentbp]: self.print_stack_entry(self.stack[self.curindex]) if self.commands_doprompt[currentbp]: self.cmdloop() self.forget() return return 1
def user_line(self, frame): """This function is called when we stop or break at this line.""" if self._wait_for_mainpyfile: if (self.mainpyfile != self.canonic(frame.f_code.co_filename) or frame.f_lineno<= 0): return self._wait_for_mainpyfile = 0 self.interaction(frame, None)
bd30f5288112f9c1d8d5ddfd12dffff32f7d2c44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bd30f5288112f9c1d8d5ddfd12dffff32f7d2c44/pdb.py
fp = open(MOFILE, 'w')
fp = open(MOFILE, 'wb')
def setup(): os.makedirs(LOCALEDIR) fp = open(MOFILE, 'w') fp.write(base64.decodestring(GNU_MO_DATA)) fp.close()
c79519569d20d90cc9ec6ff8584dfd959bd2e1f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c79519569d20d90cc9ec6ff8584dfd959bd2e1f1/test_gettext.py
if platform_specific:
if plat_specific:
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 platform-shared library directory. If 'standard_lib' is true, return the directory containing standard Python library modules; otherwise, return the directory for site-specific modules. If 'prefix' is supplied, use it instead of sys.prefix or sys.exec_prefix -- i.e., ignore 'plat_specific'. """ if prefix is None: prefix = (plat_specific and EXEC_PREFIX or PREFIX) if os.name == "posix": libpython = os.path.join(prefix, "lib", "python" + sys.version[:3]) if standard_lib: return libpython else: return os.path.join(libpython, "site-packages") elif os.name == "nt": if standard_lib: return os.path.join(PREFIX, "Lib") else: return prefix elif os.name == "mac": if platform_specific: if standard_lib: return os.path.join(EXEC_PREFIX, "Mac", "Plugins") else: raise DistutilsPlatformError, \ "OK, where DO site-specific extensions go on the Mac?" else: if standard_lib: return os.path.join(PREFIX, "Lib") else: raise DistutilsPlatformError, \ "OK, where DO site-specific modules go on the Mac?" else: raise DistutilsPlatformError, \ ("I don't know where Python installs its library " + "on platform '%s'") % os.name
dc9fe8a7bab5a15daf7bb844bd3163b51c5450e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc9fe8a7bab5a15daf7bb844bd3163b51c5450e2/sysconfig.py
FInfo = OpaqueByValueStructType("FInfo", "PyMac_BuildFInfo", "PyMac_GetFInfo") FInfo_ptr = OpaqueType("FInfo", "PyMac_BuildFInfo", "PyMac_GetFInfo")
FInfo = OpaqueType("FInfo", "FInfo") FInfo_ptr = OpaqueType("FInfo", "FInfo")
def declare(self, name): Output("%s %s__buf__;", self.typeName, name) Output("%s *%s = &%s__buf__;", self.typeName, name, name)
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
extern PyObject *FSRef_New(FSRef *itself); extern PyObject *FSSpec_New(FSSpec *itself); extern PyObject *Alias_New(AliasHandle itself); extern int FSRef_Convert(PyObject *v, FSRef *p_itself); extern int FSSpec_Convert(PyObject *v, FSSpec *p_itself); extern int Alias_Convert(PyObject *v, AliasHandle *p_itself); static int myPyMac_GetFSSpec(PyObject *v, FSSpec *spec); static int myPyMac_GetFSRef(PyObject *v, FSRef *fsr);
static PyObject *FInfo_New(FInfo *itself); static PyObject *FSRef_New(FSRef *itself); static PyObject *FSSpec_New(FSSpec *itself); static PyObject *Alias_New(AliasHandle itself); static int FInfo_Convert(PyObject *v, FInfo *p_itself); static int Alias_Convert(PyObject *v, AliasHandle *p_itself);
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
return myPyMac_GetFSSpec(v, *spec);
return PyMac_GetFSSpec(v, *spec);
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
return myPyMac_GetFSRef(v, *ref);
return PyMac_GetFSRef(v, *ref);
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
/* ** Parse/generate objsect */ static PyObject * PyMac_BuildFInfo(FInfo *itself) { return Py_BuildValue("O&O&HO&h", PyMac_BuildOSType, itself->fdType, PyMac_BuildOSType, itself->fdCreator, itself->fdFlags, PyMac_BuildPoint, &itself->fdLocation, itself->fdFldr); } static int PyMac_GetFInfo(PyObject *v, FInfo *itself) { return PyArg_ParseTuple(v, "O&O&HO&h", PyMac_GetOSType, &itself->fdType, PyMac_GetOSType, &itself->fdCreator, &itself->fdFlags, PyMac_GetPoint, &itself->fdLocation, &itself->fdFldr); }
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
static int myPyMac_GetFSSpec(PyObject *v, FSSpec *spec)
int PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
if ( myPyMac_GetFSRef(v, &fsr) ) {
if ( PyMac_GetFSRef(v, &fsr) ) {
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
static int myPyMac_GetFSRef(PyObject *v, FSRef *fsr)
int PyMac_GetFSRef(PyObject *v, FSRef *fsr)
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
class FSSpecDefinition(PEP253Mixin, GlobalObjectDefinition):
class FInfoDefinition(PEP253Mixin, ObjectDefinition): getsetlist = [ ("Type", "return Py_BuildValue(\"O&\", PyMac_BuildOSType, self->ob_itself.fdType);", "return PyArg_Parse(v, \"O&\", PyMac_GetOSType, &self->ob_itself.fdType)-1;", "4-char file type" ), ("Creator", "return Py_BuildValue(\"O&\", PyMac_BuildOSType, self->ob_itself.fdCreator);", "return PyArg_Parse(v, \"O&\", PyMac_GetOSType, &self->ob_itself.fdCreator)-1;", "4-char file creator" ), ("Flags", "return Py_BuildValue(\"H\", self->ob_itself.fdFlags);", "return PyArg_Parse(v, \"H\", &self->ob_itself.fdFlags)-1;", "Finder flag bits" ), ("Location", "return Py_BuildValue(\"O&\", PyMac_BuildPoint, self->ob_itself.fdLocation);", "return PyArg_Parse(v, \"O&\", PyMac_GetPoint, &self->ob_itself.fdLocation)-1;", "(x, y) location of the file's icon in its parent finder window" ), ("Fldr", "return Py_BuildValue(\"h\", self->ob_itself.fdFldr);", "return PyArg_Parse(v, \"h\", &self->ob_itself.fdFldr)-1;", "Original folder, for 'put away'" ), ] def __init__(self, name, prefix, itselftype): ObjectDefinition.__init__(self, name, prefix, itselftype) self.argref = "*" def outputCheckNewArg(self): Output("if (itself == NULL) return PyMac_Error(resNotFound);") def output_tp_newBody(self): Output("PyObject *self;"); Output() Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;") Output("memset(&((%s *)self)->ob_itself, 0, sizeof(%s));", self.objecttype, self.itselftype) Output("return self;") def output_tp_initBody(self): Output("%s *itself = NULL;", self.itselftype) Output("char *kw[] = {\"itself\", 0};") Output() Output("if (PyArg_ParseTupleAndKeywords(args, kwds, \"|O&\", kw, FInfo_Convert, &itself))") OutLbrace() Output("if (itself) memcpy(&((%s *)self)->ob_itself, itself, sizeof(%s));", self.objecttype, self.itselftype) Output("return 0;") OutRbrace() Output("return -1;") class FSSpecDefinition(PEP253Mixin, ObjectDefinition):
#ifdef WITHOUT_FRAMEWORKS
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
GlobalObjectDefinition.__init__(self, name, prefix, itselftype)
ObjectDefinition.__init__(self, name, prefix, itselftype)
def __init__(self, name, prefix, itselftype): GlobalObjectDefinition.__init__(self, name, prefix, itselftype) self.argref = "*" # Store FSSpecs, but pass them by address
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
self.objecttype, self.objecttype)
self.objecttype, self.itselftype)
def output_tp_newBody(self): Output("PyObject *self;"); Output() Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;") Output("memset(&((%s *)self)->ob_itself, 0, sizeof(%s));", self.objecttype, self.objecttype) Output("return self;")
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
Output("if (myPyMac_GetFSSpec(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype)
Output("if (PyMac_GetFSSpec(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype)
def output_tp_initBody(self): Output("PyObject *v = NULL;") Output("char *rawdata = NULL;") Output("int rawdatalen = 0;") Output("char *kw[] = {\"itself\", \"rawdata\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|Os#\", kw, &v, &rawdata, &rawdatalen))") Output("return -1;") Output("if (v && rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");") Output("return -1;") OutRbrace() Output("if (!v && !rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");") Output("return -1;") OutRbrace() Output("if (rawdata)") OutLbrace() Output("if (rawdatalen != sizeof(%s))", self.itselftype) OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"%s rawdata incorrect size\");", self.itselftype) Output("return -1;") OutRbrace() Output("memcpy(&((%s *)self)->ob_itself, rawdata, rawdatalen);", self.objecttype) Output("return 0;") OutRbrace() Output("if (myPyMac_GetFSSpec(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) Output("return -1;")
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
class FSRefDefinition(PEP253Mixin, GlobalObjectDefinition):
class FSRefDefinition(PEP253Mixin, ObjectDefinition):
def outputRepr(self): Output() Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype) OutLbrace() Output("char buf[512];") Output("""PyOS_snprintf(buf, sizeof(buf), \"%%s((%%d, %%ld, '%%.*s'))\", self->ob_type->tp_name, self->ob_itself.vRefNum, self->ob_itself.parID, self->ob_itself.name[0], self->ob_itself.name+1);""") Output("return PyString_FromString(buf);") OutRbrace()
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
GlobalObjectDefinition.__init__(self, name, prefix, itselftype)
ObjectDefinition.__init__(self, name, prefix, itselftype)
def __init__(self, name, prefix, itselftype): GlobalObjectDefinition.__init__(self, name, prefix, itselftype) self.argref = "*" # Store FSRefs, but pass them by address
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
self.objecttype, self.objecttype)
self.objecttype, self.itselftype)
def output_tp_newBody(self): Output("PyObject *self;"); Output() Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;") Output("memset(&((%s *)self)->ob_itself, 0, sizeof(%s));", self.objecttype, self.objecttype) Output("return self;")
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
Output("if (myPyMac_GetFSRef(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype)
Output("if (PyMac_GetFSRef(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype)
def output_tp_initBody(self): Output("PyObject *v = NULL;") Output("char *rawdata = NULL;") Output("int rawdatalen = 0;") Output("char *kw[] = {\"itself\", \"rawdata\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|Os#\", kw, &v, &rawdata, &rawdatalen))") Output("return -1;") Output("if (v && rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");") Output("return -1;") OutRbrace() Output("if (!v && !rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");") Output("return -1;") OutRbrace() Output("if (rawdata)") OutLbrace() Output("if (rawdatalen != sizeof(%s))", self.itselftype) OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"%s rawdata incorrect size\");", self.itselftype) Output("return -1;") OutRbrace() Output("memcpy(&((%s *)self)->ob_itself, rawdata, rawdatalen);", self.objecttype) Output("return 0;") OutRbrace() Output("if (myPyMac_GetFSRef(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) Output("return -1;")
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
class AliasDefinition(PEP253Mixin, GlobalObjectDefinition):
class AliasDefinition(PEP253Mixin, ObjectDefinition):
def output_tp_initBody(self): Output("PyObject *v = NULL;") Output("char *rawdata = NULL;") Output("int rawdatalen = 0;") Output("char *kw[] = {\"itself\", \"rawdata\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|Os#\", kw, &v, &rawdata, &rawdatalen))") Output("return -1;") Output("if (v && rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");") Output("return -1;") OutRbrace() Output("if (!v && !rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");") Output("return -1;") OutRbrace() Output("if (rawdata)") OutLbrace() Output("if (rawdatalen != sizeof(%s))", self.itselftype) OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"%s rawdata incorrect size\");", self.itselftype) Output("return -1;") OutRbrace() Output("memcpy(&((%s *)self)->ob_itself, rawdata, rawdatalen);", self.objecttype) Output("return 0;") OutRbrace() Output("if (myPyMac_GetFSRef(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) Output("return -1;")
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
GlobalObjectDefinition.outputStructMembers(self)
ObjectDefinition.outputStructMembers(self)
def outputStructMembers(self): GlobalObjectDefinition.outputStructMembers(self) Output("void (*ob_freeit)(%s ptr);", self.itselftype)
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
GlobalObjectDefinition.outputInitStructMembers(self)
ObjectDefinition.outputInitStructMembers(self)
def outputInitStructMembers(self): GlobalObjectDefinition.outputInitStructMembers(self) Output("it->ob_freeit = NULL;")
e87663306a989afea3a2ed3e245a6190fd9e1fa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e87663306a989afea3a2ed3e245a6190fd9e1fa9/filesupport.py
self.draw['xscroll'] = self.draw.scrollX.set self.draw['yscroll'] = self.draw.scrollY.set
self.draw['xscrollcommand'] = self.draw.scrollX.set self.draw['yscrollcommand'] = self.draw.scrollY.set
def createWidgets(self):
447ae53eab0ae1d0e9856a7145e9f8f7387150e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/447ae53eab0ae1d0e9856a7145e9f8f7387150e6/canvas-with-scrollbars.py
def __init__(self, master=None): """Construct a variable with an optional MASTER as master widget. The variable is named PY_VAR_number in Tcl.
def __init__(self, master=None, value=None, name=None): """Construct a variable MASTER can be given as master widget. VALUE is an optional value (defaults to "") NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained.
def __init__(self, master=None): """Construct a variable with an optional MASTER as master widget. The variable is named PY_VAR_number in Tcl. """ global _varnum if not master: master = _default_root self._master = master self._tk = master.tk self._name = 'PY_VAR' + repr(_varnum) _varnum = _varnum + 1 self.set(self._default)
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
self._name = 'PY_VAR' + repr(_varnum) _varnum = _varnum + 1 self.set(self._default)
if name: self._name = name else: self._name = 'PY_VAR' + `_varnum` _varnum += 1 if value != None: self.set(value) elif not self._tk.call("info", "exists", self._name): self.set(self._default)
def __init__(self, master=None): """Construct a variable with an optional MASTER as master widget. The variable is named PY_VAR_number in Tcl. """ global _varnum if not master: master = _default_root self._master = master self._tk = master.tk self._name = 'PY_VAR' + repr(_varnum) _varnum = _varnum + 1 self.set(self._default)
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
def __init__(self, master=None):
def __init__(self, master=None, value=None, name=None):
def __init__(self, master=None): """Construct a string variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
MASTER can be given as master widget.""" Variable.__init__(self, master)
MASTER can be given as master widget. VALUE is an optional value (defaults to "") NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. """ Variable.__init__(self, master, value, name)
def __init__(self, master=None): """Construct a string variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
def __init__(self, master=None):
def __init__(self, master=None, value=None, name=None):
def __init__(self, master=None): """Construct an integer variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
MASTER can be given as master widget.""" Variable.__init__(self, master)
MASTER can be given as master widget. VALUE is an optional value (defaults to 0) NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. """ Variable.__init__(self, master, value, name)
def __init__(self, master=None): """Construct an integer variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
def __init__(self, master=None):
def __init__(self, master=None, value=None, name=None):
def __init__(self, master=None): """Construct a float variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
MASTER can be given as a master widget.""" Variable.__init__(self, master)
MASTER can be given as master widget. VALUE is an optional value (defaults to 0.0) NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. """ Variable.__init__(self, master, value, name)
def __init__(self, master=None): """Construct a float variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
_default = "false" def __init__(self, master=None):
_default = False def __init__(self, master=None, value=None, name=None):
def get(self): """Return the value of the variable as a float.""" return getdouble(self._tk.globalgetvar(self._name))
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
MASTER can be given as a master widget.""" Variable.__init__(self, master)
MASTER can be given as master widget. VALUE is an optional value (defaults to False) NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. """ Variable.__init__(self, master, value, name)
def __init__(self, master=None): """Construct a boolean variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
if (not check_intermediate) or len(plist) < 2:
if not check_intermediate:
def __init__(self, master, name, destroy_physically=1, check_intermediate=1): if check_intermediate: path = master._subwidget_name(name) try: path = path[len(master._w)+1:] plist = path.split('.') except: plist = []
bba003ef248786399aeb1aed4b0c2007b28bce56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bba003ef248786399aeb1aed4b0c2007b28bce56/Tix.py
print '-%20.20s %20.20 %-30.30s'%(f, d[5:], s)
print '-%20.20s %20.20s %-30.30s'%(f, d[5:], s)
def _test(): import time import sys import string import os args = sys.argv[1:] if not args: for key in 'MAILDIR', 'MAIL', 'LOGNAME', 'USER': if os.environ.has_key(key): mbox = os.environ[key] break else: print "$MAIL, $LOGNAME nor $USER set -- who are you?" return else: mbox = args[0] if mbox[:1] == '+': mbox = os.environ['HOME'] + '/Mail/' + mbox[1:] elif not '/' in mbox: mbox = '/usr/mail/' + mbox if os.path.isdir(mbox): if os.path.isdir(os.path.join(mbox, 'cur')): mb = Maildir(mbox) else: mb = MHMailbox(mbox) else: fp = open(mbox, 'r') mb = UnixMailbox(fp) msgs = [] while 1: msg = mb.next() if msg is None: break msgs.append(msg) if len(args) <= 1: msg.fp = None if len(args) > 1: num = string.atoi(args[1]) print 'Message %d body:'%num msg = msgs[num-1] msg.rewindbody() sys.stdout.write(msg.fp.read()) else: print 'Mailbox',mbox,'has',len(msgs),'messages:' for msg in msgs: f = msg.getheader('from') or "" s = msg.getheader('subject') or "" d = msg.getheader('date') or "" print '-%20.20s %20.20 %-30.30s'%(f, d[5:], s)
cc4adf27f4d45592751dc3bcfd0caae667d482fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc4adf27f4d45592751dc3bcfd0caae667d482fb/mailbox.py
def test_basic_proxy(self): o = C() self.check_proxy(o, weakref.proxy(o))
da1ad32cec753fb8db779c20897b5fd288381fe7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da1ad32cec753fb8db779c20897b5fd288381fe7/test_weakref.py
append = "$append%d" % self.__list_count
tmpname = "$list%d" % self.__list_count
def visitListComp(self, node): self.set_lineno(node) # setup list append = "$append%d" % self.__list_count self.__list_count = self.__list_count + 1 self.emit('BUILD_LIST', 0) self.emit('DUP_TOP') self.emit('LOAD_ATTR', 'append') self._implicitNameOp('STORE', append)
5addf7007818bd05f5a1c26f8c71b5ee839a7659 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5addf7007818bd05f5a1c26f8c71b5ee839a7659/pycodegen.py
self.emit('LOAD_ATTR', 'append') self._implicitNameOp('STORE', append)
self._implicitNameOp('STORE', tmpname)
def visitListComp(self, node): self.set_lineno(node) # setup list append = "$append%d" % self.__list_count self.__list_count = self.__list_count + 1 self.emit('BUILD_LIST', 0) self.emit('DUP_TOP') self.emit('LOAD_ATTR', 'append') self._implicitNameOp('STORE', append)
5addf7007818bd05f5a1c26f8c71b5ee839a7659 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5addf7007818bd05f5a1c26f8c71b5ee839a7659/pycodegen.py
self._implicitNameOp('LOAD', append)
self._implicitNameOp('LOAD', tmpname)
def visitListComp(self, node): self.set_lineno(node) # setup list append = "$append%d" % self.__list_count self.__list_count = self.__list_count + 1 self.emit('BUILD_LIST', 0) self.emit('DUP_TOP') self.emit('LOAD_ATTR', 'append') self._implicitNameOp('STORE', append)
5addf7007818bd05f5a1c26f8c71b5ee839a7659 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5addf7007818bd05f5a1c26f8c71b5ee839a7659/pycodegen.py
self.emit('CALL_FUNCTION', 1) self.emit('POP_TOP')
self.emit('LIST_APPEND',)
def visitListComp(self, node): self.set_lineno(node) # setup list append = "$append%d" % self.__list_count self.__list_count = self.__list_count + 1 self.emit('BUILD_LIST', 0) self.emit('DUP_TOP') self.emit('LOAD_ATTR', 'append') self._implicitNameOp('STORE', append)
5addf7007818bd05f5a1c26f8c71b5ee839a7659 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5addf7007818bd05f5a1c26f8c71b5ee839a7659/pycodegen.py
self._implicitNameOp('DELETE', append)
self._implicitNameOp('DELETE', tmpname)
def visitListComp(self, node): self.set_lineno(node) # setup list append = "$append%d" % self.__list_count self.__list_count = self.__list_count + 1 self.emit('BUILD_LIST', 0) self.emit('DUP_TOP') self.emit('LOAD_ATTR', 'append') self._implicitNameOp('STORE', append)
5addf7007818bd05f5a1c26f8c71b5ee839a7659 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5addf7007818bd05f5a1c26f8c71b5ee839a7659/pycodegen.py
fd = os.open(filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700)
fd = os.open(filename, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0700)
def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0, '\\TEMP') elif os.name == 'mac': import macfs, MACFS try: refnum, dirid = macfs.FindFolder(MACFS.kOnSystemDisk, MACFS.kTemporaryFolderType, 1) dirname = macfs.FSSpec((refnum, dirid, '')).as_pathname() attempdirs.insert(0, dirname) except macfs.error: pass for envname in 'TMPDIR', 'TEMP', 'TMP': if os.environ.has_key(envname): attempdirs.insert(0, os.environ[envname]) testfile = gettempprefix() + 'test' for dir in attempdirs: try: filename = os.path.join(dir, testfile) if os.name == 'posix': try: fd = os.open(filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700) except OSError: pass else: fp = os.fdopen(fd, 'w') fp.write('blat') fp.close() os.unlink(filename) del fp, fd tempdir = dir break else: fp = open(filename, 'w') fp.write('blat') fp.close() os.unlink(filename) tempdir = dir break except IOError: pass if tempdir is None: msg = "Can't find a usable temporary directory amongst " + `attempdirs` raise IOError, msg return tempdir
c348cd751846ddc8cec61c47928867e30d94549c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c348cd751846ddc8cec61c47928867e30d94549c/tempfile.py
m=None
m = (None, None)
def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Should be able to handle anything rfc822.parseaddr can handle. """ m=None try: m=rfc822.parseaddr(addr)[1] except AttributeError: pass if not m: #something weird here.. punt -ddm return addr else: return "<%s>" % m
342456d5d25be692c3ddd43d0446b52555251ccc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/342456d5d25be692c3ddd43d0446b52555251ccc/smtplib.py
if not m:
if m == (None, None):
def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Should be able to handle anything rfc822.parseaddr can handle. """ m=None try: m=rfc822.parseaddr(addr)[1] except AttributeError: pass if not m: #something weird here.. punt -ddm return addr else: return "<%s>" % m
342456d5d25be692c3ddd43d0446b52555251ccc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/342456d5d25be692c3ddd43d0446b52555251ccc/smtplib.py
return addr
return "<%s>" % addr
def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Should be able to handle anything rfc822.parseaddr can handle. """ m=None try: m=rfc822.parseaddr(addr)[1] except AttributeError: pass if not m: #something weird here.. punt -ddm return addr else: return "<%s>" % m
342456d5d25be692c3ddd43d0446b52555251ccc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/342456d5d25be692c3ddd43d0446b52555251ccc/smtplib.py
self.shared_library_filename (output_libname),
self.library_filename (output_libname, lib_type='shared'),
def link_shared_lib (self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None):
7499847c5327767575e3344b1452e91418ec5a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7499847c5327767575e3344b1452e91418ec5a98/unixccompiler.py
shared = os.path.join (dir, self.shared_library_filename (lib)) static = os.path.join (dir, self.library_filename (lib))
shared = os.path.join ( dir, self.library_filename (lib, lib_type='shared')) static = os.path.join ( dir, self.library_filename (lib, lib_type='static'))
def find_library_file (self, dirs, lib):
7499847c5327767575e3344b1452e91418ec5a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7499847c5327767575e3344b1452e91418ec5a98/unixccompiler.py
if not self.distribution.has_ext_modules(): spec_file.append('BuildArchitectures: noarch')
if not self.force_arch: if not self.distribution.has_ext_modules(): spec_file.append('BuildArch: noarch') else: spec_file.append( 'BuildArch: %s' % self.force_arch )
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.replace('-','_'), '', 'Summary: ' + self.distribution.get_description(), ]
23c48a12d9a6f80e948a7f00fa01f9e6407b557a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/23c48a12d9a6f80e948a7f00fa01f9e6407b557a/bdist_rpm.py
self.wfile.flush()
if not self.wfile.closed: self.wfile.flush()
def finish(self): self.wfile.flush() self.wfile.close() self.rfile.close()
4cedc1e84ee174cebaa59295690cfd5c6f10a0b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4cedc1e84ee174cebaa59295690cfd5c6f10a0b7/SocketServer.py
print "reinitialize_command: command=%s" % command print " before: have_run =", self.have_run
def reinitialize_command (self, command, reinit_subcommands=0): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command line. You'll have to re-finalize the command object (by calling 'finalize_options()' or 'ensure_finalized()') before using it for real.
47ec20757d5fed3e7af19d722fbb137a4c8f9e9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47ec20757d5fed3e7af19d722fbb137a4c8f9e9a/dist.py
print " after: have_run =", self.have_run
def reinitialize_command (self, command, reinit_subcommands=0): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command line. You'll have to re-finalize the command object (by calling 'finalize_options()' or 'ensure_finalized()') before using it for real.
47ec20757d5fed3e7af19d722fbb137a4c8f9e9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47ec20757d5fed3e7af19d722fbb137a4c8f9e9a/dist.py
print (" reinitializing sub-commands: %s" % command.get_sub_commands())
def reinitialize_command (self, command, reinit_subcommands=0): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command line. You'll have to re-finalize the command object (by calling 'finalize_options()' or 'ensure_finalized()') before using it for real.
47ec20757d5fed3e7af19d722fbb137a4c8f9e9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/47ec20757d5fed3e7af19d722fbb137a4c8f9e9a/dist.py
('a, = 1,', 'LOAD_CONST',), ('a, b = 1, 2', 'ROT_TWO',), ('a, b, c = 1, 2, 3', 'ROT_THREE',),
('a, = a,', 'LOAD_CONST',), ('a, b = a, b', 'ROT_TWO',), ('a, b, c = a, b, c', 'ROT_THREE',),
def test_pack_unpack(self): for line, elem in ( ('a, = 1,', 'LOAD_CONST',), ('a, b = 1, 2', 'ROT_TWO',), ('a, b, c = 1, 2, 3', 'ROT_THREE',), ): asm = dis_single(line) self.assert_(elem in asm) self.assert_('BUILD_TUPLE' not in asm) self.assert_('UNPACK_TUPLE' not in asm)
2c31a058eb719da8908ea9d9c2f1b748ecc7a4ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2c31a058eb719da8908ea9d9c2f1b748ecc7a4ca/test_peepholer.py
(fd, name) = tempfile.mkstemp(suffix=['.html', '.txt'][text],
(fd, path) = tempfile.mkstemp(suffix=['.html', '.txt'][text],
def handle(self, info=None): info = info or sys.exc_info() self.file.write(reset())
0146f419b45b6a97bfa13d9cb62f9da8d4343027 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0146f419b45b6a97bfa13d9cb62f9da8d4343027/cgitb.py
sys.stdout.writelines(restored)
for line in restored: print line,
def restore(which): restored = difflib.restore(sys.stdin.readlines(), which) sys.stdout.writelines(restored)
42b68772933d311c048edc6a18521c317758578a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42b68772933d311c048edc6a18521c317758578a/ndiff.py
self.atcr = False
def __init__(self, stream, errors='strict'):
bc8e642c1bfbef3b94f5c31dd8fdd824549039b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bc8e642c1bfbef3b94f5c31dd8fdd824549039b0/codecs.py
if self.atcr and data.startswith(u"\n"): data = data[1:]
def readline(self, size=None, keepends=True):
bc8e642c1bfbef3b94f5c31dd8fdd824549039b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bc8e642c1bfbef3b94f5c31dd8fdd824549039b0/codecs.py
self.atcr = data.endswith(u"\r") if self.atcr and size is None:
if data.endswith(u"\r"):
def readline(self, size=None, keepends=True):
bc8e642c1bfbef3b94f5c31dd8fdd824549039b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bc8e642c1bfbef3b94f5c31dd8fdd824549039b0/codecs.py
self.atcr = data.endswith(u"\r")
def readline(self, size=None, keepends=True):
bc8e642c1bfbef3b94f5c31dd8fdd824549039b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bc8e642c1bfbef3b94f5c31dd8fdd824549039b0/codecs.py
self.atcr = False
def reset(self):
bc8e642c1bfbef3b94f5c31dd8fdd824549039b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bc8e642c1bfbef3b94f5c31dd8fdd824549039b0/codecs.py
print "source", nodelist[-1]
def factor(self, nodelist): elt = nodelist[0] t = elt[0] print "source", nodelist[-1] node = self.com_node(nodelist[-1]) # need to handle (unary op)constant here... if t == token.PLUS: node = UnaryAdd(node) node.lineno = elt[2] elif t == token.MINUS: print node node = UnarySub(node) node.lineno = elt[2] elif t == token.TILDE: node = Invert(node) node.lineno = elt[2] return node
8d0ffe0126f301338625fe7402d3c4c4b617a449 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d0ffe0126f301338625fe7402d3c4c4b617a449/transformer.py
print node
def factor(self, nodelist): elt = nodelist[0] t = elt[0] print "source", nodelist[-1] node = self.com_node(nodelist[-1]) # need to handle (unary op)constant here... if t == token.PLUS: node = UnaryAdd(node) node.lineno = elt[2] elif t == token.MINUS: print node node = UnarySub(node) node.lineno = elt[2] elif t == token.TILDE: node = Invert(node) node.lineno = elt[2] return node
8d0ffe0126f301338625fe7402d3c4c4b617a449 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d0ffe0126f301338625fe7402d3c4c4b617a449/transformer.py
try: base64.decodestring("") except binascii_error: pass else: self.fail("expected a binascii.Error on null decode request")
test_support.verify(base64.decodestring('') == '')
def test_decode_string(self): """Testing decode string""" test_support.verify(base64.decodestring("d3d3LnB5dGhvbi5vcmc=\n") == "www.python.org", reason="www.python.org decodestring failed") test_support.verify(base64.decodestring("YQ==\n") == "a", reason="a decodestring failed") test_support.verify(base64.decodestring("YWI=\n") == "ab", reason="ab decodestring failed") test_support.verify(base64.decodestring("YWJj\n") == "abc", reason="abc decodestring failed") test_support.verify(base64.decodestring( "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNTY3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n") == "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#0^&*();:<>,. []{}", reason = "long decodestring failed") try: base64.decodestring("") except binascii_error: pass else: self.fail("expected a binascii.Error on null decode request")
0a51b58e6b5ffd3cc17722f4ae19893ed486f3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a51b58e6b5ffd3cc17722f4ae19893ed486f3c9/test_base64.py
print 'XXXX boolean:', `data`
def _decode_boolean(data, key): print 'XXXX boolean:', `data` return ord(data[0])
871fad2641dbd1d479b5186fde1f56e7ca6cd470 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/871fad2641dbd1d479b5186fde1f56e7ca6cd470/ic.py
if err[0] == socket.SSL_ERROR_ZERO_RETURN:
if (err[0] == socket.SSL_ERROR_ZERO_RETURN or err[0] == socket.SSL_ERROR_EOF):
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
6af3e2dc315797e799a6ad0baedd393ff65ef1db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6af3e2dc315797e799a6ad0baedd393ff65ef1db/httplib.py
def __init__(self, master=None, cnf={}, **kw):
def __init__(self, master=None, cnf=None, **kw): if cnf is None: cnf = {}
def __init__(self, master=None, cnf={}, **kw): if kw: cnf = _cnfmerge((cnf, kw)) fcnf = {} for k in cnf.keys(): if type(k) == ClassType or k == 'name': fcnf[k] = cnf[k] del cnf[k] self.frame = apply(Frame, (master,), fcnf) self.vbar = Scrollbar(self.frame, name='vbar') self.vbar.pack(side=RIGHT, fill=Y) cnf['name'] = 'text' apply(Text.__init__, (self, self.frame), cnf) self.pack(side=LEFT, fill=BOTH, expand=1) self['yscrollcommand'] = self.vbar.set self.vbar['command'] = self.yview
ea7364c7cd989b78767efff2720b0e17db6eeb0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea7364c7cd989b78767efff2720b0e17db6eeb0b/ScrolledText.py
self.tempcache[url] = result = tfn, headers
self.tempcache[url] = result
def retrieve(self, url): if self.tempcache and self.tempcache.has_key(url): return self.tempcache[url] url1 = unwrap(url) if self.tempcache and self.tempcache.has_key(url1): self.tempcache[url] = self.tempcache[url1] return self.tempcache[url1] type, url1 = splittype(url1) if not type or type == 'file': try: fp = self.open_local_file(url1) del fp return splithost(url1)[1], None except IOError, msg: pass fp = self.open(url) headers = fp.info() import tempfile tfn = tempfile.mktemp() if self.tempcache is not None: self.tempcache[url] = result = tfn, headers tfp = open(tfn, 'w') bs = 1024*8 block = fp.read(bs) while block: tfp.write(block) block = fp.read(bs) del fp del tfp return result
fa59e838132ab11e1d60fe7e05c9032378c2aa7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa59e838132ab11e1d60fe7e05c9032378c2aa7b/urllib.py
if isabs(b): path = b elif path == '' or path[-1:] in '/\\:': path = path + b else: path = path + "\\" + b
if len(path) == 2 and path[-1] == ":" and splitdrive(b)[0] == "": pass elif isabs(b) or path == "": path = "" elif path[-1:] not in "/\\": b = "\\" + b path += b
def join(a, *p): """Join two or more pathname components, inserting "\\" as needed""" path = a for b in p: if isabs(b): path = b elif path == '' or path[-1:] in '/\\:': path = path + b else: path = path + "\\" + b return path
1bdd0f255997ded18117e0e33916b67bd023cc47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1bdd0f255997ded18117e0e33916b67bd023cc47/ntpath.py
raise WalkerEror, "Can't find appropriate Node type: %s" % str(args)
raise WalkerError, "Can't find appropriate Node type: %s" % str(args)
def Node(*args): kind = args[0] if nodes.has_key(kind): try: return nodes[kind](*args[1:]) except TypeError: print nodes[kind], len(args), args raise else: raise WalkerEror, "Can't find appropriate Node type: %s" % str(args) #return apply(ast.Node, args)
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror, ('unexpected node type', n)
raise WalkerError, ('unexpected node type', n)
def compile_node(self, node): ### emit a line-number node? n = node[0]
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def parameters(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def varargslist(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def fpdef(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def fplist(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def dotted_name(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def comp_op(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def trailer(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def sliceop(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
raise WalkerEror
raise WalkerError
def argument(self, nodelist): raise WalkerEror
f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0af0e7a466797d9ed3fa7d635b9b1e91d5c2674/transformer.py
return pydoc.getdoc(method)
import pydoc return pydoc.getdoc(method)
def system_methodHelp(self, method_name): """system.methodHelp('add') => "Adds two integers together"
732911fd1e33244fcb7d946c3936dfbaff83980d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/732911fd1e33244fcb7d946c3936dfbaff83980d/SimpleXMLRPCServer.py
sys.stdout.write(reponse)
sys.stdout.write(response)
def handle_get(self): """Handle a single HTTP GET request.
732911fd1e33244fcb7d946c3936dfbaff83980d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/732911fd1e33244fcb7d946c3936dfbaff83980d/SimpleXMLRPCServer.py
doc = `doc`
doc = '"' + doc + '"'
def outputGetSetList(self): if self.getsetlist: for name, get, set, doc in self.getsetlist: if get: self.outputGetter(name, get) else: Output("#define %s_get_%s NULL", self.prefix, name) if set: self.outputSetter(name, set) else: Output("#define %s_set_%s NULL", self.prefix, name) Output("static PyGetSetDef %s_getsetlist[] = {", self.prefix) IndentLevel() for name, get, set, doc in self.getsetlist: if doc: doc = `doc` else: doc = "NULL" Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s}", name, self.prefix, name, self.prefix, name, doc) DedentLevel() Output("};") else: Output("#define %s_getsetlist NULL", self.prefix)
27a445023925a3abb14e08acbfcdd9134ca1a275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/27a445023925a3abb14e08acbfcdd9134ca1a275/bgenObjectDefinition.py
Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s}",
Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s},",
def outputGetSetList(self): if self.getsetlist: for name, get, set, doc in self.getsetlist: if get: self.outputGetter(name, get) else: Output("#define %s_get_%s NULL", self.prefix, name) if set: self.outputSetter(name, set) else: Output("#define %s_set_%s NULL", self.prefix, name) Output("static PyGetSetDef %s_getsetlist[] = {", self.prefix) IndentLevel() for name, get, set, doc in self.getsetlist: if doc: doc = `doc` else: doc = "NULL" Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s}", name, self.prefix, name, self.prefix, name, doc) DedentLevel() Output("};") else: Output("#define %s_getsetlist NULL", self.prefix)
27a445023925a3abb14e08acbfcdd9134ca1a275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/27a445023925a3abb14e08acbfcdd9134ca1a275/bgenObjectDefinition.py
Output("static int %s_get_%s(%s *self, PyObject *v, void *closure)",
Output("static int %s_set_%s(%s *self, PyObject *v, void *closure)",
def outputSetter(self, name, code): Output("static int %s_get_%s(%s *self, PyObject *v, void *closure)", self.prefix, name, self.objecttype) OutLbrace() Output(code) Output("return 0;") OutRbrace()
27a445023925a3abb14e08acbfcdd9134ca1a275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/27a445023925a3abb14e08acbfcdd9134ca1a275/bgenObjectDefinition.py
import Scrap
from Carbon import Scrap
def domenu_copy(self, *args): sel = self.getselectedobjects() selitems = [] for key, value, dummy, dummy in sel: selitems.append(double_repr(key, value)) text = string.join(selitems, '\r') if text: import Scrap Scrap.ZeroScrap() Scrap.PutScrap('TEXT', text)
01c9805b8d27e9dcd4a05b00c55af53ad157a5ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/01c9805b8d27e9dcd4a05b00c55af53ad157a5ae/PyBrowser.py
self.emit('ROT_TWO') self.visit(k)
self.emit('ROT_THREE')
def visitDict(self, node): lineno = getattr(node, 'lineno', None) if lineno: self.emit('SET_LINENO', lineno) self.emit('BUILD_MAP', 0) for k, v in node.items: lineno2 = getattr(node, 'lineno', None) if lineno2 is not None and lineno != lineno2: self.emit('SET_LINENO', lineno2) lineno = lineno2 self.emit('DUP_TOP') self.visit(v) self.emit('ROT_TWO') self.visit(k) self.emit('STORE_SUBSCR')
78429a6aa6bb4f8527f0c6be678555ef26b62d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/78429a6aa6bb4f8527f0c6be678555ef26b62d19/pycodegen.py
elif compiler[:3] == "gcc" or compiler[:3] == "g++": return "-Wl,-R" + dir
elif sys.platform[:5] == "hp-ux": return "+s -L" + dir elif compiler[:3] == "gcc" or compiler[:3] == "g++": return "-Wl,-R" + dir
def runtime_library_dir_option(self, dir): # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # directories searched for dependencies when a dynamic library # is sought. GCC has to be told to pass the -R option through # to the linker, whereas other compilers just know this. # Other compilers may need something slightly different. At # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so # we use this hack. compiler = os.path.basename(sysconfig.get_config_var("CC")) if sys.platform[:6] == "darwin": # MacOSX's linker doesn't understand the -R flag at all return "-L" + dir elif compiler[:3] == "gcc" or compiler[:3] == "g++": return "-Wl,-R" + dir else: return "-R" + dir
b71bcb632260fdb2ee80a45ddce2c724f66edb4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b71bcb632260fdb2ee80a45ddce2c724f66edb4c/unixccompiler.py
_apply = apply
def join(words, sep = ' '): """join(list [,sep]) -> string Return a string composed of the words in list, with intervening occurences of sep. The default separator is a single space. (joinfields and join are synonymous) """ return sep.join(words)
046d27215fd0037f40cc90b85a66f76ff424347e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/046d27215fd0037f40cc90b85a66f76ff424347e/string.py
return _apply(s.index, args)
return s.index(*args)
def index(s, *args): """index(s, sub [,start [,end]]) -> int Like find but raises ValueError when the substring is not found. """ return _apply(s.index, args)
046d27215fd0037f40cc90b85a66f76ff424347e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/046d27215fd0037f40cc90b85a66f76ff424347e/string.py
return _apply(s.rindex, args)
return s.rindex(*args)
def rindex(s, *args): """rindex(s, sub [,start [,end]]) -> int Like rfind but raises ValueError when the substring is not found. """ return _apply(s.rindex, args)
046d27215fd0037f40cc90b85a66f76ff424347e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/046d27215fd0037f40cc90b85a66f76ff424347e/string.py