rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
string='<img src="%s" alt="%s"' % (self.absolute_url(), alt) if not height:
if alt: string = '%s alt="%s"' % (string, alt) if height==None:
def tag(self, height=None, width=None, alt=None, **args): """ Generate an HTML IMG tag for this image, with customization. Arguments to self.tag() can be any valid attributes of an IMG tag. 'src' will always be an absolute pathname, to prevent redundant downloading of images. Defaults are applied intelligently for 'hei...
419eb703a243bcd3772b7fb8c417c7864da46632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/419eb703a243bcd3772b7fb8c417c7864da46632/Image.py
string = "%s height=%s" % (string, height) if not width:
string = '%s height="%s"' % (string, height) if width==None:
def tag(self, height=None, width=None, alt=None, **args): """ Generate an HTML IMG tag for this image, with customization. Arguments to self.tag() can be any valid attributes of an IMG tag. 'src' will always be an absolute pathname, to prevent redundant downloading of images. Defaults are applied intelligently for 'hei...
419eb703a243bcd3772b7fb8c417c7864da46632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/419eb703a243bcd3772b7fb8c417c7864da46632/Image.py
string = "%s width=%s" % (string, width)
string = '%s width="%s"' % (string, width)
def tag(self, height=None, width=None, alt=None, **args): """ Generate an HTML IMG tag for this image, with customization. Arguments to self.tag() can be any valid attributes of an IMG tag. 'src' will always be an absolute pathname, to prevent redundant downloading of images. Defaults are applied intelligently for 'hei...
419eb703a243bcd3772b7fb8c417c7864da46632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/419eb703a243bcd3772b7fb8c417c7864da46632/Image.py
string = "%s %s=%s" % (string, key, value)
string = '%s %s="%s"' % (string, key, value)
def tag(self, height=None, width=None, alt=None, **args): """ Generate an HTML IMG tag for this image, with customization. Arguments to self.tag() can be any valid attributes of an IMG tag. 'src' will always be an absolute pathname, to prevent redundant downloading of images. Defaults are applied intelligently for 'hei...
419eb703a243bcd3772b7fb8c417c7864da46632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/419eb703a243bcd3772b7fb8c417c7864da46632/Image.py
if validate(None, self, None, o, None):
if validate(None, self, None, o):
def filtered_manage_options(self, REQUEST=None):
6802556b75ffaf78d156d1b01fcbf1e1979f376e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6802556b75ffaf78d156d1b01fcbf1e1979f376e/Management.py
uri=os.path.join(url, absattr(ob.id))
uri=urljoin(url, absattr(ob.id))
def apply(self, obj, url=None, depth=0, result=None, top=1): if result is None: result=StringIO() depth=self.depth url=urlfix(self.request['URL'], 'PROPFIND') url=urlbase(url) result.write('<?xml version="1.0" encoding="utf-8"?>\n' \ '<d:multistatus xmlns:d="DAV:">\n') iscol=isDavCollection(obj) if iscol and url[-1] !=...
8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8/davcmds.py
uri = os.path.join(url, absattr(ob.id))
uri = urljoin(url, absattr(ob.id))
def apply(self, obj, creator=None, depth='infinity', token=None, result=None, url=None, top=1): """ Apply, built for recursion (so that we may lock subitems of a collection if requested """
8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8/davcmds.py
uri = os.path.join(url, absattr(ob.id))
uri = urljoin(url, absattr(ob.id))
def apply(self, obj, token, url=None, result=None, top=1): if result is None: result = StringIO() url = urlfix(url, 'UNLOCK') url = urlbase(url) iscol = isDavCollection(obj) if iscol and url[-1] != '/': url = url + '/' errmsg = None
8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8/davcmds.py
uri = os.path.join(url, absattr(ob.id))
uri = urljoin(url, absattr(ob.id))
def apply(self, obj, token, user, url=None, result=None, top=1): if result is None: result = StringIO() url = urlfix(url, 'DELETE') url = urlbase(url) iscol = isDavCollection(obj) errmsg = None parent = aq_parent(obj)
8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8c4695a1bab040aadcc8d1bcb1d85fa74fc507a8/davcmds.py
_ABSOLUTE_URL=r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\ _ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\
_ABSOLUTE_URL=r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\ _ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\
def doc_strong(self, s, expr = re.compile(r'\*\*([%s%s%s\s]+?)\*\*' % (letters, digits, strongem_punc)).search #expr = re.compile(r'\s*\*\*([ \n\r%s0-9.:/;,\'\"\?\-\_\/\=\-\>\<\(\)]+)\*\*(?!\*|-)' % letters).search, # old expr, inconsistent punc, failed to cross newlines. ):
a786f8a4bcc2743ba6651f0e5516638aff9403fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a786f8a4bcc2743ba6651f0e5516638aff9403fc/DocumentClass.py
if type(path) is type(''): path = path.split( '/')
if isinstance(path, StringType) or isinstance(path, UnicodeType): path = path.split('/')
def setVirtualRoot(self, path, hard=0): """ Treat the current publishing object as a VirtualRoot """ other = self.other if type(path) is type(''): path = path.split( '/') self._script[:] = map(quote, filter(None, path)) del self._steps[:] parents = other['PARENTS'] if hard: del parents[:-1] other['VirtualRootPhysicalPa...
d96eb230cdd07b86ef2409761bef17d9c6eb1c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d96eb230cdd07b86ef2409761bef17d9c6eb1c4e/HTTPRequest.py
print path
def getPhysicalPath(self): '''Returns a path (an immutable sequence of strings) that can be used to access this object again later, for example in a copy/paste operation. getPhysicalRoot() and getPhysicalPath() are designed to operate together. ''' path = (self.id,) p = getattr(self,'aq_inner', None) if p is not None...
054b6c754f81ef98d705df9b8c162d2ec6142a41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/054b6c754f81ef98d705df9b8c162d2ec6142a41/SimpleItem.py
except AttributeError, KeyError: k = None
except (AttributeError, KeyError): k = None
def sort(sequence, sort=(), _=None, mapping=0): """ - sequence is a sequence of objects to be sorted - sort is a sequence of tuples (key,func,direction) that define the sort order: - key is the name of an attribute to sort the objects by - func is the name of a comparison function. This parameter is optional allowe...
92bc647e608d565a1ea733b42dabcdf41de18431 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92bc647e608d565a1ea733b42dabcdf41de18431/SortEx.py
'extra' -- a record-style object that keeps additional index-related parameters 'caller' -- reference to the calling object (usually
'extra' -- a mapping object that keeps additional index-related parameters - subitem 'indexed_attrs' can be string with comma separated attribute names or a list 'caller' -- reference to the calling object (usually
def __init__( self, id, ignore_ex=None, call_methods=None, extra=None, caller=None): """Create an unindex
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
try: self.indexed_attrs = extra.indexed_attrs.split(',') self.indexed_attrs = [ attr.strip() for attr in self.indexed_attrs if attr ] if len(self.indexed_attrs) == 0: self.indexed_attrs = [ self.id ] except: self.indexed_attrs = [ self.id ]
try: ia=extra['indexed_attrs'] if type(ia) in StringTypes: self.indexed_attrs = ia.split(',') else: self.indexed_attrs = list(ia) self.indexed_attrs = [ attr.strip() for attr in self.indexed_attrs if attr ] or [self.id] except: self.indexed_attrs = [ self.id ]
def __init__( self, id, ignore_ex=None, call_methods=None, extra=None, caller=None): """Create an unindex
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: del self._index[entry] self._length.change(-1) ...
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: del self._index[entry] self._length.change(-1) ...
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
'should not happen.' % (self.__class__.__name__, str(documentId), str(self.id)),
'should not happen.' % (self.__class__.__name__, str(documentId), str(self.id)),
def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: del self._index[entry] self._length.change(-1) ...
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
'should not happen.' % (self.__class__.__name__,
'should not happen.' % (self.__class__.__name__,
def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: del self._index[entry] self._length.change(-1) ...
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
res += self._index_object(documentId, obj, threshold, attr) return res > 0
res += self._index_object(documentId, obj, threshold, attr) return res > 0
def index_object(self, documentId, obj, threshold=None): """ wrapper to handle indexing of multiple attributes """
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
raise an exception if we fail
raise an exception if we fail
def unindex_object(self, documentId): """ Unindex the object with integer id 'documentId' and don't raise an exception if we fail """ unindexRecord = self._unindex.get(documentId, _marker) if unindexRecord is _marker: return None
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
return self.indexed_attrs
return self.indexed_attrs
def getIndexSourceNames(self): """ return sequence of indexed attributes """ try: return self.indexed_attrs except: return [ self.id ]
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
return tuple(rl)
return tuple(rl)
def uniqueValues(self, name=None, withLengths=0): """returns the unique values for name
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
def keyForDocument(self, id): # This method is superceded by documentToKeyMap return self._unindex[id]
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
def documentToKeyMap(self): return self._unindex
cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py
self._setupBindings(bindmap) self._makeFunction()
self.ZBindings_edit(bindmap) else: self._makeFunction()
def write(self, text): """ Change the Script by parsing a read()-style source text. """ self._validateProxy() mdata = self._metadata_map() bindmap = self.getBindingAssignments().getAssignedNames() bup = 0
20f70de3cb51b56a06a6dc3650456ac32f82918d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/20f70de3cb51b56a06a6dc3650456ac32f82918d/PythonScript.py
if validate is None: return getattr(inst, name)
if validate is None: return v
def careful_getattr(md, inst, name): if name[:1]!='_': validate=md.validate if validate is None: return getattr(inst, name) if hasattr(inst,'aq_acquire'): return inst.aq_acquire(name, validate, md) v=getattr(inst, name) if validate(inst,inst,name,v,md): return v raise ValidationError, name
d6d04ede0005685b7d1e022a0868ff1a187f764e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d6d04ede0005685b7d1e022a0868ff1a187f764e/DT_Util.py
v=getattr(inst, name)
def careful_getattr(md, inst, name): if name[:1]!='_': validate=md.validate if validate is None: return getattr(inst, name) if hasattr(inst,'aq_acquire'): return inst.aq_acquire(name, validate, md) v=getattr(inst, name) if validate(inst,inst,name,v,md): return v raise ValidationError, name
d6d04ede0005685b7d1e022a0868ff1a187f764e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d6d04ede0005685b7d1e022a0868ff1a187f764e/DT_Util.py
try: if name[:1]!='_': validate=md.validate if validate is None: return hasattr(inst, name) if hasattr(inst,'aq_acquire'): inst.aq_acquire(name, validate, md) return 1 v=getattr(inst, name) if validate(inst,inst,name,v,md): return 1 except: pass
v=getattr(inst, name, _marker) if v is not _marker: try: if name[:1]!='_': validate=md.validate if validate is None: return 1 if hasattr(inst,'aq_acquire'): inst.aq_acquire(name, validate, md) return 1 if validate(inst,inst,name,v,md): return 1 except: pass
def careful_hasattr(md, inst, name): try: if name[:1]!='_': validate=md.validate if validate is None: return hasattr(inst, name) if hasattr(inst,'aq_acquire'): inst.aq_acquire(name, validate, md) return 1 v=getattr(inst, name) if validate(inst,inst,name,v,md): return 1 except: pass return 0
d6d04ede0005685b7d1e022a0868ff1a187f764e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d6d04ede0005685b7d1e022a0868ff1a187f764e/DT_Util.py
def __init__(self, request, iid, options=[]): """ parse a request from the ZPublisher and return a uniform datastructure back to the _apply_index() method of the index
fdb6cada59655c62073a3253b3335a476603cdf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fdb6cada59655c62073a3253b3335a476603cdf1/util.py
addentry(word,srckey,(freq, positions))
addentry(word,srckey,(freq, tuple(positions)))
def index(self, isrc, srckey): '''\ index(src, srckey)
a500dea7f838d1a61173f53a72e943b2b5ed0273 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a500dea7f838d1a61173f53a72e943b2b5ed0273/InvertedIndex.py
if (key[0] == '"'):
if ((key is not None) and (key[0] == '"')):
def __getitem__(self, key): '''\ Get the ResultList objects for the inverted key, key. The key may be a regular expression, in which case a regular expression match is done. The key may be a string, in which case an case-insensitive match is done. ''' index = self._index_object synstop = self.synstop List = self.lis...
a500dea7f838d1a61173f53a72e943b2b5ed0273 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a500dea7f838d1a61173f53a72e943b2b5ed0273/InvertedIndex.py
import jim; jim.debug()
def open_bobobase(): # Open the application database Bobobase=Globals.Bobobase=Globals.PickleDictionary(Globals.BobobaseName) product_dir=os.path.join(SOFTWARE_HOME,'lib/python/Products') __traceback_info__=sys.path try: app=Bobobase['Application'] except KeyError: app=Application() app._init() Bobobase['Applicatio...
2c5688eb5ea0963649b2523354095eacd08560b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2c5688eb5ea0963649b2523354095eacd08560b4/Application.py
return self._unindex(id)
return self._unindex[id]
def keyForDocument(self, id): return self._unindex(id)
c69e95ff4229087de2e87a233c7e42028a133d9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c69e95ff4229087de2e87a233c7e42028a133d9c/UnIndex.py
return absattr(self.v_self().title_or_id())
return absattr(xml_escape(self.v_self().title_or_id()))
def dav__displayname(self): return absattr(self.v_self().title_or_id())
76dd06fa44d169fbbeac8148c5cf71a79d85cbb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76dd06fa44d169fbbeac8148c5cf71a79d85cbb0/PropertySheets.py
r=LazyCat(map(lambda i: i[1], r), len(r))
r=map(lambda i: i[1], r) r=LazyCat(r, reduce(lambda x,y: x+len(y), r, 0))
def searchResults(self, REQUEST=None, used=None, **kw): # Get search arguments: if REQUEST is None and not kw: try: REQUEST=self.REQUEST except AttributeError: pass if kw: if REQUEST: m=MultiMapping() m.push(REQUEST) m.push(kw) kw=m elif REQUEST: kw=REQUEST
10d96c082d81d5cb87c6f012865c259254cbe8f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/10d96c082d81d5cb87c6f012865c259254cbe8f5/Catalog.py
if self.cache_time_ > 0 and self.self.max_cache_ > 0:
if self.cache_time_ > 0 and self.max_cache_ > 0:
def __call__(self, REQUEST=None, __ick__=None, src__=0, **kw): """Call the database method
1baaa88b963b54076eb0d5f8ff2bad814e4a5ad6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1baaa88b963b54076eb0d5f8ff2bad814e4a5ad6/DA.py
def _print_traceback(self, msg, err, test, errlist): if self.showAll or self.dots or self._progress: self.stream.writeln("\n")
def _handle_problem(self, err, test, errlist): if self._debug: raise err[0], err[1], err[2] if errlist is self.errors: prefix = 'Error' else: prefix = 'Failure' tb = "".join(traceback.format_exception(*err)) if self._progress: self.stream.writeln("\r") self.stream.writeln("%s in test %s" % (prefix,test)) self.strea...
def _print_traceback(self, msg, err, test, errlist): if self.showAll or self.dots or self._progress: self.stream.writeln("\n") self._lastWidth = 0
a9c89a0b67fc1f9994135c74507ff3c12dd29e38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a9c89a0b67fc1f9994135c74507ff3c12dd29e38/test.py
tb = "".join(traceback.format_exception(*err)) self.stream.writeln(msg) self.stream.writeln(tb) errlist.append((test, tb))
elif self.showAll: self._lastWidth = 0 self.stream.writeln(prefix.upper()) elif self.dots: self.stream.write(prefix[0]) if not self._progress: errlist.append((test, tb))
def _print_traceback(self, msg, err, test, errlist): if self.showAll or self.dots or self._progress: self.stream.writeln("\n") self._lastWidth = 0
a9c89a0b67fc1f9994135c74507ff3c12dd29e38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a9c89a0b67fc1f9994135c74507ff3c12dd29e38/test.py
if self._progress: self.stream.write("\r") if self._debug: raise err[0], err[1], err[2] self._print_traceback("Error in test %s" % test, err, test, self.errors)
self._handle_problem(err, test, self.errors)
def addError(self, test, err): if self._progress: self.stream.write("\r") if self._debug: raise err[0], err[1], err[2] self._print_traceback("Error in test %s" % test, err, test, self.errors)
a9c89a0b67fc1f9994135c74507ff3c12dd29e38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a9c89a0b67fc1f9994135c74507ff3c12dd29e38/test.py
if self._progress: self.stream.write("\r") if self._debug: raise err[0], err[1], err[2] self._print_traceback("Failure in test %s" % test, err, test, self.failures)
self._handle_problem(err, test, self.failures)
def addFailure(self, test, err): if self._progress: self.stream.write("\r") if self._debug: raise err[0], err[1], err[2] self._print_traceback("Failure in test %s" % test, err, test, self.failures)
a9c89a0b67fc1f9994135c74507ff3c12dd29e38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a9c89a0b67fc1f9994135c74507ff3c12dd29e38/test.py
f=f.read()
title, head, body = parse_html(f)
def upload_html(object, f): dir, name = os.path.split(f) f=open(f) # There is a Document bugs that causes file uploads to fail. # Waaa. This will be fixed in 1.10.2. f=f.read() if old: call(object.manage_addDocument, id=name, file=f) else: call(object.manage_addDTMLDocument, id=name, file=f)
812647066241c3b8856d2926be3e5bf9daef6be1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/812647066241c3b8856d2926be3e5bf9daef6be1/load_site.py
call(object.manage_addDocument, id=name, file=f)
call(object.manage_addDocument, id=name, file=body)
def upload_html(object, f): dir, name = os.path.split(f) f=open(f) # There is a Document bugs that causes file uploads to fail. # Waaa. This will be fixed in 1.10.2. f=f.read() if old: call(object.manage_addDocument, id=name, file=f) else: call(object.manage_addDTMLDocument, id=name, file=f)
812647066241c3b8856d2926be3e5bf9daef6be1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/812647066241c3b8856d2926be3e5bf9daef6be1/load_site.py
call(object.manage_addDTMLDocument, id=name, file=f)
call(object.manage_addDTMLDocument, id=name, title=title, file=body) if head: object=object.__class__(object.url+'/'+name, username=object.username, password=object.password) call(object.manage_addProperty, id="loadsite-head", type="text", value=head)
def upload_html(object, f): dir, name = os.path.split(f) f=open(f) # There is a Document bugs that causes file uploads to fail. # Waaa. This will be fixed in 1.10.2. f=f.read() if old: call(object.manage_addDocument, id=name, file=f) else: call(object.manage_addDTMLDocument, id=name, file=f)
812647066241c3b8856d2926be3e5bf9daef6be1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/812647066241c3b8856d2926be3e5bf9daef6be1/load_site.py
os.system("xterm -e %s &" % cmd)
os.system("xterm -e sh -c '%s | less' &" % cmd)
def specialcommand(self, line, results, first): assert line.startswith("/") line = line[1:] if not line: n = first else: try: n = int(line) - 1 except: print "Huh?" return if n < 0 or n >= len(results): print "Out of range" return docid, score = results[n] path = self.docpaths[docid] i = path.rfind("/") assert i > 0 fo...
eb784ec34a945530a320a2b434a8c422fe90aa7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eb784ec34a945530a320a2b434a8c422fe90aa7f/mhindex.py
qw = max(1, self.index.query_weight(text)) factor = 100.0 / qw / 1024
qw = self.index.query_weight(text)
def formatresults(self, text, results, maxlines=MAXLINES, lo=0, hi=sys.maxint): stop = self.stopdict.has_key words = [w for w in re.findall(r"\w+\*?", text.lower()) if not stop(w)] pattern = r"\b(" + "|".join(words) + r")\b" pattern = pattern.replace("*", ".*") # glob -> re syntax prog = re.compile(pattern, re.IGNORECA...
eb784ec34a945530a320a2b434a8c422fe90aa7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eb784ec34a945530a320a2b434a8c422fe90aa7f/mhindex.py
score = min(100, int(score * factor))
score = 100.0*score/qw
def formatresults(self, text, results, maxlines=MAXLINES, lo=0, hi=sys.maxint): stop = self.stopdict.has_key words = [w for w in re.findall(r"\w+\*?", text.lower()) if not stop(w)] pattern = r"\b(" + "|".join(words) + r")\b" pattern = pattern.replace("*", ".*") # glob -> re syntax prog = re.compile(pattern, re.IGNORECA...
eb784ec34a945530a320a2b434a8c422fe90aa7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eb784ec34a945530a320a2b434a8c422fe90aa7f/mhindex.py
ob=aq_base(self._getCopy(parent))
self.manage_changeOwnershipType(explicit=1) self._notifyOfCopyTo(parent, op=1) ob = aq_base(self._getCopy(parent))
def MOVE(self, REQUEST, RESPONSE): """Move a resource to a new location. Though we may later try to make a move appear seamless across namespaces (e.g. from Zope to Apache), MOVE is currently only supported within the Zope namespace.""" self.dav__init(REQUEST, RESPONSE) self.dav__validate(self, 'DELETE', REQUEST) if no...
20f0492c074ef89511bb95f69e78c89ad3838060 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/20f0492c074ef89511bb95f69e78c89ad3838060/Resource.py
def __save__(self): pass
6a9a414e79d32884205e6653e5f664a4742eb710 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6a9a414e79d32884205e6653e5f664a4742eb710/Application.py
App.Product.initializeProduct(product_name, package_dir, app)
App.Product.initializeProduct(product, product_name, package_dir, app)
def install_products(app): # Install a list of products into the basic folder class, so # that all folders know about top-level objects, aka products path_join=os.path.join product_dir=path_join(SOFTWARE_HOME,'Products') isdir=os.path.isdir exists=os.path.exists DictType=type({}) from Folder import Folder folder_perm...
6a9a414e79d32884205e6653e5f664a4742eb710 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6a9a414e79d32884205e6653e5f664a4742eb710/Application.py
def lcd(e): _k1_='\357\261\390\247\357\362\306\216\226' _k2_='\157\161\090\147\157\122\106\016\126' rot=rotor.newrotor(_k2_, 13) dat=rot.decrypt(e) del rot dat=list(dat) dat.reverse() dat=join(dat,'') dat=marshal.loads(dat) if type(dat) != type([]): rot=rotor.newrotor(_k1_, 13) dat=rot.decrypt(e) del rot dat=list(da...
def install_products(app): # Install a list of products into the basic folder class, so # that all folders know about top-level objects, aka products path_join=os.path.join product_dir=path_join(SOFTWARE_HOME,'Products') isdir=os.path.isdir exists=os.path.exists DictType=type({}) from Folder import Folder folder_perm...
6a9a414e79d32884205e6653e5f664a4742eb710 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6a9a414e79d32884205e6653e5f664a4742eb710/Application.py
{'label':'View', 'action':'view_image_or_file'},
{'label':'View', 'action':''},
def manage_addFile(self,id,file,title='',precondition='',REQUEST=None): """Add a new File object. Creates a new file object 'id' with the contents of 'file'""" self._setObject(id, File(id,title,file,precondition)) if REQUEST is not None: return self.manage_main(self,REQUEST)
6abbe604dc92b28aa5095f5bfc3a248a51a687b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6abbe604dc92b28aa5095f5bfc3a248a51a687b2/Image.py
meth=None
def __init__(self, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr, environ=os.environ): self.environ=environ fp=None try: if environ['REQUEST_METHOD'] != 'GET': fp=stdin except: pass
263101782b65bb5884703edeb0fa50af1d50e396 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/263101782b65bb5884703edeb0fa50af1d50e396/Publish.py
if meth: if environ.has_key('PATH_INFO'): path=environ['PATH_INFO'] while path[-1:]=='/': path=path[:-1] else: path='' other['PATH_INFO']=path="%s/%s" % (path,meth) self._hacked_path=1
if meth: if environ.has_key('PATH_INFO'): path=environ['PATH_INFO'] while path[-1:]=='/': path=path[:-1] else: path='' other['PATH_INFO']=path="%s/%s" % (path,meth) self._hacked_path=1
def __init__(self, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr, environ=os.environ): self.environ=environ fp=None try: if environ['REQUEST_METHOD'] != 'GET': fp=stdin except: pass
263101782b65bb5884703edeb0fa50af1d50e396 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/263101782b65bb5884703edeb0fa50af1d50e396/Publish.py
parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0- =\"]+\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ),
def parse_cookie(text, result=None, parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0- =\"]+\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), ): if result is None: result={} if parmre.match(text) >= 0: name=parmre.group(2) v...
fb42f4125555d6134dfcef194eab0339a226dd18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb42f4125555d6134dfcef194eab0339a226dd18/Publish.py
if parmre.match(text) >= 0:
if qparmre.match(text) >= 0: name=qparmre.group(2) value=qparmre.group(3) l=len(qparmre.group(1)) elif parmre.match(text) >= 0:
def parse_cookie(text, result=None, parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0- =\"]+\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), ): if result is None: result={} if parmre.match(text) >= 0: name=parmre.group(2) v...
fb42f4125555d6134dfcef194eab0339a226dd18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb42f4125555d6134dfcef194eab0339a226dd18/Publish.py
elif qparmre.match(text) >= 0: name=qparmre.group(2) value=qparmre.group(3) l=len(qparmre.group(1))
def parse_cookie(text, result=None, parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0- =\"]+\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), ): if result is None: result={} if parmre.match(text) >= 0: name=parmre.group(2) v...
fb42f4125555d6134dfcef194eab0339a226dd18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb42f4125555d6134dfcef194eab0339a226dd18/Publish.py
def convertSet(s, IITreeSet=IITreeSet):
def convertSet(s, IITreeSet=IITreeSet, IntType=type(0), type=type, len=len, doneTypes = (IntType, IITreeSet)): if type(s) in doneTypes: return s
def convertSet(s, IITreeSet=IITreeSet): if len(s) == 1: try: return s[0] # convert to int except: pass # This is just an optimization. return IITreeSet(s)
d9b19a5f2ece094ee5270244e59a17bf122936b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d9b19a5f2ece094ee5270244e59a17bf122936b1/UnIndex.py
self.__len__=BTrees.Length.Length()
self.__len__=BTrees.Length.Length(len(_index))
def convertSet(s, IITreeSet=IITreeSet): if len(s) == 1: try: return s[0] # convert to int except: pass # This is just an optimization. return IITreeSet(s)
d9b19a5f2ece094ee5270244e59a17bf122936b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d9b19a5f2ece094ee5270244e59a17bf122936b1/UnIndex.py
auth_user=REQUEST.get('AUTHENTICATED_USER', None) if auth_user is not None: verify_watermark(auth_user)
if REQUEST.has_key('AUTHENTICATED_USER'): verify_watermark(REQUEST['AUTHENTICATED_USER'])
def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """Render the document given a client object, REQUEST mapping, Response, and key word arguments.""" kw['document_id'] =self.id kw['document_title']=self.title
be2b1b5d12b163afd67cb380f786203d63ed5d85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/be2b1b5d12b163afd67cb380f786203d63ed5d85/DTMLMethod.py
query += '\nDBConnId: %s' % self.connection_hook
query = query + ('\nDBConnId: %s' % self.connection_hook, )
def _cached_result(self, DB__, query): pure_query = query # we need to munge the incoming query key in the cache # so that the same request to a different db is returned query += '\nDBConnId: %s' % self.connection_hook # Try to fetch from cache if hasattr(self,'_v_cache'): cache=self._v_cache else: cache=self._v_cache...
18286c367b716189bfcd77d1d244027b8e4e1124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/18286c367b716189bfcd77d1d244027b8e4e1124/DA.py
self.REQUEST.RESPONSE.setHeader('Content-Length', self.size)
RESPONSE.setHeader('Content-Length', self.size)
def manage_FTPget(self): """Return body for ftp.""" if self.ZCacheable_isCachingEnabled(): result = self.ZCacheable_get(default=None) if result is not None: # We will always get None from RAMCacheManager but we will get # something implementing the IStreamIterator interface # from FileCacheManager. # the content-length...
7aef1e277b639e6dec5a99927413e94136de906a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7aef1e277b639e6dec5a99927413e94136de906a/Image.py
return str(self.data)
data = self.data if type(data) is type(''): RESPONSE.setBase(None) return data while data is not None: RESPONSE.write(data.data) data = data.next return ''
def manage_FTPget(self): """Return body for ftp.""" if self.ZCacheable_isCachingEnabled(): result = self.ZCacheable_get(default=None) if result is not None: # We will always get None from RAMCacheManager but we will get # something implementing the IStreamIterator interface # from FileCacheManager. # the content-length...
7aef1e277b639e6dec5a99927413e94136de906a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7aef1e277b639e6dec5a99927413e94136de906a/Image.py
if stid <> tid:
if stid == tid: data = self._pickles.get(oid+stid, txn=txn) assert data is not None self._update(deltas, data, 1) else:
def _docommit(self, txn, tid): self._pending.put(self._serial, COMMIT, txn) deltas = {} co = cs = None try: co = self._oids.cursor(txn=txn) cs = self._serials.cursor(txn=txn) rec = co.first() while rec: oid = rec[0] rec = co.next() # Remove from the serials table all entries with key oid where # the serial is not tid. ...
e49710b429392627dda19ad6668554f7b54ba7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e49710b429392627dda19ad6668554f7b54ba7fc/BDBMinimalStorage.py
self._pending.truncate(txn)
def _docommit(self, txn, tid): self._pending.put(self._serial, COMMIT, txn) deltas = {} co = cs = None try: co = self._oids.cursor(txn=txn) cs = self._serials.cursor(txn=txn) rec = co.first() while rec: oid = rec[0] rec = co.next() # Remove from the serials table all entries with key oid where # the serial is not tid. ...
e49710b429392627dda19ad6668554f7b54ba7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e49710b429392627dda19ad6668554f7b54ba7fc/BDBMinimalStorage.py
def setBase(self,base):
def setBase(self,base, URL):
def setBase(self,base):
40ca0c05880e30125958daeb8df8b60c9a564e5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/40ca0c05880e30125958daeb8df8b60c9a564e5c/Response.py
def insertBase(self):
def host(self,base): return base[:string.find(base,'/',string.find(base,'//'))] def insertBase(self, base_re=regex.compile('\(<base[\0- ]+\([^>]+\)>\)', regex.casefold) ):
def insertBase(self):
40ca0c05880e30125958daeb8df8b60c9a564e5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/40ca0c05880e30125958daeb8df8b60c9a564e5c/Response.py
e=end_of_header_re.search(body) if e >= 0 and base_re.search(body) < 0: self.body=('%s\t<base href="%s">\n%s' % (body[:e],self.base,body[e:]))
if body: e=end_of_header_re.search(body) if e >= 0: b=base_re.search(body) if b < 0: self.body=('%s\t<base href="%s">\n%s' % (body[:e],self.base,body[e:])) elif self.URL: href=base_re.group(2) base='' if href[:1]=='/': base=self.host(self.base)+href elif href[:1]=='.': base=self.URL while href[:1]=='.': if href[:2]=='....
def insertBase(self):
40ca0c05880e30125958daeb8df8b60c9a564e5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/40ca0c05880e30125958daeb8df8b60c9a564e5c/Response.py
(regex.compile('"'), '&quote;'))):
(regex.compile('"'), '&quot;'))):
def quoteHTML(self,text,
40ca0c05880e30125958daeb8df8b60c9a564e5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/40ca0c05880e30125958daeb8df8b60c9a564e5c/Response.py
def format_exception(self,etype,value,tb,limit=None): import traceback result=['Traceback (innermost last):'] if limit is None: if hasattr(sys, 'tracebacklimit'): limit = sys.tracebacklimit n = 0 while tb is not None and (limit is None or n < limit): f = tb.tb_frame lineno = tb.tb_lineno co = f.f_code filename = co.co...
def quoteHTML(self,text,
40ca0c05880e30125958daeb8df8b60c9a564e5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/40ca0c05880e30125958daeb8df8b60c9a564e5c/Response.py
import traceback tb=string.joinfields(traceback.format_exception(t,v,tb,200),'\n')
tb=self.format_exception(t,v,tb,200) tb=string.joinfields(tb,'\n')
def _traceback(self,t,v,tb):
40ca0c05880e30125958daeb8df8b60c9a564e5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/40ca0c05880e30125958daeb8df8b60c9a564e5c/Response.py
def exception(self):
def exception(self, fatal=0):
def exception(self):
40ca0c05880e30125958daeb8df8b60c9a564e5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/40ca0c05880e30125958daeb8df8b60c9a564e5c/Response.py
('<tr><th>%s</th>\n' ' <td><input name="%s"\n' ' width=30 value="%s">' '</td></tr>'
('<tr> <th>%s</th>\n' ' <td><input name="%s"\n' ' width=30 value="%s">' ' </td></tr>'
def default_input_form(id,arguments,action='query', tabs=''): if arguments: items=arguments.items() return ( "%s\n%s%s" % ( '<html><head><title>%s Input Data</title></head><body>\n%s\n' '<form action="<!--#var URL2-->/<!--#var id-->/%s" ' 'method="get">\n' '<h2>%s Input Data</h2>\n' 'Enter query parameters:<br>' '<tabl...
b8757f3ab99cb2672f478a28ef2037ce014e6ea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8757f3ab99cb2672f478a28ef2037ce014e6ea6/Aqueduct.py
heading=('<tr>\n%s\n</tr>' %
heading=('<tr>\n%s </tr>' %
def custom_default_report(id, result, action='', no_table=0, goofy=regex.compile('[^a-zA-Z0-9_]').search ): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\n</tr>' % string.joinfields( map(lambda c: ' <th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, ...
b8757f3ab99cb2672f478a28ef2037ce014e6ea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8757f3ab99cb2672f478a28ef2037ce014e6ea6/Aqueduct.py
' <th>%s</th>\n' % nicify(c['name']),
' <th>%s</th>\n' % nicify(c['name']),
def custom_default_report(id, result, action='', no_table=0, goofy=regex.compile('[^a-zA-Z0-9_]').search ): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\n</tr>' % string.joinfields( map(lambda c: ' <th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, ...
b8757f3ab99cb2672f478a28ef2037ce014e6ea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8757f3ab99cb2672f478a28ef2037ce014e6ea6/Aqueduct.py
if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' else: tr, _tr, td, _td, delim = '<tr>', '</tr>', '<td>', '</td>', '' if no_table: tr='<p>', '</p>' else: tr, _tr = '<tr>', '</tr>'
if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ',\n' else: tr, _tr, td, _td, delim = '<tr>', '</tr>', '<td>', '</td>', '\n'
def custom_default_report(id, result, action='', no_table=0, goofy=regex.compile('[^a-zA-Z0-9_]').search ): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\n</tr>' % string.joinfields( map(lambda c: ' <th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, ...
b8757f3ab99cb2672f478a28ef2037ce014e6ea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8757f3ab99cb2672f478a28ef2037ce014e6ea6/Aqueduct.py
row.append(' %s<!--
row.append(' %s<!--
def custom_default_report(id, result, action='', no_table=0, goofy=regex.compile('[^a-zA-Z0-9_]').search ): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\n</tr>' % string.joinfields( map(lambda c: ' <th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, ...
b8757f3ab99cb2672f478a28ef2037ce014e6ea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8757f3ab99cb2672f478a28ef2037ce014e6ea6/Aqueduct.py
row=('%s\n%s\n%s' % (tr,string.joinfields(row,delim), _tr))
row=(' %s\n%s\n %s' % (tr,string.joinfields(row,delim), _tr))
def custom_default_report(id, result, action='', no_table=0, goofy=regex.compile('[^a-zA-Z0-9_]').search ): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\n</tr>' % string.joinfields( map(lambda c: ' <th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, ...
b8757f3ab99cb2672f478a28ef2037ce014e6ea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8757f3ab99cb2672f478a28ef2037ce014e6ea6/Aqueduct.py
def decapitate(html, RESPONSE=None, header_re=regex.compile( '\(\(' '[^\0- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=regex.compile('\([ \t]+\)'), name_re=regex.compile('\([^\0- <>:]+\):\([^\n]*\)'), ): if header_re.match(html) < 0: return html headers, html = header_re.grou...
b8757f3ab99cb2672f478a28ef2037ce014e6ea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8757f3ab99cb2672f478a28ef2037ce014e6ea6/Aqueduct.py
if isinstance(s, HTML):
try: _isinstance=isinstance(s, HTML) except TypeError: _isinstance=None if _isinstance:
def raise_standardErrorMessage( self, client=None, REQUEST={}, error_type=None, error_value=None, tb=None, error_tb=None, error_message='', tagSearch=re.compile(r'[a-zA-Z]>').search):
41df146032ee9a41603d9129d455f505a53568bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/41df146032ee9a41603d9129d455f505a53568bd/SimpleItem.py
if xdelta and width==None: width = int(width) * xdelta if ydelta and height==None: height = int(height) * ydelta
if xdelta and width != None: width = str(int(width) * xdelta) if ydelta and height != None: height = str(int(height) * ydelta)
def tag(self, height=None, width=None, alt=None, scale=0, xscale=0, yscale=0, **args): """ Generate an HTML IMG tag for this image, with customization. Arguments to self.tag() can be any valid attributes of an IMG tag. 'src' will always be an absolute pathname, to prevent redundant downloading of images. Defaults are a...
deace3624ff78aec11be564eef5eff6b98ac9e9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/deace3624ff78aec11be564eef5eff6b98ac9e9f/Image.py
t = type(value) if not isinstance(t, StringType): if not isinstance(t, TupleType):
if not isinstance(value, StringType): if not isinstance(value, TupleType):
def __init__(self, value=0): t = type(value) if not isinstance(t, StringType): if not isinstance(t, TupleType): if value == 0: value = time.time() value = time.localtime(value) value = time.strftime("%Y%m%dT%H:%M:%S", value) self.value = value
45189c67385ffe071c4615607a40096147bc77d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/45189c67385ffe071c4615607a40096147bc77d9/xmlrpclib.py
self.col = self.col + align
self.col = align
def do_startTag(self, name, attrList, end=">"): if not attrList: s = "<%s%s" % (name, end) self.do_rawtextOffset(s, len(s)) return _len = len self._stream_write("<" + name) self.col = self.col + _len(name) + 1 align = self.col + 1 + _len(name) if align >= self.wrap/2: align = 4 # Avoid a narrow column far to the right ...
4dacfebc7f76049595273adc75d0880ddf1d4263 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4dacfebc7f76049595273adc75d0880ddf1d4263/TALInterpreter.py
try: query=apply(self.template, (p,), argdata)
try: try: query=apply(self.template, (p,), argdata) except TypeError, msg: msg = str(msg) if find(msg,'client'): raise NameError("'client' may not be used as an " + "argument name in this context") else: raise
def __call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw): """Call the database method
dbf824f496b6d121916c9c8c827cae0cc4afd39a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dbf824f496b6d121916c9c8c827cae0cc4afd39a/DA.py
return ', '.join(users, ', ')
return ', '.join(users)
def creator(self): """Return a sequence of user names who have the local Owner role on an object. The name creator is used for this method to conform to Dublin Core.""" users=[] for user, roles in self.get_local_roles(): if 'Owner' in roles: users.append(user) return ', '.join(users, ', ')
364dbabbaf3733fadd8825986c9048fb1cd2ad61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/364dbabbaf3733fadd8825986c9048fb1cd2ad61/CatalogPathAwareness.py
REQURE_PYEXPAT = 1
REQUIRE_PYEXPAT = 1
def main(): # below assumes this script is in the BASE_DIR/inst directory global PREFIX BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0]))) BUILD_BASE=os.path.join(os.getcwd(), 'build-base') PYTHON=sys.executable MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read() REQUIRE_LF_ENABLED = ...
f3271050ca848ea38700a303ebb14f3981ae5974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f3271050ca848ea38700a303ebb14f3981ae5974/configure.py
def test_different_queries_same_second(self): # This tests different queries being fired into the cache # in the same second. # XXX The demonstrates a memory leak in the cache code self._check_cache({},{}) # one self._do_query('query1',1.0) self._check_cache( {('query1',1,'conn_id'): (1.0,'result for query1')}, {1: ('q...
ca12da8d8f9a4b8ced17906e437a643eebcd3974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ca12da8d8f9a4b8ced17906e437a643eebcd3974/test_caching.py
def test_different_queries_same_second(self): # This tests different queries being fired into the cache # in the same second. # XXX The demonstrates a memory leak in the cache code self._check_cache({},{}) # one self._do_query('query1',1.0) self._check_cache( {('query1',1,'conn_id'): (1.0,'result for query1')}, {1: ('q...
ca12da8d8f9a4b8ced17906e437a643eebcd3974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ca12da8d8f9a4b8ced17906e437a643eebcd3974/test_caching.py
def test_different_queries_same_second(self): # This tests different queries being fired into the cache # in the same second. # XXX The demonstrates a memory leak in the cache code self._check_cache({},{}) # one self._do_query('query1',1.0) self._check_cache( {('query1',1,'conn_id'): (1.0,'result for query1')}, {1: ('q...
ca12da8d8f9a4b8ced17906e437a643eebcd3974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ca12da8d8f9a4b8ced17906e437a643eebcd3974/test_caching.py
if type(body) == InstanceType:
if type(body) == types.InstanceType:
def setBody(self, body, title='', is_error=0, bogus_str_search=None): if isinstance(body, xmlrpclib.Fault): # Convert Fault object to XML-RPC response. body=xmlrpclib.dumps(body, methodresponse=1) else: if type(body) == InstanceType: # Avoid disclosing private members. Private members are # by convention named with a l...
43258473ebd7cebba514cea2adcf18719b435541 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/43258473ebd7cebba514cea2adcf18719b435541/xmlrpc.py
parent=request['PARENTS'][0]
parents=request.get('PARENTS', []) if not parents: parent=self.aq_parent else: parent=parents[0]
def validate(self,request,auth='',roles=None): parent=request['PARENTS'][0]
eb14b8a53497aaada9d74c06cc2884c6c711e634 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eb14b8a53497aaada9d74c06cc2884c6c711e634/User.py
setDefaultRoles__roles__=ACCESS_PRIVATE def setDefaultRoles(self, permission_name, roles):
setPermissionDefault__roles__=ACCESS_PRIVATE def setPermissionDefault(self, permission_name, roles):
def declareObjectProtected(self, permission_name): """Declare the object to be associated with a permission.""" self._setaccess((), permission_name)
642f5418e6834ed05f29d1162fc08083337d0eeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/642f5418e6834ed05f29d1162fc08083337d0eeb/SecurityInfo.py
method when executed.
method when executed. Raises a ValueError if the instance does not have a method with the specified name.
def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. """ try: self.__testMethod = getattr(self,methodName) except AttributeError: raise ValueError,"no such test method: %s" % methodName
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
raise ValueError,"no such test method: %s" % methodName
raise ValueError, "no such test method in %s: %s" % \ (self.__class__, methodName)
def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. """ try: self.__testMethod = getattr(self,methodName) except AttributeError: raise ValueError,"no such test method: %s" % methodName
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
return "%s.%s" % (self.__class__, self.__testMethod.__name__)
return "%s (%s)" % (self.__testMethod.__name__, self.__class__)
def __str__(self): return "%s.%s" % (self.__class__, self.__testMethod.__name__)
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
raise AssertionError, (hasattr(excClass,'__name__') and excClass.__name__ or str(excClass))
if hasattr(excClass,'__name__'): excName = excClass.__name__ else: excName = str(excClass) raise AssertionError, excName
def assertRaises(self, excClass, callableObj, *args, **kwargs): """Assert that an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an er...
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
def __str__(self):
def __repr__(self):
def __str__(self): return "<%s tests=%s>" % (self.__class__, self._tests)
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
__repr__ = __str__
__str__ = __repr__
def __str__(self): return "<%s tests=%s>" % (self.__class__, self._tests)
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
class FunctionTestCase(TestCase): """A test case that wraps a test function. This is useful for slipping pre-existing test functions into the PyUnit framework. Optionally, set-up and tidy-up functions can be supplied. As with TestCase, the tidy-up ('tearDown') function will always be called if the set-up ('setUp') f...
def __call__(self, result): for test in self._tests: if result.shouldStop: break test(result) return result
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py
self.write(os.linesep)
self.write(self.linesep)
def writeln(self, *args): if args: apply(self.write, args) self.write(os.linesep)
fac958bd81e4609cbbce6fe5e9a0e95fb8305459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fac958bd81e4609cbbce6fe5e9a0e95fb8305459/unittest.py