rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def _if_modified_since_request_handler(self, REQUEST, RESPONSE): # HTTP If-Modified-Since header handling: return True if # we can handle this request by returning a 304 response header=REQUEST.get_header('If-Modified-Since', None) if header is not None: header=header.split( ';')[0] # Some proxies seem to send invalid date strings for this # header. If the date string is not valid, we ignore it # rather than raise an error to be generally consistent # with common servers such as Apache (which can usually # understand the screwy date string as a lucky side effect # of the way they parse it). # This happens to be what RFC2616 tells us to do in the face of an # invalid date. try: mod_since=long(DateTime(header).timeTime()) except: mod_since=None if mod_since is not None: if self._p_mtime: last_mod = long(self._p_mtime) else: last_mod = long(0) if last_mod > 0 and last_mod <= mod_since: # Set header values since apache caching will return # Content-Length of 0 in response if size is not set here RESPONSE.setHeader('Last-Modified', rfc1123_date(self._p_mtime)) RESPONSE.setHeader('Content-Type', self.content_type) RESPONSE.setHeader('Content-Length', self.size) RESPONSE.setHeader('Accept-Ranges', 'bytes') RESPONSE.setStatus(304) return True
c7ab79ce8414f1a87ce1d85eba390bf4edf1cace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c7ab79ce8414f1a87ce1d85eba390bf4edf1cace/Image.py
RESPONSE.setHeader('Content-Length', self.size)
def _if_modified_since_request_handler(self, REQUEST, RESPONSE): # HTTP If-Modified-Since header handling: return True if # we can handle this request by returning a 304 response header=REQUEST.get_header('If-Modified-Since', None) if header is not None: header=header.split( ';')[0] # Some proxies seem to send invalid date strings for this # header. If the date string is not valid, we ignore it # rather than raise an error to be generally consistent # with common servers such as Apache (which can usually # understand the screwy date string as a lucky side effect # of the way they parse it). # This happens to be what RFC2616 tells us to do in the face of an # invalid date. try: mod_since=long(DateTime(header).timeTime()) except: mod_since=None if mod_since is not None: if self._p_mtime: last_mod = long(self._p_mtime) else: last_mod = long(0) if last_mod > 0 and last_mod <= mod_since: # Set header values since apache caching will return # Content-Length of 0 in response if size is not set here RESPONSE.setHeader('Last-Modified', rfc1123_date(self._p_mtime)) RESPONSE.setHeader('Content-Type', self.content_type) RESPONSE.setHeader('Content-Length', self.size) RESPONSE.setHeader('Accept-Ranges', 'bytes') RESPONSE.setStatus(304) return True
c7ab79ce8414f1a87ce1d85eba390bf4edf1cace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c7ab79ce8414f1a87ce1d85eba390bf4edf1cace/Image.py
$Id: Publish.py,v 1.27 1996/12/30 14:36:12 jim Exp $"""
$Id: Publish.py,v 1.28 1997/01/08 23:22:45 jim Exp $"""
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
e4d209501bbb231c07d5e6c2f30b761bb8a056fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4d209501bbb231c07d5e6c2f30b761bb8a056fc/Publish.py
__version__='$Revision: 1.27 $'[11:-2]
__version__='$Revision: 1.28 $'[11:-2]
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
e4d209501bbb231c07d5e6c2f30b761bb8a056fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4d209501bbb231c07d5e6c2f30b761bb8a056fc/Publish.py
return string.atoi(v)
if v: return string.atoi(v) raise ValueError, 'Empty entry when integer expected'
def field2int(v): try: v=v.read() except: v=str(v) return string.atoi(v)
e4d209501bbb231c07d5e6c2f30b761bb8a056fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4d209501bbb231c07d5e6c2f30b761bb8a056fc/Publish.py
return string.atof(v)
if v: return string.atof(v) raise ValueError, 'Empty entry when floating-point number expected'
def field2float(v): try: v=v.read() except: v=str(v) return string.atof(v)
e4d209501bbb231c07d5e6c2f30b761bb8a056fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4d209501bbb231c07d5e6c2f30b761bb8a056fc/Publish.py
return string.atol(v)
if v: return string.atol(v) raise ValueError, 'Empty entry when integer expected'
def field2long(v): try: v=v.read() except: v=str(v) return string.atol(v)
e4d209501bbb231c07d5e6c2f30b761bb8a056fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4d209501bbb231c07d5e6c2f30b761bb8a056fc/Publish.py
if not withValues:
if not withLengths:
def uniqueValues( self, name=None, withLengths=0 ): """ Return a list of unique values for 'name'.
ab8c7b7acbc27e40b179b02ef2b81ad8b5a8c3cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ab8c7b7acbc27e40b179b02ef2b81ad8b5a8c3cc/DateRangeIndex.py
def absolute_url(self, relative=0): """Return an absolute url to the object. Note that the url will reflect the acquisition path of the object if the object has been acquired.""" if relative: return '' return self.aq_acquire('REQUEST').script
def MOVE(self, REQUEST, RESPONSE): """Move a resource to a new location.""" self.dav__init(REQUEST, RESPONSE) raise 'Forbidden', 'This resource cannot be moved.'
61525462642d8c46e3e2c87e4ff975b9c4563068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/61525462642d8c46e3e2c87e4ff975b9c4563068/Application.py
try: import pwd try: try: UID = int(UID) except: pass gid = None if type(UID) == type(""): uid = pwd.getpwnam(UID)[2] gid = pwd.getpwnam(UID)[3] elif type(UID) == type(1): uid = pwd.getpwuid(UID)[2] gid = pwd.getpwuid(UID)[3] else: raise KeyError try: if gid is not None: try: os.setgid(gid) except OSError: pass os.setuid(uid) except OSError: pass except KeyError: zLOG.LOG("z2", zLOG.ERROR, ("can't find UID %s" % UID)) except: pass
def set_locale(val): try: import locale except: raise SystemExit, ( 'The locale module could not be imported.\n' 'To use localization options, you must ensure\n' 'that the locale module is compiled into your\n' 'Python installation.' ) try: locale.setlocale(locale.LC_ALL, val) except: raise SystemExit, ( 'The specified locale is not supported by your system.\n' 'See your operating system documentation for more\n' 'information on locale support.' )
8215b81611f4be60c3788dd2514cb72f624f7f39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8215b81611f4be60c3788dd2514cb72f624f7f39/z2.py
info = format_exception(exc[0], exc[1], exc[2], limit=200)
info = ''.join(format_exception(exc[0], exc[1], exc[2], limit=200))
def logBadRefresh(productid): exc = sys.exc_info() try: LOG('Refresh', ERROR, 'Exception while refreshing %s' % productid, error=exc) if hasattr(exc[0], '__name__'): error_type = exc[0].__name__ else: error_type = str(exc[0]) error_value = str(exc[1]) info = format_exception(exc[0], exc[1], exc[2], limit=200) refresh_exc_info[productid] = (error_type, error_value, info) finally: exc = None
cf6d9a621a71537c85f44c244e982ec4a657c992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cf6d9a621a71537c85f44c244e982ec4a657c992/RefreshFuncs.py
if base[-1:] != '/': base=base+'/'
if base[-1:] != '/': base=base+'/'
def setBase(self,base): 'Set the base URL for the returned document.' if base[-1:] != '/': base=base+'/' self.base=base self.insertBase()
e297f298ed9fdc5408019efd9ae51038da5333df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e297f298ed9fdc5408019efd9ae51038da5333df/HTTPResponse.py
self.insertBase()
def setBase(self,base): 'Set the base URL for the returned document.' if base[-1:] != '/': base=base+'/' self.base=base self.insertBase()
e297f298ed9fdc5408019efd9ae51038da5333df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e297f298ed9fdc5408019efd9ae51038da5333df/HTTPResponse.py
if self.headers.get('content-type', '')[:9] != 'text/html':
content_type = self.headers.get('content-type', '')[:9] if content_type and (content_type != 'text/html'):
def insertBase(self, base_re_search=regex.compile('\(<base[\0- ]+[^>]+>\)', regex.casefold).search ): # Only insert a base tag if content appears to be html. if self.headers.get('content-type', '')[:9] != 'text/html': return
e297f298ed9fdc5408019efd9ae51038da5333df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e297f298ed9fdc5408019efd9ae51038da5333df/HTTPResponse.py
def getOwner(self, info=0):
def getOwner(self, info=0, aq_get=aq_get, None=None, UnownableOwner=UnownableOwner, getSecurityManager=getSecurityManager, ):
def getOwner(self, info=0): """Get the owner
3b3187760f2df80a121aad2531855fc06838c700 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3b3187760f2df80a121aad2531855fc06838c700/Owned.py
return self.getOwnerTuple() return aq_base(self.getWrappedOwner())
owner=aq_get(self, '_owner', None, 1) if info or (owner is None): return owner if owner is UnownableOwner: return None udb, oid = owner root=self.getPhysicalRoot() udb=root.unrestrictedTraverse(udb, None) if udb is None: user = SpecialUsers.nobody else: user = udb.getUserById(oid, None) if user is None: user = SpecialUsers.nobody return user
def getOwner(self, info=0): """Get the owner
3b3187760f2df80a121aad2531855fc06838c700 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3b3187760f2df80a121aad2531855fc06838c700/Owned.py
self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'), u'Le 02/05/2002 \xe0 10h00')
ok = dt.strftime('Le %d/%m/%Y a %Hh%M').replace('a', u'\xe0') self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'), ok)
def testStrftimeUnicode(self): dt = DateTime('2002-05-02T08:00:00+00:00') self.assertEqual(dt.strftime(u'Le %d/%m/%Y \xe0 %Hh%M'), u'Le 02/05/2002 \xe0 10h00')
2dd2cf21595cb29e4e5b484b6511536a049f0a22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2dd2cf21595cb29e4e5b484b6511536a049f0a22/testDateTime.py
return getattr(folder, id)
return folder._getOb(id)
def createInObjectManager(self, id, REQUEST, RESPONSE=None): """ Create Z instance. If called with a RESPONSE, the RESPONSE will be redirected to the management screen of the new instance's parent Folder. Otherwise, the instance will be returned. """ i=mapply(self._zclass_, (), REQUEST) if not hasattr(i, 'id') or not i.id: i.id=id
d068550429841ed876ffadec11df89c6f8e5dc48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d068550429841ed876ffadec11df89c6f8e5dc48/ZClass.py
if StructuredText is None: from StructuredText import html_with_references return str(html_with_references(str(v),level=3,header=0))
if StructuredText is None: from StructuredText.StructuredText import HTML return HTML(str(v),level=3,header=0)
def structured_text(v, name='(Unknown name)', md={}): global StructuredText if StructuredText is None: from StructuredText import html_with_references return str(html_with_references(str(v),level=3,header=0))
7763ce75ea4e6164fd3b40c6ef0b7c15a5c2b6bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7763ce75ea4e6164fd3b40c6ef0b7c15a5c2b6bc/DT_Var.py
print "setting addNotificationTarget to %s" % f
def setAddNotificationTarget(self, f): # We should assert that the callback function 'f' implements # the TransientNotification interface print "setting addNotificationTarget to %s" % f self._addCallback = f
a1625a5f426bedf4fa19fa8151669c58547a794e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a1625a5f426bedf4fa19fa8151669c58547a794e/Transience.py
print "setting delNotificationTarget to %s" % f
def setDelNotificationTarget(self, f): # We should assert that the callback function 'f' implements # the TransientNotification interface print "setting delNotificationTarget to %s" % f self._delCallback = f
a1625a5f426bedf4fa19fa8151669c58547a794e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a1625a5f426bedf4fa19fa8151669c58547a794e/Transience.py
elif rawdata.startswith("<!--", i):
elif _contains_at(rawdata, "<!--", i):
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: match = self.interesting.search(rawdata, i) # < or & if match: j = match.start() else: j = n if i < j: self.handle_data(rawdata[i:j]) i = self.updatepos(i, j) if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): # < + letter k = self.parse_starttag(i) elif endtagopen.match(rawdata, i): # </ k = self.parse_endtag(i) if k >= 0: self.clear_cdata_mode() elif rawdata.startswith("<!--", i): # <!-- k = self.parse_comment(i) elif rawdata.startswith("<?", i): # <? k = self.parse_pi(i) elif rawdata.startswith("<!", i): # <! k = self.parse_declaration(i) elif (i + 1) < n: self.handle_data("<") k = i + 1 else: break if k < 0: if end: self.error("EOF in middle of construct") break i = self.updatepos(i, k) elif rawdata[i:i+2] == "&#": match = charref.match(rawdata, i) if match: name = match.group()[2:-1] self.handle_charref(name) k = match.end() if rawdata[k-1] != ';': k = k - 1 i = self.updatepos(i, k) continue else: break elif rawdata[i] == '&': match = entityref.match(rawdata, i) if match: name = match.group(1) self.handle_entityref(name) k = match.end() if rawdata[k-1] != ';': k = k - 1 i = self.updatepos(i, k) continue match = incomplete.match(rawdata, i) if match: # match.group() will contain at least 2 chars rest = rawdata[i:] if end and match.group() == rest: self.error("EOF in middle of entity or char ref") # incomplete break elif (i + 1) < n: # not the end of the buffer, and can't be confused # with some other construct self.handle_data("&") i = self.updatepos(i, i + 1) else: break else: assert 0, "interesting.search() lied" # end while if end and i < n: self.handle_data(rawdata[i:n]) i = self.updatepos(i, n) self.rawdata = rawdata[i:]
6fbd157e92c897e6e9a8880926f60674c78944bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6fbd157e92c897e6e9a8880926f60674c78944bc/HTMLParser.py
elif rawdata.startswith("<?", i):
elif _contains_at(rawdata, "<?", i):
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: match = self.interesting.search(rawdata, i) # < or & if match: j = match.start() else: j = n if i < j: self.handle_data(rawdata[i:j]) i = self.updatepos(i, j) if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): # < + letter k = self.parse_starttag(i) elif endtagopen.match(rawdata, i): # </ k = self.parse_endtag(i) if k >= 0: self.clear_cdata_mode() elif rawdata.startswith("<!--", i): # <!-- k = self.parse_comment(i) elif rawdata.startswith("<?", i): # <? k = self.parse_pi(i) elif rawdata.startswith("<!", i): # <! k = self.parse_declaration(i) elif (i + 1) < n: self.handle_data("<") k = i + 1 else: break if k < 0: if end: self.error("EOF in middle of construct") break i = self.updatepos(i, k) elif rawdata[i:i+2] == "&#": match = charref.match(rawdata, i) if match: name = match.group()[2:-1] self.handle_charref(name) k = match.end() if rawdata[k-1] != ';': k = k - 1 i = self.updatepos(i, k) continue else: break elif rawdata[i] == '&': match = entityref.match(rawdata, i) if match: name = match.group(1) self.handle_entityref(name) k = match.end() if rawdata[k-1] != ';': k = k - 1 i = self.updatepos(i, k) continue match = incomplete.match(rawdata, i) if match: # match.group() will contain at least 2 chars rest = rawdata[i:] if end and match.group() == rest: self.error("EOF in middle of entity or char ref") # incomplete break elif (i + 1) < n: # not the end of the buffer, and can't be confused # with some other construct self.handle_data("&") i = self.updatepos(i, i + 1) else: break else: assert 0, "interesting.search() lied" # end while if end and i < n: self.handle_data(rawdata[i:n]) i = self.updatepos(i, n) self.rawdata = rawdata[i:]
6fbd157e92c897e6e9a8880926f60674c78944bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6fbd157e92c897e6e9a8880926f60674c78944bc/HTMLParser.py
elif rawdata.startswith("<!", i):
elif _contains_at(rawdata, "<?", i):
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: match = self.interesting.search(rawdata, i) # < or & if match: j = match.start() else: j = n if i < j: self.handle_data(rawdata[i:j]) i = self.updatepos(i, j) if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): # < + letter k = self.parse_starttag(i) elif endtagopen.match(rawdata, i): # </ k = self.parse_endtag(i) if k >= 0: self.clear_cdata_mode() elif rawdata.startswith("<!--", i): # <!-- k = self.parse_comment(i) elif rawdata.startswith("<?", i): # <? k = self.parse_pi(i) elif rawdata.startswith("<!", i): # <! k = self.parse_declaration(i) elif (i + 1) < n: self.handle_data("<") k = i + 1 else: break if k < 0: if end: self.error("EOF in middle of construct") break i = self.updatepos(i, k) elif rawdata[i:i+2] == "&#": match = charref.match(rawdata, i) if match: name = match.group()[2:-1] self.handle_charref(name) k = match.end() if rawdata[k-1] != ';': k = k - 1 i = self.updatepos(i, k) continue else: break elif rawdata[i] == '&': match = entityref.match(rawdata, i) if match: name = match.group(1) self.handle_entityref(name) k = match.end() if rawdata[k-1] != ';': k = k - 1 i = self.updatepos(i, k) continue match = incomplete.match(rawdata, i) if match: # match.group() will contain at least 2 chars rest = rawdata[i:] if end and match.group() == rest: self.error("EOF in middle of entity or char ref") # incomplete break elif (i + 1) < n: # not the end of the buffer, and can't be confused # with some other construct self.handle_data("&") i = self.updatepos(i, i + 1) else: break else: assert 0, "interesting.search() lied" # end while if end and i < n: self.handle_data(rawdata[i:n]) i = self.updatepos(i, n) self.rawdata = rawdata[i:]
6fbd157e92c897e6e9a8880926f60674c78944bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6fbd157e92c897e6e9a8880926f60674c78944bc/HTMLParser.py
for keys, values in defaults.items(): if not form.has_key(keys) and not form == {}: form[keys]=values else: if not form == {}: if hasattr(values, '__class__') and values.__class__ is record: r = form[keys] for k, v in values.__dict__.items(): if not hasattr(r, k): setattr(r,k,v) form[keys] = r
for keys, values in defaults.items(): if not form.has_key(keys) and not form == {}: form[keys]=values else: if not form == {}: if hasattr(values, '__class__') and values.__class__ is record: r = form[keys] for k, v in values.__dict__.items(): if not hasattr(r, k): setattr(r,k,v) form[keys] = r else: l = form[keys] for x in values: if hasattr(x, '__class__') and x.__class__ is record: for k, v in x.__dict__.items(): for y in l: if not hasattr(y, k): setattr(y, k, v) else: if not a in l: l.append(a) form[keys] = l for key in tuple_items.keys(): k=split(key, ".") k,attr=join(k[:-1], "."), k[-1] a = attr while not a=='': a=split(a, ":") a,new=join(a[:-1], ":"), a[-1] attr = new if form.has_key(k): item =form[k] if hasattr(item, '__class__') and item.__class__ is record: if hasattr(item,attr): value=tuple(getattr(item,attr)) setattr(item,attr,value)
def __str__(self): L1 = self.__dict__.items() L1.sort() return join(map(lambda item: "%s: %s" %item, L1), ", ")
f718847ec8e4ea175d6618ba71bda90b3862f2f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f718847ec8e4ea175d6618ba71bda90b3862f2f5/HTTPRequest.py
l = form[keys] for x in values: if hasattr(x, '__class__') and x.__class__ is record: for k, v in x.__dict__.items(): for y in l: if not hasattr(y, k): setattr(y, k, v) else: if not a in l: l.append(a) form[keys] = l for key in tuple_items.keys(): k=split(key, ".") k,attr=join(k[:-1], "."), k[-1] a = attr while not a=='': a=split(a, ":") a,new=join(a[:-1], ":"), a[-1] attr = new if form.has_key(k): item =form[k] if hasattr(item, '__class__') and item.__class__ is record: if hasattr(item,attr): value=tuple(getattr(item,attr)) setattr(item,attr,value) else: for x in item: if hasattr(x, attr): value=tuple(getattr(x,attr)) setattr(x,attr,value) else: if form.has_key(key): item=form[key] item=tuple(form[key]) form[key]=item
for x in item: if hasattr(x, attr): value=tuple(getattr(x,attr)) setattr(x,attr,value) else: if form.has_key(key): item=form[key] item=tuple(form[key]) form[key]=item
def __str__(self): L1 = self.__dict__.items() L1.sort() return join(map(lambda item: "%s: %s" %item, L1), ", ")
f718847ec8e4ea175d6618ba71bda90b3862f2f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f718847ec8e4ea175d6618ba71bda90b3862f2f5/HTTPRequest.py
if hasattr(productp, 'import_error_'): ie=productp.import_error_
if hasattr(productp, '__import_error__'): ie=productp.__import_error__
def initializeProduct(productp, name, home, app): # Initialize a levered product products=app.Control_Panel.Products if hasattr(productp, 'import_error_'): ie=productp.import_error_ else: ie=None try: fver=strip(open(home+'/version.txt').read()) except: fver='' old=None try: if ihasattr(products,name): old=getattr(products, name) if (ihasattr(old,'version') and old.version==fver and hasattr(old, 'import_error_') and old.import_error_==ie): return except: pass try: f=CompressedInputFile(open(home+'/product.dat','rb'),name+' shshsh') meta=cPickle.Unpickler(f).load() product=Globals.Bobobase._jar.import_file(f) product._objects=meta['_objects'] except: f=fver and (" (%s)" % fver) product=Product(name, 'Installed product %s%s' % (name,f)) if old is not None: products._delObject(name) products._setObject(name, product) product.__of__(products)._postCopy(products) product.manage_options=Folder.manage_options product.icon='p_/InstalledProduct_icon' product.version=fver product._distribution=None product.manage_distribution=None product.thisIsAnInstalledProduct=1 if ie: product.import_error_=ie product.title='Broken product %s' % name product.icon='p_/BrokenProduct_icon' product.manage_options=( {'label':'Traceback', 'action':'manage_traceback'}, ) if os.path.exists(os.path.join(home, 'README.txt')): product.manage_options=product.manage_options+( {'label':'README', 'action':'manage_readme'}, )
f26d85c26bc33f35b41353d297372bef60390d20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f26d85c26bc33f35b41353d297372bef60390d20/Product.py
return
return old
def initializeProduct(productp, name, home, app): # Initialize a levered product products=app.Control_Panel.Products if hasattr(productp, 'import_error_'): ie=productp.import_error_ else: ie=None try: fver=strip(open(home+'/version.txt').read()) except: fver='' old=None try: if ihasattr(products,name): old=getattr(products, name) if (ihasattr(old,'version') and old.version==fver and hasattr(old, 'import_error_') and old.import_error_==ie): return except: pass try: f=CompressedInputFile(open(home+'/product.dat','rb'),name+' shshsh') meta=cPickle.Unpickler(f).load() product=Globals.Bobobase._jar.import_file(f) product._objects=meta['_objects'] except: f=fver and (" (%s)" % fver) product=Product(name, 'Installed product %s%s' % (name,f)) if old is not None: products._delObject(name) products._setObject(name, product) product.__of__(products)._postCopy(products) product.manage_options=Folder.manage_options product.icon='p_/InstalledProduct_icon' product.version=fver product._distribution=None product.manage_distribution=None product.thisIsAnInstalledProduct=1 if ie: product.import_error_=ie product.title='Broken product %s' % name product.icon='p_/BrokenProduct_icon' product.manage_options=( {'label':'Traceback', 'action':'manage_traceback'}, ) if os.path.exists(os.path.join(home, 'README.txt')): product.manage_options=product.manage_options+( {'label':'README', 'action':'manage_readme'}, )
f26d85c26bc33f35b41353d297372bef60390d20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f26d85c26bc33f35b41353d297372bef60390d20/Product.py
return product
def initializeProduct(productp, name, home, app): # Initialize a levered product products=app.Control_Panel.Products if hasattr(productp, 'import_error_'): ie=productp.import_error_ else: ie=None try: fver=strip(open(home+'/version.txt').read()) except: fver='' old=None try: if ihasattr(products,name): old=getattr(products, name) if (ihasattr(old,'version') and old.version==fver and hasattr(old, 'import_error_') and old.import_error_==ie): return except: pass try: f=CompressedInputFile(open(home+'/product.dat','rb'),name+' shshsh') meta=cPickle.Unpickler(f).load() product=Globals.Bobobase._jar.import_file(f) product._objects=meta['_objects'] except: f=fver and (" (%s)" % fver) product=Product(name, 'Installed product %s%s' % (name,f)) if old is not None: products._delObject(name) products._setObject(name, product) product.__of__(products)._postCopy(products) product.manage_options=Folder.manage_options product.icon='p_/InstalledProduct_icon' product.version=fver product._distribution=None product.manage_distribution=None product.thisIsAnInstalledProduct=1 if ie: product.import_error_=ie product.title='Broken product %s' % name product.icon='p_/BrokenProduct_icon' product.manage_options=( {'label':'Traceback', 'action':'manage_traceback'}, ) if os.path.exists(os.path.join(home, 'README.txt')): product.manage_options=product.manage_options+( {'label':'README', 'action':'manage_readme'}, )
f26d85c26bc33f35b41353d297372bef60390d20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f26d85c26bc33f35b41353d297372bef60390d20/Product.py
return ('%s:long=%s' % (name, val))[:-1]
value = '%s:long=%s' % (name, val) if value[-1] == 'L': value = value[:-1] return value
def marshal_long(name, val): return ('%s:long=%s' % (name, val))[:-1]
88b382e19a7e63e371061c2940287e174024e478 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/88b382e19a7e63e371061c2940287e174024e478/client.py
'<IMG SRC="%s/p_/mi" BORDER=0></A>' %
'<IMG SRC="%s/p_/mi" BORDER=0></A></A>' %
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUrl=getattr(self, urlattr) if not simple_type(type(tpUrl)): tpUrl=tpUrl() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url treeData['tree-level']=level treeData['tree-item-expanded']=0 idattr=args['id'] output=data.append items=None if (have_arg('assume_children') and args['assume_children'] and substate is not state): # We should not compute children unless we have to. # See if we've been asked to expand our children. for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if not exp: items=1 if items is None: validate=md.validate if have_arg('branches') and hasattr(self, args['branches']): if validate is None or not hasattr(self, 'aq_acquire'): items=getattr(self, args['branches']) else: items=self.aq_acquire(args['branches'],validate,md) items=items() elif have_arg('branches_expr'): items=args['branches_expr'](md) if not items and have_arg('leaves'): items=1 if items and items != 1: if validate is not None: unauth=[] index=0 for i in items: try: v=validate(items,items,index,i,md) except: v=0 if not v: unauth.append(index) index=index+1 if unauth: if have_arg('skip_unauthorized') and args['skip_unauthorized']: items=list(items) unauth.reverse() for i in unauth: del items[i] else: raise ValidationError, unauth if have_arg('sort'): # Faster/less mem in-place sort if type(items)==type(()): items=list(items) sort=args['sort'] size=range(len(items)) for i in size: v=items[i] k=getattr(v,sort) try: k=k() except: pass items[i]=(k,v) items.sort() for i in size: items[i]=items[i][1] diff.append(id) sub=None if substate is state: output('<TABLE CELLSPACING="0">\n') sub=substate[0] exp=items else: # Add prefix output('<TR>\n') # Add +/- icon if items: if level: if level > 3: output( '<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') output('<TD WIDTH="16" VALIGN="TOP">') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break #################################### # Mostly inline encode_seq for speed s=compress(str(diff)) if len(s) > 57: s=encode_str(s) else: s=b2a_base64(s)[:-1] l=find(s,'=') if l >= 0: s=s[:l] s=translate(s, tplus) #################################### script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' '<IMG SRC="%s/p_/mi" BORDER=0></A>' % (id, root_url, s, id, script)) else: output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' '<IMG SRC="%s/p_/pl" BORDER=0></A>' % (id, root_url, s, id, script)) output('</TD>\n') else: if level > 2: output('<TD COLSPAN="%s"></TD>' % level) elif level > 0: output('<TD></TD>' * level) output('<TD WIDTH="16"></TD>\n') # add item text dataspan=colspan-level output('<TD%s%s VALIGN="TOP" ALIGN="LEFT">' % ((dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''), (have_arg('nowrap') and args['nowrap'] and ' NOWRAP' or '')) ) output(render_blocks(section, md)) output('</TD>\n</TR>\n') if exp: level=level+1 dataspan=colspan-level if level > 3: h='<TD COLSPAN="%s"></TD>' % (level-1) elif level > 1: h='<TD></TD>' * (level-1) else: h='' if have_arg('header'): doc=args['header'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) if items==1: # leaves if have_arg('leaves'): doc=args['leaves'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) elif have_arg('expand'): doc=args['expand'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) else: __traceback_info__=sub, args, state, substate ids={} for item in items: if hasattr(item, idattr): id=getattr(item, idattr) if not simple_type(type(id)): id=id() elif hasattr(item, '_p_oid'): id=item._p_oid else: id=pyid(item) if len(sub)==1: sub.append([]) substate=sub[1] ids[id]=1 md._push(InstanceDict(item,md)) try: data=tpRenderTABLE( item,id,root_url,url,state,substate,diff,data, colspan, section, md, treeData, level, args) finally: md._pop() if not sub[1]: del sub[1] ids=ids.has_key for i in range(len(substate)-1,-1): if not ids(substate[i][0]): del substate[i] if have_arg('footer'): doc=args['footer'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) del diff[-1] if not diff: output('</TABLE>\n') return data
0a634ae0e3b4bf0f9cf7bb5f2dc840a07812a89a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0a634ae0e3b4bf0f9cf7bb5f2dc840a07812a89a/TreeTag.py
'<IMG SRC="%s/p_/pl" BORDER=0></A>' %
'<IMG SRC="%s/p_/pl" BORDER=0></A></A>' %
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUrl=getattr(self, urlattr) if not simple_type(type(tpUrl)): tpUrl=tpUrl() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url treeData['tree-level']=level treeData['tree-item-expanded']=0 idattr=args['id'] output=data.append items=None if (have_arg('assume_children') and args['assume_children'] and substate is not state): # We should not compute children unless we have to. # See if we've been asked to expand our children. for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if not exp: items=1 if items is None: validate=md.validate if have_arg('branches') and hasattr(self, args['branches']): if validate is None or not hasattr(self, 'aq_acquire'): items=getattr(self, args['branches']) else: items=self.aq_acquire(args['branches'],validate,md) items=items() elif have_arg('branches_expr'): items=args['branches_expr'](md) if not items and have_arg('leaves'): items=1 if items and items != 1: if validate is not None: unauth=[] index=0 for i in items: try: v=validate(items,items,index,i,md) except: v=0 if not v: unauth.append(index) index=index+1 if unauth: if have_arg('skip_unauthorized') and args['skip_unauthorized']: items=list(items) unauth.reverse() for i in unauth: del items[i] else: raise ValidationError, unauth if have_arg('sort'): # Faster/less mem in-place sort if type(items)==type(()): items=list(items) sort=args['sort'] size=range(len(items)) for i in size: v=items[i] k=getattr(v,sort) try: k=k() except: pass items[i]=(k,v) items.sort() for i in size: items[i]=items[i][1] diff.append(id) sub=None if substate is state: output('<TABLE CELLSPACING="0">\n') sub=substate[0] exp=items else: # Add prefix output('<TR>\n') # Add +/- icon if items: if level: if level > 3: output( '<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') output('<TD WIDTH="16" VALIGN="TOP">') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break #################################### # Mostly inline encode_seq for speed s=compress(str(diff)) if len(s) > 57: s=encode_str(s) else: s=b2a_base64(s)[:-1] l=find(s,'=') if l >= 0: s=s[:l] s=translate(s, tplus) #################################### script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' '<IMG SRC="%s/p_/mi" BORDER=0></A>' % (id, root_url, s, id, script)) else: output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' '<IMG SRC="%s/p_/pl" BORDER=0></A>' % (id, root_url, s, id, script)) output('</TD>\n') else: if level > 2: output('<TD COLSPAN="%s"></TD>' % level) elif level > 0: output('<TD></TD>' * level) output('<TD WIDTH="16"></TD>\n') # add item text dataspan=colspan-level output('<TD%s%s VALIGN="TOP" ALIGN="LEFT">' % ((dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''), (have_arg('nowrap') and args['nowrap'] and ' NOWRAP' or '')) ) output(render_blocks(section, md)) output('</TD>\n</TR>\n') if exp: level=level+1 dataspan=colspan-level if level > 3: h='<TD COLSPAN="%s"></TD>' % (level-1) elif level > 1: h='<TD></TD>' * (level-1) else: h='' if have_arg('header'): doc=args['header'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) if items==1: # leaves if have_arg('leaves'): doc=args['leaves'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) elif have_arg('expand'): doc=args['expand'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) else: __traceback_info__=sub, args, state, substate ids={} for item in items: if hasattr(item, idattr): id=getattr(item, idattr) if not simple_type(type(id)): id=id() elif hasattr(item, '_p_oid'): id=item._p_oid else: id=pyid(item) if len(sub)==1: sub.append([]) substate=sub[1] ids[id]=1 md._push(InstanceDict(item,md)) try: data=tpRenderTABLE( item,id,root_url,url,state,substate,diff,data, colspan, section, md, treeData, level, args) finally: md._pop() if not sub[1]: del sub[1] ids=ids.has_key for i in range(len(substate)-1,-1): if not ids(substate[i][0]): del substate[i] if have_arg('footer'): doc=args['footer'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) del diff[-1] if not diff: output('</TABLE>\n') return data
0a634ae0e3b4bf0f9cf7bb5f2dc840a07812a89a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0a634ae0e3b4bf0f9cf7bb5f2dc840a07812a89a/TreeTag.py
if indexes[index] is "TDdivider" or indexes[index] is THdivider:
if indexes[index] is "TDdivider" or indexes[index] is "THdivider":
def doc_table(self, paragraph, expr = re.compile(r'\s*\|[-]+\|').match): text = paragraph.getColorizableTexts()[0] m = expr(text) subs = paragraph.getSubparagraphs() if not (m): return None rows = [] spans = [] ROWS = [] COLS = [] indexes = [] ignore = [] TDdivider = re.compile("[\-]+").match THdivider = re.compile("[\=]+").match col = re.compile('\|').search innertable = re.compile('\|([-]+|[=]+)\|').search text = strip(text) rows = split(text,'\n') foo = "" for row in range(len(rows)): rows[row] = strip(rows[row]) # have indexes store if a row is a divider # or a cell part for index in range(len(rows)): tmpstr = rows[index][1:len(rows[index])-1] if TDdivider(tmpstr): indexes.append("TDdivider") elif THdivider(tmpstr): indexes.append("THdivider") else: indexes.append("cell")
c397bee41c5d72b1ed53eeed3c8d5e84f0b527a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c397bee41c5d72b1ed53eeed3c8d5e84f0b527a8/DocumentClass.py
items.reverse()
items=self.reverse_items(items)
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUrl=getattr(self, urlattr) if not simple_type(type(tpUrl)): tpUrl=tpUrl() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url treeData['tree-level']=level treeData['tree-item-expanded']=0 idattr=args['id'] output=data.append items=None if (have_arg('assume_children') and args['assume_children'] and substate is not state): # We should not compute children unless we have to. # See if we've been asked to expand our children. for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if not exp: items=1 if items is None: validate=md.validate if have_arg('branches') and hasattr(self, args['branches']): if validate is None or not hasattr(self, 'aq_acquire'): items=getattr(self, args['branches']) else: items=self.aq_acquire(args['branches'],validate,md) items=items() elif have_arg('branches_expr'): items=args['branches_expr'](md) if not items and have_arg('leaves'): items=1 if items and items != 1: if validate is not None: unauth=[] index=0 for i in items: try: v=validate(items,items,index,i,md) except: v=0 if not v: unauth.append(index) index=index+1 if unauth: if have_arg('skip_unauthorized') and args['skip_unauthorized']: items=list(items) unauth.reverse() for i in unauth: del items[i] else: raise ValidationError, unauth if have_arg('sort'): # Faster/less mem in-place sort if type(items)==type(()): items=list(items) sort=args['sort'] size=range(len(items)) for i in size: v=items[i] k=getattr(v,sort) try: k=k() except: pass items[i]=(k,v) items.sort() for i in size: items[i]=items[i][1] if have_arg('reverse'): items.reverse() diff.append(id) sub=None if substate is state: output('<TABLE CELLSPACING="0">\n') sub=substate[0] exp=items else: # Add prefix output('<TR>\n') # Add +/- icon if items: if level: if level > 3: output( '<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') output('<TD WIDTH="16" VALIGN="TOP">') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break #################################### # Mostly inline encode_seq for speed s=compress(str(diff)) if len(s) > 57: s=encode_str(s) else: s=b2a_base64(s)[:-1] l=find(s,'=') if l >= 0: s=s[:l] s=translate(s, tplus) #################################### script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' '<IMG SRC="%s/p_/mi" BORDER=0></A></A>' % (id, root_url, s, id, script)) else: output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' '<IMG SRC="%s/p_/pl" BORDER=0></A></A>' % (id, root_url, s, id, script)) output('</TD>\n') else: if level > 2: output('<TD COLSPAN="%s"></TD>' % level) elif level > 0: output('<TD></TD>' * level) output('<TD WIDTH="16"></TD>\n') # add item text dataspan=colspan-level output('<TD%s%s VALIGN="TOP" ALIGN="LEFT">' % ((dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''), (have_arg('nowrap') and args['nowrap'] and ' NOWRAP' or '')) ) output(render_blocks(section, md)) output('</TD>\n</TR>\n') if exp: level=level+1 dataspan=colspan-level if level > 3: h='<TD COLSPAN="%s"></TD>' % (level-1) elif level > 1: h='<TD></TD>' * (level-1) else: h='' if have_arg('header'): doc=args['header'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) if items==1: # leaves if have_arg('leaves'): doc=args['leaves'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) elif have_arg('expand'): doc=args['expand'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) else: __traceback_info__=sub, args, state, substate ids={} for item in items: if hasattr(item, idattr): id=getattr(item, idattr) if not simple_type(type(id)): id=id() elif hasattr(item, '_p_oid'): id=oid(item) else: id=pyid(item) if len(sub)==1: sub.append([]) substate=sub[1] ids[id]=1 md._push(InstanceDict(item,md)) try: data=tpRenderTABLE( item,id,root_url,url,state,substate,diff,data, colspan, section, md, treeData, level, args) finally: md._pop() if not sub[1]: del sub[1] ids=ids.has_key for i in range(len(substate)-1,-1): if not ids(substate[i][0]): del substate[i] if have_arg('footer'): doc=args['footer'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) del diff[-1] if not diff: output('</TABLE>\n') return data
2e1f1428414aba4dd77cf539c991228f632ae73a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2e1f1428414aba4dd77cf539c991228f632ae73a/TreeTag.py
message='The title is now "%s"<br>' 'The base is now "%s"<br>' 'The path is now "%s"<br>' % map(escape, (title, base, path)),
message='SiteRoot changed.',
def manage_edit(self, title, base, path, REQUEST=None): '''Set the title, base, and path''' self.__init__(title, base, path) if REQUEST: return MessageDialog(title='SiteRoot changed.', message='The title is now "%s"<br>' 'The base is now "%s"<br>' 'The path is now "%s"<br>' % map(escape, (title, base, path)), action='%s/manage_main' % REQUEST['URL1'])
550005906acc2197207aab6d2a9c8d09ec607aa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/550005906acc2197207aab6d2a9c8d09ec607aa1/SiteRoot.py
if type(HTTP_PORT) is type(''): HTTP_PORT=((IP_ADDRESS, HTTP_PORT),)
if type(HTTP_PORT) is type(0): HTTP_PORT=((IP_ADDRESS, HTTP_PORT),)
def set_locale(val): try: import locale except: raise SystemExit, ( 'The locale module could not be imported.\n' \ 'To use localization options, you must ensure\n' \ 'that the locale module is compiled into your\n' \ 'Python installation.' ) try: locale.setlocale(locale.LC_ALL, val) except: raise SystemExit, ( 'The specified locale is not supported by your system.\n' \ 'See your operating system documentation for more\n' \ 'information on locale support.' )
58c24dcc6872355c25cd041a2ec03d6b7390866e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/58c24dcc6872355c25cd041a2ec03d6b7390866e/z2.py
if type(FTP_PORT) is type(''): FTP_PORT=((IP_ADDRESS, FTP_PORT),)
if type(FTP_PORT) is type(0): FTP_PORT=((IP_ADDRESS, FTP_PORT),)
def set_locale(val): try: import locale except: raise SystemExit, ( 'The locale module could not be imported.\n' \ 'To use localization options, you must ensure\n' \ 'that the locale module is compiled into your\n' \ 'Python installation.' ) try: locale.setlocale(locale.LC_ALL, val) except: raise SystemExit, ( 'The specified locale is not supported by your system.\n' \ 'See your operating system documentation for more\n' \ 'information on locale support.' )
58c24dcc6872355c25cd041a2ec03d6b7390866e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/58c24dcc6872355c25cd041a2ec03d6b7390866e/z2.py
if type(MONITOR_PORT) is type(''):
if type(MONITOR_PORT) is type(0):
def set_locale(val): try: import locale except: raise SystemExit, ( 'The locale module could not be imported.\n' \ 'To use localization options, you must ensure\n' \ 'that the locale module is compiled into your\n' \ 'Python installation.' ) try: locale.setlocale(locale.LC_ALL, val) except: raise SystemExit, ( 'The specified locale is not supported by your system.\n' \ 'See your operating system documentation for more\n' \ 'information on locale support.' )
58c24dcc6872355c25cd041a2ec03d6b7390866e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/58c24dcc6872355c25cd041a2ec03d6b7390866e/z2.py
local_roles = dict.get(userid, [])
local_roles = list(dict.get(userid, []))
def manage_addLocalRoles(self, userid, roles, REQUEST=None): """Set local roles for a user.""" if not roles: raise ValueError, 'One or more roles must be given!' dict=self.__ac_local_roles__ or {} local_roles = dict.get(userid, []) for r in roles: if r not in local_roles: local_roles.append(r) dict[userid] = local_roles self.__ac_local_roles__=dict if REQUEST is not None: stat='Your changes have been saved.' return self.manage_listLocalRoles(self, REQUEST, stat=stat)
7371b1c6e6333d0b6c0c681e9f3473a10a78aec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7371b1c6e6333d0b6c0c681e9f3473a10a78aec1/Role.py
def StructuredText(paragraphs, paragraph_delimiter=re.compile('\n\s*\n')):
def StructuredText(paragraphs, delimiter=re.compile(para_delim)):
def StructuredText(paragraphs, paragraph_delimiter=re.compile('\n\s*\n')): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [paragraph,[sub-paragraphs]] """ currentlevel = 0 currentindent = 0 levels = {0:0} level = 0 # which header are we under struct = [] # the structure to be returned run = struct paragraphs = filter( strip, paragraph_delimiter.split(expandtabs('\n\n'+paragraphs+'\n\n')) ) if not paragraphs: return StructuredTextDocument() ind = [] # structure based on indention levels for paragraph in paragraphs: ind.append([indention(paragraph), paragraph]) currentindent = indention(paragraphs[0]) levels[0] = currentindent ############################################################# # updated # ############################################################# for indent,paragraph in ind : if indent == 0: level = level + 1 currentlevel = 0 currentindent = 0 levels = {0:0} struct.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) elif indent > currentindent: currentlevel = currentlevel + 1 currentindent = indent levels[currentlevel] = indent run = insert(struct,level,currentlevel) run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) elif indent < currentindent: result = findlevel(levels,indent) if result > 0: currentlevel = result currentindent = indent if not level: struct.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) else: run = insert(struct,level,currentlevel) run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) else: if insert(struct,level,currentlevel): run = insert(struct,level,currentlevel) else: run = struct currentindet = indent run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) return StructuredTextDocument(struct)
88f0099281103b1884f5ea19fe669b8a9c019eae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/88f0099281103b1884f5ea19fe669b8a9c019eae/ST.py
paragraphs = filter( strip, paragraph_delimiter.split(expandtabs('\n\n'+paragraphs+'\n\n')) )
paragraphs = expandtabs(paragraphs) paragraphs = '%s%s%s' % ('\n\n', paragraphs, '\n\n') paragraphs = delimiter.split(paragraphs) paragraphs = filter(strip, paragraphs)
def StructuredText(paragraphs, paragraph_delimiter=re.compile('\n\s*\n')): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [paragraph,[sub-paragraphs]] """ currentlevel = 0 currentindent = 0 levels = {0:0} level = 0 # which header are we under struct = [] # the structure to be returned run = struct paragraphs = filter( strip, paragraph_delimiter.split(expandtabs('\n\n'+paragraphs+'\n\n')) ) if not paragraphs: return StructuredTextDocument() ind = [] # structure based on indention levels for paragraph in paragraphs: ind.append([indention(paragraph), paragraph]) currentindent = indention(paragraphs[0]) levels[0] = currentindent ############################################################# # updated # ############################################################# for indent,paragraph in ind : if indent == 0: level = level + 1 currentlevel = 0 currentindent = 0 levels = {0:0} struct.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) elif indent > currentindent: currentlevel = currentlevel + 1 currentindent = indent levels[currentlevel] = indent run = insert(struct,level,currentlevel) run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) elif indent < currentindent: result = findlevel(levels,indent) if result > 0: currentlevel = result currentindent = indent if not level: struct.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) else: run = insert(struct,level,currentlevel) run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) else: if insert(struct,level,currentlevel): run = insert(struct,level,currentlevel) else: run = struct currentindet = indent run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel)) return StructuredTextDocument(struct)
88f0099281103b1884f5ea19fe669b8a9c019eae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/88f0099281103b1884f5ea19fe669b8a9c019eae/ST.py
s = regsub.gsub('[%s]+and[%s]*not[%s]+' % (ws * 3), ' andnot ', s)
s = ts_regex.gsub('[%s]+and[%s]*not[%s]+' % (ws * 3), ' andnot ', s)
def query(s, index, default_operator = Or, ws = (string.whitespace,)): # First replace any occurences of " and not " with " andnot " s = regsub.gsub('[%s]+and[%s]*not[%s]+' % (ws * 3), ' andnot ', s) q = parse(s) q = parse2(q, default_operator) return evaluate(q, index)
cbe5af3e17af323aeccb0131d23a91ce5c8d60fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cbe5af3e17af323aeccb0131d23a91ce5c8d60fd/TextIndex.py
def parens(s, parens_regex = regex.compile("(\|)")): '''Find the beginning and end of the first set of parentheses''' if (parens_regex.search(s) < 0): return None if (parens_regex.group(0) == ")"): raise QueryError, "Mismatched parentheses" open = parens_regex.regs[0][0] + 1 start = parens_regex.regs[0][1] p = 1 while (parens_regex.search(s, start) >= 0): if (parens_regex.group(0) == ")"): p = p - 1 else: p = p + 1 start = parens_regex.regs[0][1] if (p == 0): return (open, parens_regex.regs[0][0]) raise QueryError, "Mismatched parentheses"
def parens(s, parens_re = regex.compile('(\|)').search): index=open_index=paren_count = 0 while 1: index = parens_re(s, index) if index < 0 : break if s[index] == '(': paren_count = paren_count + 1 if open_index == 0 : open_index = index + 1 else: paren_count = paren_count - 1 if paren_count == 0: return open_index, index else: index = index + 1 if paren_count == 0: return None else: raise QueryError, "Mismatched parentheses"
def parens(s, parens_regex = regex.compile("(\|)")): '''Find the beginning and end of the first set of parentheses''' if (parens_regex.search(s) < 0): return None if (parens_regex.group(0) == ")"): raise QueryError, "Mismatched parentheses" open = parens_regex.regs[0][0] + 1 start = parens_regex.regs[0][1] p = 1 while (parens_regex.search(s, start) >= 0): if (parens_regex.group(0) == ")"): p = p - 1 else: p = p + 1 start = parens_regex.regs[0][1] if (p == 0): return (open, parens_regex.regs[0][0]) raise QueryError, "Mismatched parentheses"
cbe5af3e17af323aeccb0131d23a91ce5c8d60fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cbe5af3e17af323aeccb0131d23a91ce5c8d60fd/TextIndex.py
splitted = regsub.split(s, '[%s]*\"[%s]*' % (ws * 2))
splitted = ts_regex.split(s, '[%s]*\"[%s]*' % (ws * 2))
def quotes(s, ws = (string.whitespace,)): # split up quoted regions splitted = regsub.split(s, '[%s]*\"[%s]*' % (ws * 2)) split=string.split if (len(splitted) > 1): if ((len(splitted) % 2) == 0): raise QueryError, "Mismatched quotes" for i in range(1,len(splitted),2): # split the quoted region into words splitted[i] = filter(None, split(splitted[i])) # put the Proxmity operator in between quoted words for j in range(1, len(splitted[i])): splitted[i][j : j] = [ Near ] for i in range(len(splitted)-1,-1,-2): # split the non-quoted region into words splitted[i:i+1] = filter(None, split(splitted[i])) splitted = filter(None, splitted) else: # No quotes, so just split the string into words splitted = filter(None, split(s)) return splitted
cbe5af3e17af323aeccb0131d23a91ce5c8d60fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cbe5af3e17af323aeccb0131d23a91ce5c8d60fd/TextIndex.py
self.handleError()
self.handleError(record)
def emit(self, record): try: self.buffer.append(record) msg = self.format(record) self.stream.write("%s\n" % msg) self.flush() except: self.handleError()
01c288315b1178e2603f0091c477beafccb75af1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/01c288315b1178e2603f0091c477beafccb75af1/LogHandlers.py
subobject=getattr(object.aq_base, entry_name) else: subobject=getattr(object,entry_name)
if hasattr(object.aq_base, entry_name): subobject=getattr(object, entry_name) else: raise AttributeError, entry_name else: subobject=getattr(object, entry_name)
def traverse(self, path, response=None): """Traverse the object space
ce9c10992519b77cfcd6372c435036136eef353d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ce9c10992519b77cfcd6372c435036136eef353d/BaseRequest.py
if debug_mode:
if entry_name=='.': subobject=object elif entry_name=='..' and parents: subobject=parents[-1] elif debug_mode:
def traverse(self, path, response=None): """Traverse the object space
ce9c10992519b77cfcd6372c435036136eef353d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ce9c10992519b77cfcd6372c435036136eef353d/BaseRequest.py
try: isheets_base_classes.append( z._zclass_.propertysheets.__class__)
try: psc=z._zclass_.propertysheets.__class__ if getattr(psc, '_implements_the_notional' '_subclassable_propertysheet' '_class_interface', 0): isheets_base_classes.append(psc)
def __init__(self, id, title, bases): """Build a Zope class
92c10e65d290a6256036fb64d77a66cfa17646f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92c10e65d290a6256036fb64d77a66cfa17646f4/ZClass.py
def manage_workspace(self, URL2): "Emulate standard interface for use with navigation" raise 'Redirect', URL2+'/manage_workspace'
#def manage_workspace(self, URL1):
92c10e65d290a6256036fb64d77a66cfa17646f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92c10e65d290a6256036fb64d77a66cfa17646f4/ZClass.py
def __init__(self,id,title,file, precondition='',content_type='application/octet-stream'):
def __init__(self,id,title,file,content_type='application/octet-stream', precondition=''):
def __init__(self,id,title,file, precondition='',content_type='application/octet-stream'): try: headers=file.headers except: headers=None if headers is None: if not content_type: raise 'BadValue', 'No content type specified' self.content_type=content_type self.data=Pdata(file) else: if headers.has_key('content-type'): self.content_type=headers['content-type'] else: if not content_type: raise 'BadValue', 'No content type specified' self.content_type=content_type self.data=Pdata(file.read()) self.__name__=id self.title=title if precondition: self.precondition=precondition self.size=len(self.data)
2029e1c3e802da2c567cc066a37f5a74d8fdaa92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2029e1c3e802da2c567cc066a37f5a74d8fdaa92/Image.py
If the 'start' argument is specified in the form 'DD/MM/YYYY HH:MM:SS' (UTC),
If the 'start' argument is specified in the form 'YYYY/MM/DD HH:MM:SS' (UTC),
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """
7d4a0e24ee2de5bbd6cad5854e3a8ce820b3c585 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7d4a0e24ee2de5bbd6cad5854e3a8ce820b3c585/requestprofiler.py
If the 'end' argument is specified in the form 'DD/MM/YYYY HH:MM:SS' (UTC),
If the 'end' argument is specified in the form 'YYYY/MM/DD HH:MM:SS' (UTC),
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """
7d4a0e24ee2de5bbd6cad5854e3a8ce820b3c585 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7d4a0e24ee2de5bbd6cad5854e3a8ce820b3c585/requestprofiler.py
try: return self._length() except AttributeError: l = len(self._unindex) self._length = Length(l) return l
self._migrate_length() return self._length def _migrate_length(self): """ migrate index to use new _length attribute """ if not hasattr(self, '_length'): self._length = Length(len(self._unindex))
def numObjects(self): """ return the number of indexed objects""" try: return self._length() except AttributeError: # backward compatibility l = len(self._unindex) self._length = Length(l) return l
c0fa62a1fca8831bd456ccd06813a9d9786fbf36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c0fa62a1fca8831bd456ccd06813a9d9786fbf36/PathIndex.py
class trigger (asyncore.dispatcher): address = ('127.9.9.9', 19999)
class trigger(asyncore.dispatcher):
def handle_read (self): self.recv (8192) try: self.lock.acquire() for thunk in self.thunks: try: thunk() except: (file, fun, line), t, v, tbinfo = asyncore.compact_traceback() print 'exception in trigger thunk: (%s:%s %s)' % (t, v, tbinfo) self.thunks = [] finally: self.lock.release()
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
a = socket.socket (socket.AF_INET, socket.SOCK_STREAM) w = socket.socket (socket.AF_INET, socket.SOCK_STREAM) w.setsockopt(socket.IPPROTO_TCP, 1, 1) host='127.0.0.1' port=19999
w = socket.socket() w.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) count = 0
def __init__ (self): a = socket.socket (socket.AF_INET, socket.SOCK_STREAM) w = socket.socket (socket.AF_INET, socket.SOCK_STREAM) # set TCP_NODELAY to true to avoid buffering w.setsockopt(socket.IPPROTO_TCP, 1, 1) # tricky: get a pair of connected sockets host='127.0.0.1' port=19999 while 1: try: self.address=(host, port) a.bind(self.address) break except: if port <= 19950: raise BindError, 'Cannot bind trigger!' port=port - 1 a.listen (1) w.setblocking (0) try: w.connect (self.address) except: pass r, addr = a.accept() a.close() w.setblocking (1) self.trigger = w asyncore.dispatcher.__init__ (self, r) self.lock = thread.allocate_lock() self.thunks = [] self._trigger_connected = 0
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
try: self.address=(host, port) a.bind(self.address) break except: if port <= 19950: raise BindError, 'Cannot bind trigger!' port=port - 1 a.listen (1) w.setblocking (0) try: w.connect (self.address) except: pass r, addr = a.accept()
count += 1 a = socket.socket() a.bind(("127.0.0.1", 0)) connect_address = a.getsockname() a.listen(1) try: w.connect(connect_address) break except socket.error, detail: if detail[0] != errno.WSAEADDRINUSE: raise if count >= 10: a.close() w.close() raise BindError("Cannot bind trigger!") a.close() r, addr = a.accept()
def __init__ (self): a = socket.socket (socket.AF_INET, socket.SOCK_STREAM) w = socket.socket (socket.AF_INET, socket.SOCK_STREAM) # set TCP_NODELAY to true to avoid buffering w.setsockopt(socket.IPPROTO_TCP, 1, 1) # tricky: get a pair of connected sockets host='127.0.0.1' port=19999 while 1: try: self.address=(host, port) a.bind(self.address) break except: if port <= 19950: raise BindError, 'Cannot bind trigger!' port=port - 1 a.listen (1) w.setblocking (0) try: w.connect (self.address) except: pass r, addr = a.accept() a.close() w.setblocking (1) self.trigger = w asyncore.dispatcher.__init__ (self, r) self.lock = thread.allocate_lock() self.thunks = [] self._trigger_connected = 0
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
w.setblocking (1)
def __init__ (self): a = socket.socket (socket.AF_INET, socket.SOCK_STREAM) w = socket.socket (socket.AF_INET, socket.SOCK_STREAM) # set TCP_NODELAY to true to avoid buffering w.setsockopt(socket.IPPROTO_TCP, 1, 1) # tricky: get a pair of connected sockets host='127.0.0.1' port=19999 while 1: try: self.address=(host, port) a.bind(self.address) break except: if port <= 19950: raise BindError, 'Cannot bind trigger!' port=port - 1 a.listen (1) w.setblocking (0) try: w.connect (self.address) except: pass r, addr = a.accept() a.close() w.setblocking (1) self.trigger = w asyncore.dispatcher.__init__ (self, r) self.lock = thread.allocate_lock() self.thunks = [] self._trigger_connected = 0
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
def __init__ (self): a = socket.socket (socket.AF_INET, socket.SOCK_STREAM) w = socket.socket (socket.AF_INET, socket.SOCK_STREAM) # set TCP_NODELAY to true to avoid buffering w.setsockopt(socket.IPPROTO_TCP, 1, 1) # tricky: get a pair of connected sockets host='127.0.0.1' port=19999 while 1: try: self.address=(host, port) a.bind(self.address) break except: if port <= 19950: raise BindError, 'Cannot bind trigger!' port=port - 1 a.listen (1) w.setblocking (0) try: w.connect (self.address) except: pass r, addr = a.accept() a.close() w.setblocking (1) self.trigger = w asyncore.dispatcher.__init__ (self, r) self.lock = thread.allocate_lock() self.thunks = [] self._trigger_connected = 0
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
def __repr__ (self):
def __repr__(self):
def __repr__ (self): return '<select-trigger (loopback) at %x>' % id(self)
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
def readable (self):
def readable(self):
def readable (self): return 1
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
def writable (self):
def writable(self):
def writable (self): return 0
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
def handle_connect (self):
def handle_connect(self):
def handle_connect (self): pass
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
def pull_trigger (self, thunk=None):
def pull_trigger(self, thunk=None):
def pull_trigger (self, thunk=None): if thunk: try: self.lock.acquire() self.thunks.append (thunk) finally: self.lock.release() self.trigger.send ('x')
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
def handle_read (self): self.recv (8192)
def handle_read(self): self.recv(8192)
def handle_read (self): self.recv (8192) try: self.lock.acquire() for thunk in self.thunks: try: thunk() except: (file, fun, line), t, v, tbinfo = asyncore.compact_traceback() print 'exception in trigger thunk: (%s:%s %s)' % (t, v, tbinfo) self.thunks = [] finally: self.lock.release()
1bd27dd7813e479e22b22a0e1e77859916f10664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1bd27dd7813e479e22b22a0e1e77859916f10664/select_trigger.py
""" testing PublicFunc"""
""" testing PublicFunc with wrong auth"""
def testPublicFuncWithWrongAuth(self): """ testing PublicFunc"""
a72f5e502c7ba23a409dc043b2e0e62795e4048a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a72f5e502c7ba23a409dc043b2e0e62795e4048a/testSecurity.py
""" testing PrivateFunc"""
""" testing ProtectedFunc"""
def testProtectedFunc(self): """ testing PrivateFunc"""
a72f5e502c7ba23a409dc043b2e0e62795e4048a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a72f5e502c7ba23a409dc043b2e0e62795e4048a/testSecurity.py
reg = re.compile("Status: ([0-9]{1,4}) (.*)",re.I)\
def _request(self,*args,**kw):
a72f5e502c7ba23a409dc043b2e0e62795e4048a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a72f5e502c7ba23a409dc043b2e0e62795e4048a/testSecurity.py
mo = reg.search(outp)
mo = self._reg.search(outp)
def _request(self,*args,**kw):
a72f5e502c7ba23a409dc043b2e0e62795e4048a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a72f5e502c7ba23a409dc043b2e0e62795e4048a/testSecurity.py
+ ('\([-:a-zA-Z0-9_,./?=@
+ ('\([-:a-zA-Z0-9_,./?=@
def __init__(self, aStructuredString, level=0, paragraph_divider=regex.compile('\(\n *\)+\n'), ): '''Convert a structured text string into a structured text object.
898373c603e04f500a3fad4f04abe501035156ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/898373c603e04f500a3fad4f04abe501035156ed/StructuredText.py
+ ('\([a-zA-Z]*:[-:a-zA-Z0-9_,./?=@
+ ('\([a-zA-Z]*:[-:a-zA-Z0-9_,./?=@
def __init__(self, aStructuredString, level=0, paragraph_divider=regex.compile('\(\n *\)+\n'), ): '''Convert a structured text string into a structured text object.
898373c603e04f500a3fad4f04abe501035156ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/898373c603e04f500a3fad4f04abe501035156ed/StructuredText.py
return '0'*(11-len(i))+i+' '
v = '0'*(11-len(i))+i+' ' if len(v) > 12: left = v[:-12] for c in left: if c != '0': raise ValueError, 'value too large for oct12' return v[-12:] return v
def oct12(i): i=oct(i) return '0'*(11-len(i))+i+' '
69798eb8854a406787e50821c7d0a8ddf93d98b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/69798eb8854a406787e50821c7d0a8ddf93d98b6/tar.py
if REQUEST is not None: return self.manage_main(self,REQUEST)
if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main')
def manage_addFile(self,id,file,title='',precondition='', content_type='', REQUEST=None): """Add a new File object. Creates a new File object 'id' with the contents of 'file'""" id, title = cookId(id, title, file) self=self.this() # First, we create the image without data: self._setObject(id, File(id,title,'',content_type, precondition)) # And commit to a sub-transaction: if Globals.DatabaseVersion=='3': get_transaction().commit(1) # Now we "upload" the data. By commiting the add first, the # object can use a database trick to make the upload more efficient. self._getOb(id).manage_upload(file) if REQUEST is not None: return self.manage_main(self,REQUEST)
6add6af2d2898279cd710aa4f4a9f823ecb9871a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6add6af2d2898279cd710aa4f4a9f823ecb9871a/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
7ecd0e0955fb7738d2ff996c30e89885517fb1c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7ecd0e0955fb7738d2ff996c30e89885517fb1c6/Publish.py
def getEntryForObject(self, documentId, default=None):
def getEntryForObject(self, documentId, default=MV):
def getEntryForObject(self, documentId, default=None): """Takes a document ID and returns all the information we have on that specific object.""" if default is None: return self._unindex.get(documentId, default) else: return self._unindex.get(documentId)
9563f2bcbaf222ffb87d614b61d2a1f5acaab1f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9563f2bcbaf222ffb87d614b61d2a1f5acaab1f9/UnIndex.py
if default is None:
if default is not MV:
def getEntryForObject(self, documentId, default=None): """Takes a document ID and returns all the information we have on that specific object.""" if default is None: return self._unindex.get(documentId, default) else: return self._unindex.get(documentId)
9563f2bcbaf222ffb87d614b61d2a1f5acaab1f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9563f2bcbaf222ffb87d614b61d2a1f5acaab1f9/UnIndex.py
cache[query]= now, r
if self.cache_time_ > 0: cache[query]= now, r
def _cached_result(self, DB__, query, compressed=0):
a27633ebc4be8a6b65a1ef1ac570cc24c23373f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a27633ebc4be8a6b65a1ef1ac570cc24c23373f5/DA.py
cb_isMovable=cb_isCopyable
cb_isMoveable=cb_isCopyable
def cb_isCopyable(self): pass # for now, we don't allow ZClasses to be copied.
328d8bdd9c45f8be62bb6f7cf55c614fd8034f9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/328d8bdd9c45f8be62bb6f7cf55c614fd8034f9f/ZClass.py
$Id: Publish.py,v 1.31 1997/01/30 00:50:18 jim Exp $"""
$Id: Publish.py,v 1.32 1997/02/07 14:41:32 jim Exp $"""
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
4c3df7c38740997964bea8c374f72311514aa2fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4c3df7c38740997964bea8c374f72311514aa2fb/Publish.py
__version__='$Revision: 1.31 $'[11:-2]
__version__='$Revision: 1.32 $'[11:-2]
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
4c3df7c38740997964bea8c374f72311514aa2fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4c3df7c38740997964bea8c374f72311514aa2fb/Publish.py
import sys, os, string, types, newcgi, regex
import sys, os, string, types, newcgi, regex, regsub
def main(): # The "main" program for this module pass
4c3df7c38740997964bea8c374f72311514aa2fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4c3df7c38740997964bea8c374f72311514aa2fb/Publish.py
def field2lines(v):
def field2lines(v, crlf=regex.compile('\r\n\|\n\r')):
def field2lines(v): try: v=v.read() except: v=str(v) return string.split(v,'\n')
4c3df7c38740997964bea8c374f72311514aa2fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4c3df7c38740997964bea8c374f72311514aa2fb/Publish.py
"The database connection, <em>%s</em>, cannot be found.")
"The database connection <em>%s</em> cannot be found." % ( self.connection_id))
def __call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw): """Call the database method
f4fc2dae26b6f72656fbc6d89484c2e964e8987d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f4fc2dae26b6f72656fbc6d89484c2e964e8987d/DA.py
print datefmt
def __init__(self,*args, **kw): """Return a new date-time object
d98edc1a7084556814480fe6efa90da27d8bf528 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d98edc1a7084556814480fe6efa90da27d8bf528/DateTime.py
"""The last child of this node. If ther is no such node
"""The last child of this node. If ther is no such node
def getLastChild(self): """The last child of this node. If ther is no such node this returns None.""" return None
7614bcfb8d52ea7f0db3fb17e55ce4e8b7e8ce1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7614bcfb8d52ea7f0db3fb17e55ce4e8b7e8ce1d/ZDOM.py
print "Bad syntax in z:attributes:", `part`
print "Bad syntax in attributes:", `part`
def parseAttributeReplacements(arg): dict = {} for part in splitParts(arg): m = _attr_re.match(part) if not m: print "Bad syntax in z:attributes:", `part` continue name, expr = m.group(1, 2) if dict.has_key(name): print "Duplicate attribute name in z:attributes:", `part` continue dict[name] = expr return dict
caded7fd23efff0e871366861c38f1bc641cc239 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caded7fd23efff0e871366861c38f1bc641cc239/TALDefs.py
print "Duplicate attribute name in z:attributes:", `part`
print "Duplicate attribute name in attributes:", `part`
def parseAttributeReplacements(arg): dict = {} for part in splitParts(arg): m = _attr_re.match(part) if not m: print "Bad syntax in z:attributes:", `part` continue name, expr = m.group(1, 2) if dict.has_key(name): print "Duplicate attribute name in z:attributes:", `part` continue dict[name] = expr return dict
caded7fd23efff0e871366861c38f1bc641cc239 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caded7fd23efff0e871366861c38f1bc641cc239/TALDefs.py
print "Bad syntax in z:insert/replace:", `arg`
print "Bad syntax in insert/replace:", `arg`
def parseSubstitution(arg): m = _subst_re.match(arg) if not m: print "Bad syntax in z:insert/replace:", `arg` return None, None key, expr = m.group(1, 2) if not key: key = "text" return key, expr
caded7fd23efff0e871366861c38f1bc641cc239 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caded7fd23efff0e871366861c38f1bc641cc239/TALDefs.py
parts = map(lambda s, repl=string.replace: repl(s, "\0", ";;"), parts)
parts = map(lambda s, repl=string.replace: repl(s, "\0", ";"), parts)
def splitParts(arg): # Break in pieces at undoubled semicolons and # change double semicolons to singles: import string arg = string.replace(arg, ";;", "\0") parts = string.split(arg, ';') parts = map(lambda s, repl=string.replace: repl(s, "\0", ";;"), parts) if len(parts) > 1 and not string.strip(parts[-1]): del parts[-1] # It ended in a semicolon return parts
be5b8dfdfc72c24477bec12b211d13a39fe2c721 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/be5b8dfdfc72c24477bec12b211d13a39fe2c721/TALDefs.py
self.definingMacro = None
def __init__(self, program, macros, engine, stream=None, debug=0, wrap=60, metal=1, tal=1, showtal=-1, strictinsert=1, stackLimit=100): self.program = program self.macros = macros self.engine = engine self.TALESError = engine.getTALESError() self.Default = engine.getDefault() self.stream = stream or sys.stdout self.debug = debug self.wrap = wrap self.metal = metal self.tal = tal assert showtal in (-1, 0, 1) if showtal == -1: showtal = (not tal) self.showtal = showtal self.strictinsert = strictinsert self.stackLimit = stackLimit self.html = 0 self.endsep = "/>" self.macroStack = [] self.definingMacro = None self.position = None, None # (lineno, offset) self.col = 0 self.level = 0 self.scopeLevel = 0
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
elif action == 2 and self.macroStack:
elif action == 2 and self.metal:
def attrAction(self, item): name, value = item[:2] try: action = self.actionIndex[item[2]] except KeyError: raise TALError, ('Error in TAL program', self.position) if not self.showtal and action > 1: return 0, name, value ok = 1 if action <= 1 and self.tal: if self.html and string.lower(name) in BOOLEAN_HTML_ATTRS: evalue = self.engine.evaluateBoolean(item[3]) if evalue is self.Default: if action == 1: # Cancelled insert ok = 0 elif not evalue: ok = 0 else: value = None else: evalue = self.engine.evaluateText(item[3]) if evalue is self.Default: if action == 1: # Cancelled insert ok = 0 else: value = evalue if value is None: ok = 0 elif action == 2 and self.macroStack: i = string.rfind(name, ":") + 1 prefix, suffix = name[:i], name[i:] if suffix == "define-macro": if len(self.macroStack) == 1: macroName, slots = self.macroStack[-1] name = prefix + "use-macro" value = macroName else: ok = 0 if suffix == "fill-slot": macroName, slots = self.macroStack[0] if not slots.has_key(value): ok = 0 if suffix == "define-slot" and not self.definingMacro: name = prefix + "fill-slot" elif action == 1: # Unexecuted insert ok = 0 return ok, name, value
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
if len(self.macroStack) == 1: macroName, slots = self.macroStack[-1]
if what == "use-macro":
def attrAction(self, item): name, value = item[:2] try: action = self.actionIndex[item[2]] except KeyError: raise TALError, ('Error in TAL program', self.position) if not self.showtal and action > 1: return 0, name, value ok = 1 if action <= 1 and self.tal: if self.html and string.lower(name) in BOOLEAN_HTML_ATTRS: evalue = self.engine.evaluateBoolean(item[3]) if evalue is self.Default: if action == 1: # Cancelled insert ok = 0 elif not evalue: ok = 0 else: value = None else: evalue = self.engine.evaluateText(item[3]) if evalue is self.Default: if action == 1: # Cancelled insert ok = 0 else: value = evalue if value is None: ok = 0 elif action == 2 and self.macroStack: i = string.rfind(name, ":") + 1 prefix, suffix = name[:i], name[i:] if suffix == "define-macro": if len(self.macroStack) == 1: macroName, slots = self.macroStack[-1] name = prefix + "use-macro" value = macroName else: ok = 0 if suffix == "fill-slot": macroName, slots = self.macroStack[0] if not slots.has_key(value): ok = 0 if suffix == "define-slot" and not self.definingMacro: name = prefix + "fill-slot" elif action == 1: # Unexecuted insert ok = 0 return ok, name, value
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
ok = 0 if suffix == "fill-slot": macroName, slots = self.macroStack[0] if not slots.has_key(value): ok = 0 if suffix == "define-slot" and not self.definingMacro: name = prefix + "fill-slot"
assert what == "define-macro" i = self.macroContext("use-macro") if i >= 0: j = self.macroContext("define-slot") if j > i: name = prefix + "use-macro" else: ok = 0 elif suffix == "define-slot": assert what == "define-slot" if self.macroContext("use-macro") >= 0: name = prefix + "fill-slot"
def attrAction(self, item): name, value = item[:2] try: action = self.actionIndex[item[2]] except KeyError: raise TALError, ('Error in TAL program', self.position) if not self.showtal and action > 1: return 0, name, value ok = 1 if action <= 1 and self.tal: if self.html and string.lower(name) in BOOLEAN_HTML_ATTRS: evalue = self.engine.evaluateBoolean(item[3]) if evalue is self.Default: if action == 1: # Cancelled insert ok = 0 elif not evalue: ok = 0 else: value = None else: evalue = self.engine.evaluateText(item[3]) if evalue is self.Default: if action == 1: # Cancelled insert ok = 0 else: value = evalue if value is None: ok = 0 elif action == 2 and self.macroStack: i = string.rfind(name, ":") + 1 prefix, suffix = name[:i], name[i:] if suffix == "define-macro": if len(self.macroStack) == 1: macroName, slots = self.macroStack[-1] name = prefix + "use-macro" value = macroName else: ok = 0 if suffix == "fill-slot": macroName, slots = self.macroStack[0] if not slots.has_key(value): ok = 0 if suffix == "define-slot" and not self.definingMacro: name = prefix + "fill-slot" elif action == 1: # Unexecuted insert ok = 0 return ok, name, value
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
def dumpMacroStack(self, prefix, suffix, value): sys.stderr.write("+---- %s%s = %s\n" % (prefix, suffix, value)) for i in range(len(self.macroStack)): what, macroName, slots = self.macroStack[i] sys.stderr.write("| %2d. %-12s %-12s %s\n" % (i, what, macroName, slots and slots.keys())) sys.stderr.write("+--------------------------------------\n")
## def dumpMacroStack(self, prefix, suffix, value):
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
save = self.definingMacro self.definingMacro = macroName
if not self.metal: self.interpret(macro) return self.pushMacro("define-macro", macroName, None)
def do_defineMacro(self, macroName, macro): save = self.definingMacro self.definingMacro = macroName self.interpret(macro) self.definingMacro = save
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
self.definingMacro = save
self.popMacro()
def do_defineMacro(self, macroName, macro): save = self.definingMacro self.definingMacro = macroName self.interpret(macro) self.definingMacro = save
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
if len(self.macroStack) >= self.stackLimit: raise METALError("macro nesting limit (%d) exceeded " "by macro %s" % (self.stackLimit, `macroName`)) self.macroStack.append((macroName, compiledSlots))
self.pushMacro("use-macro", macroName, compiledSlots)
def do_useMacro(self, macroName, macroExpr, compiledSlots, block): if not self.metal: self.interpret(block) return macro = self.engine.evaluateMacro(macroExpr) if macro is self.Default: self.interpret(block) return if not isCurrentVersion(macro): raise METALError("macro %s has incompatible version %s" % (`macroName`, `getProgramVersion(macro)`), self.position) mode = getProgramMode(macro) if mode != (self.html and "html" or "xml"): raise METALError("macro %s has incompatible mode %s" % (`macroName`, `mode`), self.position) if len(self.macroStack) >= self.stackLimit: raise METALError("macro nesting limit (%d) exceeded " "by macro %s" % (self.stackLimit, `macroName`)) self.macroStack.append((macroName, compiledSlots)) self.interpret(macro) self.macroStack.pop()
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
self.macroStack.pop()
self.popMacro()
def do_useMacro(self, macroName, macroExpr, compiledSlots, block): if not self.metal: self.interpret(block) return macro = self.engine.evaluateMacro(macroExpr) if macro is self.Default: self.interpret(block) return if not isCurrentVersion(macro): raise METALError("macro %s has incompatible version %s" % (`macroName`, `getProgramVersion(macro)`), self.position) mode = getProgramMode(macro) if mode != (self.html and "html" or "xml"): raise METALError("macro %s has incompatible mode %s" % (`macroName`, `mode`), self.position) if len(self.macroStack) >= self.stackLimit: raise METALError("macro nesting limit (%d) exceeded " "by macro %s" % (self.stackLimit, `macroName`)) self.macroStack.append((macroName, compiledSlots)) self.interpret(macro) self.macroStack.pop()
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
for macroName, slots in self.macroStack: slot = slots.get(slotName) or slot
for what, macroName, slots in self.macroStack: if what == "use-macro" and slots is not None: slot = slots.get(slotName, slot) self.pushMacro("define-slot", slotName, None)
def do_defineSlot(self, slotName, block): slot = None for macroName, slots in self.macroStack: slot = slots.get(slotName) or slot if slot: self.interpret(slot) else: self.interpret(block)
16e9bae32a04e1cc90bd99d273eafe765aba3b03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/16e9bae32a04e1cc90bd99d273eafe765aba3b03/TALInterpreter.py
s=str(error_value) if tagSearch(s) >= 0: error_message=error_value
try: s=str(error_value) except: pass else: if tagSearch(s) >= 0: error_message=error_value
def raise_standardErrorMessage( self, client=None, REQUEST={}, error_type=None, error_value=None, tb=None, error_tb=None, error_message='', tagSearch=ts_regex.compile('[a-zA-Z]>').search):
4c3767edfd3a52ff512fffb04686a35d32304ee5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4c3767edfd3a52ff512fffb04686a35d32304ee5/SimpleItem.py
assert ec.evaluate('x | python:int') == int
assert ec.evaluate('x | python:int') == 0
def testHybrid(self): '''Test hybrid path expressions''' ec = self.ec assert ec.evaluate('x | python:1+1') == 2
2def053348913315dc5bdba3911f4c6778d87f2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2def053348913315dc5bdba3911f4c6778d87f2d/testExpressions.py