rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def setCookie(self,name,value,**kw):
349fac2452df2de544bd34705932de86103ab82e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/349fac2452df2de544bd34705932de86103ab82e/Response.py
cookie='set-cookie: %s="%s"' % (name,attrs['value'])
cookie='Set-Cookie: %s="%s"' % (name, attrs['value'])
def _cookie_list(self):
349fac2452df2de544bd34705932de86103ab82e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/349fac2452df2de544bd34705932de86103ab82e/Response.py
if name=='expires': cookie = '%s; Expires="%s"' % (cookie,v) elif name=='domain': cookie = '%s; Domain="%s"' % (cookie,v)
name=lower(name) if name=='expires': cookie = '%s; Expires=%s' % (cookie,v) elif name=='domain': cookie = '%s; Domain=%s' % (cookie,v)
def _cookie_list(self):
349fac2452df2de544bd34705932de86103ab82e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/349fac2452df2de544bd34705932de86103ab82e/Response.py
elif name=='max_age': cookie = '%s; Max-Age="%s"' % (cookie,v) elif name=='comment': cookie = '%s; Comment="%s"' % (cookie,v)
elif name=='max_age': cookie = '%s; Max-Age=%s' % (cookie,v) elif name=='comment': cookie = '%s; Comment=%s' % (cookie,v)
def _cookie_list(self):
349fac2452df2de544bd34705932de86103ab82e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/349fac2452df2de544bd34705932de86103ab82e/Response.py
def _cookie_list(self):
349fac2452df2de544bd34705932de86103ab82e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/349fac2452df2de544bd34705932de86103ab82e/Response.py
_DQUOTEDTEXT = r'("[ a-zA-Z0-9\n\-\.\,\;\(\)\/\:\/]+")'
_DQUOTEDTEXT = r'("[ a-zA-Z0-9\n\-\.\,\;\(\)\/\:\/\*\']+")'
def doc_strong(self, s, expr = re.compile(r'\s*\*\*([ \na-zA-Z0-9.:/;\-,!\?\'\"]+)\*\*').search ):
dfbbd4a0ddf65451b22efcf9ca1725ead2a04dae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dfbbd4a0ddf65451b22efcf9ca1725ead2a04dae/DocumentClass.py
if n != '__call__':
if str(n) != '__call__':
def render(ob): """ Calls the object, possibly a document template, or just returns it if not callable. (From DT_Util.py) """ base = aq_base(ob) if callable(base): try: if getattr(base, 'isDocTemp', 0): ob = ob(ob, ob.REQUEST) else: ob = ob() except AttributeError, n: if n != '__call__': raise return ob
ce202f14c8e70b35166bb65fc2b5dc21b8fd55d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ce202f14c8e70b35166bb65fc2b5dc21b8fd55d7/Expressions.py
$Id: Publish.py,v 1.21 1996/10/15 15:45:35 jim Exp $"""
$Id: Publish.py,v 1.22 1996/10/25 19:34:27 jim Exp $"""
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
f4dfc5f9edd25ea5aba674fd5973977a36fc88ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f4dfc5f9edd25ea5aba674fd5973977a36fc88ec/Publish.py
__version__='$Revision: 1.21 $'[11:-2]
__version__='$Revision: 1.22 $'[11:-2]
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
f4dfc5f9edd25ea5aba674fd5973977a36fc88ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f4dfc5f9edd25ea5aba674fd5973977a36fc88ec/Publish.py
output('<TD%s%s VALIGN="TOP" ALLIGN="LEFT">' %
output('<TD%s%s VALIGN="TOP" ALIGN="LEFT">' %
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): tpUr...
db085b65e7fa2aaf240d0b708a68b5a52095e5b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/db085b65e7fa2aaf240d0b708a68b5a52095e5b3/TreeTag.py
def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {}
def get_requests(files, start=None, end=None, statsfname=None, writestats=None, readstats=None):
def get_earliest_file_data(files): temp = {} earliest_fromepoch = 0 earliest = None retn = None for file in files: line = file.readline() if not line: continue linelen = len(line) line = string.strip(line) tup = parsebigmlogline(line) if tup is None: print "Could not interpret line: %s" % line continue code, id, timest...
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
decidelines = {} computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch, desc = tup if computed_start is None: computed_start = fromepoch computed_end = fromepoch if start is not None and fromepoch < start: continue if end is not None and fromepo...
if readstats: fp = open(statsfname, 'r') u = cPickle.Unpickler(fp) requests = u.load() fp.close() del u del fp else: while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch, desc = tup if start is not None and fromepoch < start: continue if end is not None and fromepoch > end: break if co...
def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch...
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
cumulative = cumulative.values() if mode == 'cumulative': dict = cumulative elif mode == 'detailed': dict = requests elif mode == 'timed': dict = requests else: raise "Invalid mode." if mode=='timed':
requests = cumulative.values() requests.sort(sortf) write(requests, top) elif mode=='timed': computed_start = requests[0].start computed_end = requests[-1].t_end
def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch...
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
dict.sort(sortf) write(dict, top)
requests.sort(sortf) write(requests, top) def urlfocuswrite(requests, url, t): l = [] i = 0 for request in requests: if request.url == url: l.append(i) i = i + 1 before = {} after = {} x = 0 for n in l: x = x + 1 r = requests[n] start = r.start earliest = start - t latest = start + t print 'URLs invoked %s seconds bef...
def analyze(files, top, sortf, start=None, end=None, mode='cumulative', resolution=60): beginrequests = {} cumulative = {} finished = [] unfinished = {} decidelines = {} # filename to filepos computed_start = None computed_end = None while 1: tup = get_earliest_file_data(files) if tup is None: break code, id, fromepoch...
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
max_requests = 0
def timewrite(requests, start, end, resolution): max_requests = 0 print "Start: %s End: %s Resolution: %d secs" % \ (tick2str(start), tick2str(end), resolution) print "-" * 78 print print "Date/Time #requests requests/second" d = {} for r in requests: t = r.start slice = getTimeslice(resolution,t)...
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
slices = d.keys() slices.sort() for slice in slices: num = d[slice]
max_requests = 0 for slice in range(min, max, resolution): num = d.get(slice, 0)
def timewrite(requests, start, end, resolution): max_requests = 0 print "Start: %s End: %s Resolution: %d secs" % \ (tick2str(start), tick2str(end), resolution) print "-" * 78 print print "Date/Time #requests requests/second" d = {} for r in requests: t = r.start slice = getTimeslice(resolution,t)...
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
Reports are of three types: cumulative,detailed or timed. The default is cumulative. Data is taken from the one or more Zope detailed request logs (-M logs).
Reports are of four types: cumulative, detailed, timed, or urlfocus. The default is cumulative. Data is taken from one or more Zope detailed request logs (-M logs, aka 'big M' logs) or from a preprocessed statistics file.
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
For timed reports there are no sort specs allowed.
For timed and urlfocus reports, there are no sort specs allowed.
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
elapsed time.""" % {'pname':pname}
elapsed time. %(pname)s debug.log debug2.log --writestats='requests.stat' Write stats file for debug.log and debug2.log into 'requests.stat' and show default report. %(pname)s --readstats='requests.stat' --detailed Read from 'requests.stat' stats file (instead of actual -M log files) and show detailed report agains...
def detailedusage(): details = usage(0) pname = sys.argv[0] details = details + """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
Usage: %s filename1 [filename2 ...] [--cumulative|--detailed|--timed]
Usage: %s filename1 [filename2 ...] [--cumulative | --detailed | [--timed --resolution=seconds]]
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
[--top==n]
[--top=n]
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
[--resolution=seconds]
[--writestats=filename | --readstats=filename] [--urlfocus=url] [--urlfocustime=seconds]
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
resolution=10
resolution=60 urlfocustime=10 urlfocusurl=None statsfname = None readstats = 0 writestats = 0
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
'end=','resolution=']
'end=','resolution=', 'writestats=', 'readstats=','urlfocus=','urlfocustime=']
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
if opt=='--urlfocus': mode='urlfocus' urlfocusurl = val if opt=='--urlfocustime': urlfocustime=int(val)
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
analyze(files, top, sortf, start, end, mode, resolution)
req=get_requests(files, start, end, statsfname, writestats, readstats) analyze(req, top, sortf, start, end, mode, resolution, urlfocusurl, urlfocustime)
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
def usage(basic=1): usage = ( """
76070c7cdc68bf22cdf41234ce64835eb149b1ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76070c7cdc68bf22cdf41234ce64835eb149b1ae/requestprofiler.py
setlist=index.items(lo,hi)
if hi: setlist=index.items(lo,hi) else: setlist=index.items(lo)
def _apply_index(self, request, cid=''):
4fff45ca4fad8ac6244c86b407f3b3de0611596f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4fff45ca4fad8ac6244c86b407f3b3de0611596f/Index.py
if self.REQUEST['REQUEST_METHOD']=='PUT': return PUTer(self,key)
if self.REQUEST['REQUEST_METHOD']=='PUT': return PUTer(self,key).__of__(self)
def __getitem__(self, key): # Hm, getattr didn't work, maybe this is a put: if key[:19]=='manage_draftFolder-': id=key[19:] if hasattr(self, id): return getattr(self, id).manage_supervisor() raise KeyError, key try: if self.REQUEST['REQUEST_METHOD']=='PUT': return PUTer(self,key) except: pass raise KeyError, key
3037ef1e742284417a24582fb954269110270387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3037ef1e742284417a24582fb954269110270387/Folder.py
class PUTer:
class PUTer(Acquisition.Explicit):
def manage_importHack(self, REQUEST=None): "Imports a previously exported object from /var/export.bbe" f=Globals.data_dir+'/export.bbe' o=self._p_jar.import_file(f) id=o.id if hasattr(id,'im_func'): id=id() self._setObject(id,o) return 'OK, I imported %s' % id
3037ef1e742284417a24582fb954269110270387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3037ef1e742284417a24582fb954269110270387/Folder.py
if lower(type)=='text/html':
if lower(type)[:5]=='text/':
def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f...
3037ef1e742284417a24582fb954269110270387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3037ef1e742284417a24582fb954269110270387/Folder.py
self._parent._setObject(name, Image(name, '', BODY, type))
self._parent._setObject(name, Image(name, '', BODY, content_type=type))
def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f...
3037ef1e742284417a24582fb954269110270387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3037ef1e742284417a24582fb954269110270387/Folder.py
self._parent._setObject(name, File(name, '', BODY, type))
self._parent._setObject(name, File(name, '', BODY, content_type=type))
def PUT(self, REQUEST, BODY): """Adds a document, image or file to the folder when a PUT request is received.""" name=self._key try: type=REQUEST['CONTENT_TYPE'] except KeyError: type='' if not type: dot=rfind(name, '.') suf=dot > 0 and lower(name[dot+1:]) or '' if suf: try: type=content_type[suf] except KeyError: if f...
3037ef1e742284417a24582fb954269110270387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3037ef1e742284417a24582fb954269110270387/Folder.py
"""Edit object properties via the web."""
"""Edit object properties via the web. The purpose of this method is to change all property values, even those not listed in REQUEST; otherwise checkboxes that get turned off will be ignored. Use manage_changeProperties() instead for most situations. """
def manage_editProperties(self, REQUEST): """Edit object properties via the web.""" for prop in self._properties: name=prop['id'] if REQUEST.has_key(name): if 'w' in prop.get('mode', 'wd'): value=REQUEST.get(name) self._setPropValue(name, value) return MessageDialog( title ='Success!', message='Your changes have been ...
0006e835a6b11991b010c8b10351aa33c74c5138 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0006e835a6b11991b010c8b10351aa33c74c5138/PropertyManager.py
if REQUEST.has_key(name): if 'w' in prop.get('mode', 'wd'): value=REQUEST.get(name) self._setPropValue(name, value)
if 'w' in prop.get('mode', 'wd'): value=REQUEST.get(name, '') self._setPropValue(name, value)
def manage_editProperties(self, REQUEST): """Edit object properties via the web.""" for prop in self._properties: name=prop['id'] if REQUEST.has_key(name): if 'w' in prop.get('mode', 'wd'): value=REQUEST.get(name) self._setPropValue(name, value) return MessageDialog( title ='Success!', message='Your changes have been ...
0006e835a6b11991b010c8b10351aa33c74c5138 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0006e835a6b11991b010c8b10351aa33c74c5138/PropertyManager.py
h=HTTP() h.connect(self.host, self.port)
h=HTTP(self.host, self.port)
def __call__(self,*args,**kw): method=self.method if method=='PUT' and len(args)==1 and not kw: query=[args[0]] args=() else: query=[] for i in range(len(args)): try: k=self.args[i] if kw.has_key(k): raise TypeError, 'Keyword arg redefined' kw[k]=args[i] except IndexError: raise TypeError, 'Too many arguments'
543e95ece3f6da4856025bedc08cbb2529e43b97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/543e95ece3f6da4856025bedc08cbb2529e43b97/Client.py
if not sys.modules.has_key('logging'): import logging logging.basicConfig()
def _configure_logging(): if not sys.modules.has_key('logging'): import logging logging.basicConfig()
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start))
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
import App.config config = App.config.getConfiguration() config.debug_mode = 0 App.config.setConfiguration(config)
def _configure_debug_mode(): import App.config config = App.config.getConfiguration() config.debug_mode = 0 App.config.setConfiguration(config)
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start))
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
def _configure_client_cache(): import App.config config = App.config.getConfiguration() config.zeo_client_name = None App.config.setConfiguration(config) _configure_logging() _configure_debug_mode() _configure_client_cache()
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start))
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
def _null_import_products(): pass OFS.Application.import_products = _null_import_products
def _apply_patches(): def null_import_products(): pass OFS.Application.import_products = null_import_products
def _exec(cmd): '''Prints the time it takes to execute 'cmd'.''' if os.environ.get('X', None): start = time.time() exec cmd _print('(%.3fs)' % (time.time() - start))
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
def _null_initialize(app): pass OFS.Application.initialize = _null_initialize
def null_initialize(app): pass OFS.Application.initialize = null_initialize
def _null_import_products(): pass
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
def _null_register_topic(self,id,topic): pass App.ProductContext.ProductContext.registerHelpTopic = _null_register_topic def _null_register_title(self,title): pass App.ProductContext.ProductContext.registerHelpTitle = _null_register_title def _null_register_help(self,directory='',clear=1,title_re=None): pass App.Produ...
def null_register_topic(self,id,topic): pass App.ProductContext.ProductContext.registerHelpTopic = null_register_topic def null_register_title(self,title): pass App.ProductContext.ProductContext.registerHelpTitle = null_register_title def null_register_help(self,directory='',clear=1,title_re=None): pass App.ProductCon...
def _null_initialize(app): pass
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
if os.environ.get('ZEO_CLIENT'): del os.environ['ZEO_CLIENT']
if not Zope2._began_startup: _apply_patches()
def _null_register_help(self,directory='',clear=1,title_re=None): pass
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
'''Tests if a product can be found along Products.__path__'''
'''Checks if a product can be found along Products.__path__'''
def hasProduct(name): '''Tests if a product can be found along Products.__path__''' return name in [n[1] for n in get_products()]
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
app = _theApp
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f...
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
install_product(app, product_dir, product_name, meta_types,
install_product(_theApp, product_dir, product_name, meta_types,
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f...
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
if name != 'SomeProduct':
if name != 'SomeProduct':
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f...
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
_s = time.time(); _max = (_s - _start) / 4 _exec('_theApp.Control_Panel') _cp = _theApp.Control_Panel if hasattr(_cp, 'initialize_cache'): _cp.initialize_cache() if (time.time() - _s) > _max: _write('.')
def _load_control_panel(): start = time.time() max = (start - _start) / 4 _exec('_theApp.Control_Panel') _theApp.Control_Panel if (time.time() - start) > max: _write('.')
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f...
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
installProduct('PluginIndexes', 1) installProduct('OFSP', 1)
def _install_products(): installProduct('PluginIndexes', 1) installProduct('OFSP', 1) _load_control_panel() _install_products()
def installProduct(name, quiet=0): '''Installs a Zope product.''' start = time.time() app = _theApp meta_types = [] if not _installedProducts.has_key(name): for priority, product_name, index, product_dir in get_products(): if product_name == name: if not quiet: _print('Installing %s ... ' % product_name) # We want to f...
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
'''Returns what amounts to a sandbox copy of the base ZODB.'''
'''Returns a sandbox copy of the base ZODB.'''
def sandbox(base=None): '''Returns what amounts to a sandbox copy of the base ZODB.''' if base is None: base = Zope2.DB base_storage = base._storage quota = getattr(base_storage, '_quota', None) storage = DemoStorage(base=base_storage, quota=quota) return ZODB.DB(storage)
f8c45562b7ce76e16b3ca098b95a6ff1e22605e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8c45562b7ce76e16b3ca098b95a6ff1e22605e6/ZopeLite.py
if env.has_key('HTTP_CGI_AUTHORIZATION'): dict['HTTP_AUTHORIZATION']=env['HTTP_CGI_AUTHORIZATION'] try: del env['HTTP_CGI_AUTHORIZATION']
if dict.has_key('HTTP_CGI_AUTHORIZATION'): dict['HTTP_AUTHORIZATION']=dict['HTTP_CGI_AUTHORIZATION'] try: del dict['HTTP_CGI_AUTHORIZATION']
def sane_environment(env): # return an environment mapping which has been cleaned of # funny business such as REDIRECT_ prefixes added by Apache # or HTTP_CGI_AUTHORIZATION hacks. dict={} for key, val in env.items(): while key[:9]=='REDIRECT_': key=key[9:] dict[key]=val if env.has_key('HTTP_CGI_AUTHORIZATION'): dict['H...
5b433e3c5558e4619dc01e30ebe079e89c5f671f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5b433e3c5558e4619dc01e30ebe079e89c5f671f/Publish.py
def testNotValidateWithoutRoles(self):
def testValidateWithoutRoles(self):
def testNotValidateWithoutRoles(self): user = self.uf.validate(self.app.REQUEST, self.basic) self.assertEqual(user, None)
a45b9e05debbb1dbf9cbb758ab9d14f4590bb2d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a45b9e05debbb1dbf9cbb758ab9d14f4590bb2d2/testUserFolder.py
self.assertEqual(user, None)
self.assertEqual(user.getUserName(), 'user1')
def testNotValidateWithoutRoles(self): user = self.uf.validate(self.app.REQUEST, self.basic) self.assertEqual(user, None)
a45b9e05debbb1dbf9cbb758ab9d14f4590bb2d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a45b9e05debbb1dbf9cbb758ab9d14f4590bb2d2/testUserFolder.py
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UserFolderTests)) suite.addTest(unittest.makeSuite(UserTests)) return suite
a45b9e05debbb1dbf9cbb758ab9d14f4590bb2d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a45b9e05debbb1dbf9cbb758ab9d14f4590bb2d2/testUserFolder.py
else: result=apply(DB__.query, query) r=compress(result) cache[query]= now, r if compressed: return r
return result result=apply(DB__.query, query) r=compress(result) cache[query]= now, r if compressed: return r
def _cached_result(self, DB__, query, compressed=0):
fc556a6a8958f9b5407cc798cd36fb278afde571 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fc556a6a8958f9b5407cc798cd36fb278afde571/DA.py
offset=(-localzone/(60*60))
offset=(-localzone/(60*60.0))
def _findLocalTimeZoneName(isDST): if not daylight: # Daylight savings does not occur in this time zone. isDST = 0 try: # Get the name of the current time zone depending # on DST. _localzone = _cache._zmap[tzname[isDST].lower()] except: try: # Generate a GMT-offset zone name. if isDST: localzone = altzone else: localzo...
b39e614bc46d4c5d2133dcbd9c72faf00ecf638f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b39e614bc46d4c5d2133dcbd9c72faf00ecf638f/DateTime.py
def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None):
def manage_addFolder(self, id, title='', createPublic=0, createUserF=0, REQUEST=None):
def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=Folder() i.id=id i.title...
566da61e8d5234ed411f999cb48ecc572c7e0aae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/566da61e8d5234ed411f999cb48ecc572c7e0aae/Folder.py
i=Folder() i.id=id i.title=title self._setObject(id,i) if createUserF: i.manage_addUserFolder() if createPublic: i.manage_addDTMLDocument(id='index_html',title='') if REQUEST is not None: return self.manage_main(self,REQUEST,update_menu=1)
ob=Folder() ob.id=id ob.title=title self._setObject(id, ob) try: user=REQUEST['AUTHENTICATED_USER'] except: user=None if createUserF: if (user is not None) and not ( user.has_permission('Add User Folders', self)): raise 'Unauthorized', ( 'You are not authorized to add User Folders.' ) ob.manage_addUserFolder() if creat...
def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=Folder() i.id=id i.title...
566da61e8d5234ed411f999cb48ecc572c7e0aae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/566da61e8d5234ed411f999cb48ecc572c7e0aae/Folder.py
tb=sys.exc_traceback
tb=sys.exc_info()[2]
def __call__(self, *args, **kw): """Call an ExternalMethod
7bbd4be712b94d967a3f2f42ae02e2412676f197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7bbd4be712b94d967a3f2f42ae02e2412676f197/ExternalMethod.py
def valid_roles(self): "Return list of valid roles" obj=self dict={} dup =dict.has_key x=0 while x < 100: if hasattr(obj, '__ac_roles__'): roles=obj.__ac_roles__ for role in roles: if not dup(role): dict[role]=1 if not hasattr(obj, 'aq_parent'): break obj=obj.aq_parent x=x+1 roles=dict.keys() roles.sort() return roles
8d2817c7510574c144e733630f85598482f5ed02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8d2817c7510574c144e733630f85598482f5ed02/ZCatalog.py
""" Attempt to resolve a url into an object in the Zope namespace. The url may be absolute or a catalog path style url. If no object is found, None is returned. No exceptions are raised. """ script=REQUEST.script if string.find(path, script) != 0: path='%s/%s' % (script, path)
""" """ while path and path[0]=='/': path=path[1:] while path and path[-1]=='/': path=path[:-1] req=REQUEST.clone() rsp=req.response req['PATH_INFO']=path object=None try: object=req.traverse(path) except: pass if object is not None: if hasattr(object, 'id'): if callable(object.id): name=object.id() else: name=object...
def resolve_url(self, path, REQUEST): """ Attempt to resolve a url into an object in the Zope namespace. The url may be absolute or a catalog path style url. If no object is found, None is returned. No exceptions are raised. """ script=REQUEST.script if string.find(path, script) != 0: path='%s/%s' % (script, path) pri...
8d2817c7510574c144e733630f85598482f5ed02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8d2817c7510574c144e733630f85598482f5ed02/ZCatalog.py
print "resolving", path try: return REQUEST.resolve_url(path) except: print "not found" return None
def resolve_url(self, path, REQUEST): """ Attempt to resolve a url into an object in the Zope namespace. The url may be absolute or a catalog path style url. If no object is found, None is returned. No exceptions are raised. """ script=REQUEST.script if string.find(path, script) != 0: path='%s/%s' % (script, path) pri...
8d2817c7510574c144e733630f85598482f5ed02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8d2817c7510574c144e733630f85598482f5ed02/ZCatalog.py
def __init__(self, id, text=None, content_type=None, encoding='utf-8', strict=True, output_encoding='utf-8'):
def __init__(self, id, text=None, content_type=None, strict=True, output_encoding='utf-8'):
def __init__(self, id, text=None, content_type=None, encoding='utf-8', strict=True, output_encoding='utf-8'): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) self.output_encoding = output_encoding
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
self.pt_edit(text, content_type, True)
self.pt_edit(text, content_type)
def __init__(self, id, text=None, content_type=None, encoding='utf-8', strict=True, output_encoding='utf-8'): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) self.output_encoding = output_encoding
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
guessed_content_type = guess_type('', text) if guessed_content_type != content_type: raise ValueError('Guessed content-type != passed content-type (%s vs. %s)' % (guessed_content_type, content_type))
def pt_edit(self, text, content_type, keep_output_encoding=False):
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
print charset
def pt_edit(self, text, content_type, keep_output_encoding=False):
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
def pt_edit(self, text, content_type, keep_output_encoding=False):
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
raise ValueError('Unsupported content_type %s' % content_type)
raise ValueError('Unsupported content-type %s' % content_type)
def pt_edit(self, text, content_type, keep_output_encoding=False):
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
response.setHeader('content-type', '%s; charset=%s' % (self.content_type, self.output_encoding))
response.setHeader('content-type', self.content_type)
def _exec(self, bound_names, args, kw): """Call a Page Template""" if not kw.has_key('args'): kw['args'] = args bound_names['options'] = kw
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
encoding = sniffEncoding(text)
def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8', submit=None, REQUEST=None, RESPONSE=None): "Add a Page Template with optional file content." filename = '' content_type = 'text/html' if REQUEST and REQUEST.has_key('file'): file = REQUEST['file'] filename = file.filename text = file.read() hea...
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
encoding = sniffEncoding(text) zpt = ZopePageTemplate(id, text, content_type, encoding, True)
if not isinstance(text, unicode): text = unicode(text, encoding) zpt = ZopePageTemplate(id, text, content_type, output_encoding=encoding)
def manage_addPageTemplate(self, id, title='', text='', encoding='utf-8', submit=None, REQUEST=None, RESPONSE=None): "Add a Page Template with optional file content." filename = '' content_type = 'text/html' if REQUEST and REQUEST.has_key('file'): file = REQUEST['file'] filename = file.filename text = file.read() hea...
a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a4f57c3a9dc9677420ec24e2ab70f40ecc5cc78e/ZopePageTemplate.py
'url_quote' function.
'quote' function.
def url_quote(s): """ Convert characters that have special meaning in URLS to HTML character entities using decimal values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_quote' function. """
8a7dac44e5b13112e47e784d5f1511a9a4a63404 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8a7dac44e5b13112e47e784d5f1511a9a4a63404/standard.py
'url_quote_plus' function.
'quote_plus' function.
def url_quote_plus(s): """ Like url_quote but also replace blank space characters with '+'. This is needed for building query strings in some cases. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_quote_plus' function. """
8a7dac44e5b13112e47e784d5f1511a9a4a63404 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8a7dac44e5b13112e47e784d5f1511a9a4a63404/standard.py
Convert HTML character entities in strings back to their real values.
Convert HTML %xx character entities into the characters they represent. (Undoes the affects of url_quote). See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'unquote' function. """ def url_unquote_plus(s): """ Like url_unquote but also replace '+' characters with blank spac...
def url_unquote(s): """ Convert HTML character entities in strings back to their real values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote' function. """
8a7dac44e5b13112e47e784d5f1511a9a4a63404 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8a7dac44e5b13112e47e784d5f1511a9a4a63404/standard.py
'url_unquote' function. """ def url_unquote(s): """ Like url_unquote, but also replace '+' characters with spaces.
'unquote_plus' function.
def url_unquote(s): """ Convert HTML character entities in strings back to their real values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote' function. """
8a7dac44e5b13112e47e784d5f1511a9a4a63404 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8a7dac44e5b13112e47e784d5f1511a9a4a63404/standard.py
See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote_plus' function.
def url_unquote(s): """ Like url_unquote, but also replace '+' characters with spaces. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'url_unquote_plus' function. """
8a7dac44e5b13112e47e784d5f1511a9a4a63404 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8a7dac44e5b13112e47e784d5f1511a9a4a63404/standard.py
t=[]; a=t.append for s in subs: a(s.getNodeValue()) apply(ST.StructuredTextParagraph.__init__, (self, join(t,'\n\n'), ()), kw)
t=[] a=t.append for s in subs: flatten(s, a) apply(ST.StructuredTextParagraph.__init__, (self, join(t,'\n\n'), ()), kw)
def __init__(self, subs, **kw): t=[]; a=t.append for s in subs: a(s.getNodeValue()) apply(ST.StructuredTextParagraph.__init__, (self, join(t,'\n\n'), ()), kw)
269550f7ef5e3a98495bddfc61de1d9bf07232ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/269550f7ef5e3a98495bddfc61de1d9bf07232ac/DocumentClass.py
'getContentType', '__call__', '')),
'getContentType', '')),
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=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) self=self...
c12e5349ffeb3dc11bd832082318fe404a5b4ff7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c12e5349ffeb3dc11bd832082318fe404a5b4ff7/Image.py
'getContentType', '__call__', '')),
'getContentType', '')),
def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) se...
c12e5349ffeb3dc11bd832082318fe404a5b4ff7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c12e5349ffeb3dc11bd832082318fe404a5b4ff7/Image.py
main()
unittest.main(defaultTest='test_suite')
def test_suite(): return unittest.makeSuite(HTMLTests, 'check')
7006502f1c7cbd946169753181fe8b44e9ce0c7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7006502f1c7cbd946169753181fe8b44e9ce0c7c/testHTMLTests.py
"""IMplement a contents view by redirecting to the true view
"""Implement a contents view by redirecting to the true view
def manage_main(trueself, self, REQUEST, update_menu=0): """IMplement a contents view by redirecting to the true view """ d = update_menu and '/manage_main?update_menu=1' or '/manage_main' REQUEST['RESPONSE'].redirect(self.DestinationURL()+d)
5f0e905ba0cabb0fa334077a2657317d35896929 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5f0e905ba0cabb0fa334077a2657317d35896929/FactoryDispatcher.py
mm = TemplateDict() mm._push(var) mm._push({'_ob': ob}) return mm['_ob']
return render(ob)
def __call__(self, econtext): base = self._base path = list(self._path) # Copy! contexts = econtext.contexts var = contexts['var'] # Expand dynamic path parts from right to left. for i, varname in self._dynparts: val = var[varname] if type(val) is type(''): path[i] = val else: # If the value isn't a string, assume it's...
b6b70769d466497fbc77d60b6933611ad7255a7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b6b70769d466497fbc77d60b6933611ad7255a7c/Expressions.py
prop=' <n:%s%s>%s</n:%s>' % (name, attrs, xml_escape(value), name)
if hasattr(self,"dav__"+name): prop=' <n:%s%s>%s</n:%s>' % (name, attrs, value, name) else: prop=' <n:%s%s>%s</n:%s>' % (name, attrs, xml_escape(value), name)
def dav__allprop(self, propstat=propstat, join=string.join): # DAV helper method - return one or more propstat elements # indicating property names and values for all properties. result=[] for item in self._propertyMap(): name, type=item['id'], item.get('type','string') value=self.getProperty(name) if type=='tokens': v...
a85fb5699520687030a044cd38d951a2665447c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a85fb5699520687030a044cd38d951a2665447c9/PropertySheets.py
if REQUEST is not None: return self.manage_main(self,REQUEST)
if REQUEST is not None: try: url=self.DestinationURL() except: url=REQUEST['URL1'] REQUEST.RESPONSE.redirect('%s/manage_main' % url)
def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id, title = cookId(id, title, file) self=self.this() self._setObject(id, Image(id,title,'',content_type, precondition)) if Global...
65bd59473d3c0693c5f70b0384fedf6f4de3025f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/65bd59473d3c0693c5f70b0384fedf6f4de3025f/Image.py
"""Principia object for *Images*, can be GIF, PNG or JPEG. Has the same methods as File objects. Images also have a string representation that renders an HTML 'IMG' tag.
"""Image objects can be GIF, PNG or JPEG and have the same methods as File objects. Images also have a string representation that renders an HTML 'IMG' tag.
def manage_addImage(self, id, file, title='', precondition='', content_type='', REQUEST=None): """ Add a new Image object. Creates a new Image object 'id' with the contents of 'file'. """ id, title = cookId(id, title, file) self=self.this() self._setObject(id, Image(id,title,'',content_type, precondition)) if Global...
65bd59473d3c0693c5f70b0384fedf6f4de3025f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/65bd59473d3c0693c5f70b0384fedf6f4de3025f/Image.py
raise ParseError, "%s, for tag %s, on line %s of %s<p>" % (
raise ParseError, "%s, for tag %s, on line %s of %s" % (
def parse_error(self, mess, tag, text, start): raise ParseError, "%s, for tag %s, on line %s of %s<p>" % ( mess, self.errQuote(tag), len(text[:start].split('\n')), self.errQuote(self.__name__))
b0b56654eb4022b1c5183a2436d6036dec528504 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b0b56654eb4022b1c5183a2436d6036dec528504/DT_String.py
self.index = self._index_factory(self.getLexicon())
self.index = self._index_factory(aq_base(self.getLexicon()))
def __init__(self, id, extra=None, caller=None, index_factory=None, field_name=None, lexicon_id=None): self.id = id
1983f3222982f9762c68c1c0082667236969059b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1983f3222982f9762c68c1c0082667236969059b/ZCTextIndex.py
print tag, self.nsdict
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) print tag, self.nsdict if tag not in EMPTY_HTML_TAGS: self.tagstack.append(tag) else: self.pop_xmlns() print "<", tag, self.nsdict self.gen.emitStartTag(tag, attrs)
df4d0c74a69327d848b994100662ee069776ae40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/df4d0c74a69327d848b994100662ee069776ae40/HTMLTALParser.py
print "<", tag, self.nsdict
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) print tag, self.nsdict if tag not in EMPTY_HTML_TAGS: self.tagstack.append(tag) else: self.pop_xmlns() print "<", tag, self.nsdict self.gen.emitStartTag(tag, attrs)
df4d0c74a69327d848b994100662ee069776ae40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/df4d0c74a69327d848b994100662ee069776ae40/HTMLTALParser.py
print "<", tag, self.nsdict
def finish_endtag(self, tag): if tag not in EMPTY_HTML_TAGS: if not tag: tag = self.tagstack.pop() else: assert tag in self.tagstack while self.tagstack[-1] != tag: self.finish_endtag(None) self.tagstack.pop() self.pop_xmlns() print "<", tag, self.nsdict self.gen.emitEndTag(tag)
df4d0c74a69327d848b994100662ee069776ae40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/df4d0c74a69327d848b994100662ee069776ae40/HTMLTALParser.py
obj=obj._getCopy(self)
def pasteFromClipboard(self,clip_id='',clip_data='',REQUEST=None): """ """
a811511462eb67d5a9c5f6eb83f8eeac1b6552d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a811511462eb67d5a9c5f6eb83f8eeac1b6552d9/CopySupport.py
if hasattr(ob, '__call__'): return 1 else: return isinstance(ob, types.ClassType)
return hasattr(ob, '__call__') or isinstance(ob, types.ClassType)
def safe_callable(ob): # Works with ExtensionClasses and Acquisition. if hasattr(ob, '__class__'): if hasattr(ob, '__call__'): return 1 else: return isinstance(ob, types.ClassType) else: return callable(ob)
8430ae6c5d023444299a01fa4d815c7986f5ea7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8430ae6c5d023444299a01fa4d815c7986f5ea7b/Catalog.py
def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes.
8430ae6c5d023444299a01fa4d815c7986f5ea7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8430ae6c5d023444299a01fa4d815c7986f5ea7b/Catalog.py
if index%4000 == 0: index = randid()
if index % 4000 == 0: index = randint(-2000000000, 2000000000)
def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes.
8430ae6c5d023444299a01fa4d815c7986f5ea7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8430ae6c5d023444299a01fa4d815c7986f5ea7b/Catalog.py
index=randid()
index = randint(-2000000000, 2000000000)
def catalogObject(self, object, uid, threshold=None,idxs=[]): """ Adds an object to the Catalog by iteratively applying it all indexes.
8430ae6c5d023444299a01fa4d815c7986f5ea7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8430ae6c5d023444299a01fa4d815c7986f5ea7b/Catalog.py
% (fields[i], self._names[i], _index))
% (fields[i], self._names[i], index))
def __getitem__(self,index):
d53be4db1828076cf563123dda09807797b5d68d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d53be4db1828076cf563123dda09807797b5d68d/RDB.py
def _delOb(self, id, value):
def _delOb(self, id):
def _delOb(self, id, value): delattr(self, id) pc=self.aq_inner.aq_parent.aq_parent._zclass_propertysheets_class delattr(pc,id) pc.__propset_attrs__=tuple(map(lambda o: o[0], self._objects)) rclass(pc)
587a5c227b00b6d743bd416d3c62bcc7cfcbc94b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/587a5c227b00b6d743bd416d3c62bcc7cfcbc94b/Property.py
CatalogAwareInterface=Interface(CatalogAware)
def reindex_all(obj=None): """
63317c2664b935dd0d24567a26eab0cac246a246 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/63317c2664b935dd0d24567a26eab0cac246a246/CatalogAwarenessInterface.py
if 'Anonymous' in roles: return 1
if 'Anonymous' in object_roles: return 1
def allowed(self, object, object_roles=None): """Check whether the user has access to object, assuming that object.__roles__ is the given roles.""" if object_roles is None or 'Anonymous' in object_roles: return 1 usr_roles=self.getRolesInContext(object) for role in object_roles: if role in usr_roles: # The user apparen...
995ab4d721e0d0e83a1b565d61aad7f69e7f302a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/995ab4d721e0d0e83a1b565d61aad7f69e7f302a/User.py