rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
return self.__nextwid - 1
return self._nextwid - 1
def length(self): """Return the number of unique terms in the lexicon.""" return self.__nextwid - 1
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
return self.__wids.keys()
return self._wids.keys()
def words(self): return self.__wids.keys()
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
return self.__words.keys()
return self._words.keys()
def wids(self): return self.__words.keys()
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
return self.__wids.items()
return self._wids.items()
def items(self): return self.__wids.items()
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
for element in self.__pipeline:
for element in self._pipeline:
def sourceToWordIds(self, text): last = _text2list(text) for element in self.__pipeline: last = element.process(last) return map(self._getWordIdCreate, last)
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
for element in self.__pipeline:
for element in self._pipeline:
def termToWordIds(self, text): last = _text2list(text) for element in self.__pipeline: last = element.process(last) wids = [] for word in last: wid = self.__wids.get(word) if wid is not None: wids.append(wid) return wids
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
wid = self.__wids.get(word)
wid = self._wids.get(word)
def termToWordIds(self, text): last = _text2list(text) for element in self.__pipeline: last = element.process(last) wids = [] for word in last: wid = self.__wids.get(word) if wid is not None: wids.append(wid) return wids
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
return self.__words[wid]
return self._words[wid]
def get_word(self, wid): """Return the word for the given word id""" return self.__words[wid]
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
keys = self.__wids.keys(prefix)
keys = self._wids.keys(prefix)
def globToWordIds(self, pattern): if not re.match("^\w+\*$", pattern): return [] pattern = pattern.lower() assert pattern.endswith("*") prefix = pattern[:-1] assert prefix and not prefix.endswith("*") keys = self.__wids.keys(prefix) # Keys starting at prefix wids = [] words = [] for key in keys: if not key.startswith(prefix): break wids.append(self.__wids[key]) words.append(key) return wids
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
wids.append(self.__wids[key])
wids.append(self._wids[key])
def globToWordIds(self, pattern): if not re.match("^\w+\*$", pattern): return [] pattern = pattern.lower() assert pattern.endswith("*") prefix = pattern[:-1] assert prefix and not prefix.endswith("*") keys = self.__wids.keys(prefix) # Keys starting at prefix wids = [] words = [] for key in keys: if not key.startswith(prefix): break wids.append(self.__wids[key]) words.append(key) return wids
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
wid = self.__wids.get(word)
wid = self._wids.get(word)
def _getWordIdCreate(self, word): wid = self.__wids.get(word) if wid is None: wid = self.__new_wid() self.__wids[word] = wid self.__words[wid] = word return wid
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
wid = self.__new_wid() self.__wids[word] = wid self.__words[wid] = word
wid = self._new_wid() self._wids[word] = wid self._words[wid] = word
def _getWordIdCreate(self, word): wid = self.__wids.get(word) if wid is None: wid = self.__new_wid() self.__wids[word] = wid self.__words[wid] = word return wid
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
def __new_wid(self): wid = self.__nextwid self.__nextwid += 1
def _new_wid(self): wid = self._nextwid self._nextwid += 1
def __new_wid(self): wid = self.__nextwid self.__nextwid += 1 return wid
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
self._catalog._convertBTrees(threshold *1 )
self._catalog._convertBTrees(threshold)
def manage_convertBTrees(self, threshold=200): """Convert the catalog's data structures to use BTrees package""" tt=time.time() ct=time.clock() self._catalog._convertBTrees(threshold *1 #make sure ints an int) ) tt=time.time()-tt ct=time.clock()-ct return 'Finished conversion in %s seconds (%s cpu)' % (tt, ct)
926e34b00d1f44c832096455d5a6650bc940d96c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/926e34b00d1f44c832096455d5a6650bc940d96c/ZCatalog.py
replace(encodestring('%s:%s' % (self.username,self.password), '\012','')))
replace(encodestring('%s:%s' % (self.username,self.password)), '\012',''))
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'
ef4bdd2df8f51bb6a7bc98867cf7188364d252e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ef4bdd2df8f51bb6a7bc98867cf7188364d252e7/Client.py
def main(): import getopt from string import split user=None try: optlist, args = getopt.getopt(sys.argv[1:],'u:') url=args[0] u =filter(lambda o: o[0]=='-u', optlist) if u: [user, pw] = split(u[0][1],':') kw={} for arg in args[1:]: [name,v]=split(arg,'=') if name[-5:]==':file': name=name[:-5] if v=='-': v=sys.stdin else: v=open(v) kw[name]=v except: print usage sys.exit(1) # The "main" program for this module f=Function(url) if user: f.username, f.password = user, pw headers, body = apply(f,(),kw) sys.stderr.write(join(map(lambda h: "%s: %s\n" % h, headers.items()),"") +"\n\n") print body
ef4bdd2df8f51bb6a7bc98867cf7188364d252e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ef4bdd2df8f51bb6a7bc98867cf7188364d252e7/Client.py
def __init__(self, product, dest, REQUEST):
def __init__(self, product, dest, REQUEST=None):
def __init__(self, product, dest, REQUEST): if hasattr(product,'aq_base'): product=product.aq_base self._product=product self._d=dest v=REQUEST['URL'] v=v[:rfind(v,'/')] self._u=v[:rfind(v,'/')]
5ff387a7c379b9f8a59b42539fc9125f5420400d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5ff387a7c379b9f8a59b42539fc9125f5420400d/FactoryDispatcher.py
v=REQUEST['URL'] v=v[:rfind(v,'/')] self._u=v[:rfind(v,'/')]
if REQUEST is not None: v=REQUEST['URL'] v=v[:rfind(v,'/')] self._u=v[:rfind(v,'/')]
def __init__(self, product, dest, REQUEST): if hasattr(product,'aq_base'): product=product.aq_base self._product=product self._d=dest v=REQUEST['URL'] v=v[:rfind(v,'/')] self._u=v[:rfind(v,'/')]
5ff387a7c379b9f8a59b42539fc9125f5420400d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5ff387a7c379b9f8a59b42539fc9125f5420400d/FactoryDispatcher.py
class ZPTMacros(unittest.TestCase):
class ZPTMacros(zope.component.testing.PlacelessSetup, unittest.TestCase):
def testAddWithRequestButNoFile(self): """Collector #596: manage_add with text but no file""" request = self.app.REQUEST self._addPT('pt1', text=self.text, REQUEST=request) # no object is returned when REQUEST is passed. pt = self.app.pt1 self.assertEqual(pt.document_src(), self.text)
d8a6bbd0fca9ebe11d6dbf2db8b1a97f234f3769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d8a6bbd0fca9ebe11d6dbf2db8b1a97f234f3769/testZopePageTemplate.py
'regex': _stringInput, 'Regex': _stringInput, 'regexs': _stringInput, 'Regexs': _stringInput, 'tokens': _stringInput,
'tokens': _tokensInput,
def _textInput(self,n,t,v): return ('<TEXTAREA NAME="%s" ROWS="10" COLS="40">%s</TEXTAREA>'
76f3943b8925b2dc7d18a11c18220798299870ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/76f3943b8925b2dc7d18a11c18220798299870ee/ObjectManager.py
def manage_catalogClear(self, REQUEST, RESPONSE, URL1):
def manage_catalogClear(self, REQUEST=None, RESPONSE=None, URL1=None):
def manage_catalogClear(self, REQUEST, RESPONSE, URL1): """ clears the whole enchelada """ self._catalog.clear()
a0dd2ff1ca43d98e5c547cbaefb673dba797e468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a0dd2ff1ca43d98e5c547cbaefb673dba797e468/ZCatalog.py
RESPONSE.redirect(URL1 + '/manage_catalogView?manage_tabs_message=Catalog%20Cleared')
if REQUEST and RESPONSE: RESPONSE.redirect(URL1 + '/manage_catalogView?manage_tabs_message=Catalog%20Cleared')
def manage_catalogClear(self, REQUEST, RESPONSE, URL1): """ clears the whole enchelada """ self._catalog.clear()
a0dd2ff1ca43d98e5c547cbaefb673dba797e468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a0dd2ff1ca43d98e5c547cbaefb673dba797e468/ZCatalog.py
def manage_addColumn(self, name, REQUEST, RESPONSE, URL1):
def manage_addColumn(self, name, REQUEST=None, RESPONSE=None, URL1=None):
def manage_addColumn(self, name, REQUEST, RESPONSE, URL1): """ add a column """ self._catalog.addColumn(name)
a0dd2ff1ca43d98e5c547cbaefb673dba797e468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a0dd2ff1ca43d98e5c547cbaefb673dba797e468/ZCatalog.py
RESPONSE.redirect(URL1 + '/manage_catalogSchema?manage_tabs_message=Column%20Added') def manage_delColumns(self, names, REQUEST, RESPONSE, URL1):
if REQUEST and RESPONSE: RESPONSE.redirect(URL1 + '/manage_catalogSchema?manage_tabs_message=Column%20Added') def manage_delColumns(self, names, REQUEST=None, RESPONSE=None, URL1=None):
def manage_addColumn(self, name, REQUEST, RESPONSE, URL1): """ add a column """ self._catalog.addColumn(name)
a0dd2ff1ca43d98e5c547cbaefb673dba797e468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a0dd2ff1ca43d98e5c547cbaefb673dba797e468/ZCatalog.py
RESPONSE.redirect(URL1 + '/manage_catalogSchema?manage_tabs_message=Column%20Deleted') def manage_addIndex(self, name, type, REQUEST, RESPONSE, URL1):
if REQUEST and RESPONSE: RESPONSE.redirect(URL1 + '/manage_catalogSchema?manage_tabs_message=Column%20Deleted') def manage_addIndex(self, name, type, REQUEST=None, RESPONSE=None, URL1=None):
def manage_delColumns(self, names, REQUEST, RESPONSE, URL1): """ del a column """ for name in names: self._catalog.delColumn(name)
a0dd2ff1ca43d98e5c547cbaefb673dba797e468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a0dd2ff1ca43d98e5c547cbaefb673dba797e468/ZCatalog.py
RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Added') def manage_delIndexes(self, names, REQUEST, RESPONSE, URL1):
if REQUEST and RESPONSE: RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Added') def manage_delIndexes(self, names, REQUEST=None, RESPONSE=None, URL1=None):
def manage_addIndex(self, name, type, REQUEST, RESPONSE, URL1): """ add an index """ self._catalog.addIndex(name, type) RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Added')
a0dd2ff1ca43d98e5c547cbaefb673dba797e468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a0dd2ff1ca43d98e5c547cbaefb673dba797e468/ZCatalog.py
RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Deleted')
if REQUEST and RESPONSE: RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Deleted')
def manage_delIndexes(self, names, REQUEST, RESPONSE, URL1): """ del an index """ for name in names: self._catalog.delIndex(name) RESPONSE.redirect(URL1 + '/manage_catalogIndexes?manage_tabs_message=Index%20Deleted')
a0dd2ff1ca43d98e5c547cbaefb673dba797e468 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a0dd2ff1ca43d98e5c547cbaefb673dba797e468/ZCatalog.py
s=list(s[1])
s=s[1] if type(s)==type(()): s=list(s)
def apply_diff(state, diff, expand): if not diff: return s=[None, state] diff.reverse() __traceback_info__=s, diff while diff: id=diff[-1] del diff[-1] if len(s)==1: s.append([]) s=list(s[1]) loc=-1 for i in range(len(s)): if s[i][0]==id: loc=i break if loc >= 0: if not diff and not expand: del s[loc] else: s=s[loc] elif diff or expand: s.append([id,[]]) s=s[-1][1] while diff: id=diff[-1] del diff[-1] if diff or expand: s.append([id,[]]) s=s[-1][1]
33d12bd5c6c3d5630d421d6642a34c31e12f02f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/33d12bd5c6c3d5630d421d6642a34c31e12f02f3/TreeTag.py
if e > 0: args=text[n:e] if ent_name(text[n+1:e]) > 0: d=self.__dict__ d=self.__dict__ d[0]=text[s:e+1] d[1]=d['end']='' d[2]=d['name']='var' d[3]=d['args']=args return s
if e < 0: break args=text[n:e] if ent_name(text[n+1:e]) > 0: d=self.__dict__ d=self.__dict__ d[0]=text[s:e+1] d[1]=d['end']='' d[2]=d['name']='var' d[3]=d['args']=args return s
def search(self, text, start=0, name_match=regex.compile('[\0- ]*[a-zA-Z]+[\0- ]*').match, end_match=regex.compile('[\0- ]*\(/\|end\)', regex.casefold).match, start_search=regex.compile('[<&]').search, ent_name=regex.compile('[-a-zA-Z0-9_.]+').match, find=find, strip=strip ):
93c273a0b65e399d3717107f162bd40368e1f2b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93c273a0b65e399d3717107f162bd40368e1f2b5/DT_HTML.py
__roles__=[]
def has_permission(self, permission, object): return 1
a3e3eeba6eb72c423861db4e0988e627df39430c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a3e3eeba6eb72c423861db4e0988e627df39430c/User.py
"""
""" % (id, id)
def _view_widget_for_type(self, t, id): if t not in ('lines', 'tokens'): return '<!--#var %s-->' % id return """ <!--#in %s--> <!--#var sequence-item--> <!--#in %s--> """
b97526282b8d8347ef4b636cc47b02ea8b77a2b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b97526282b8d8347ef4b636cc47b02ea8b77a2b7/Property.py
timezone names is case-insensitive."""
timezone names is case-insensitive."""
def __init__(self,*args): """Return a new date-time object
c505745849a701829b653ae7f7a1277e7be163d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c505745849a701829b653ae7f7a1277e7be163d8/DateTime.py
if not month or month > 12: raise self.SyntaxError, string
if not month: raise SyntaxError,string if month > 12: tmp=month month=day day=tmp
def _parse(self,string):
c505745849a701829b653ae7f7a1277e7be163d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c505745849a701829b653ae7f7a1277e7be163d8/DateTime.py
"could not load package %s: %s" % (package, str(e)),
"could not load package %s: %s" % (package, repr(e)),
def schemaComponentSource(self, package, file): parts = package.split(".") if not parts: raise ZConfig.SchemaError( "illegal schema component name: " + `package`) if "" in parts: # '' somewhere in the package spec; still illegal raise ZConfig.SchemaError( "illegal schema component name: " + `package`) file = file or "component.xml" try: __import__(package) except ImportError, e: raise ZConfig.SchemaResourceError( "could not load package %s: %s" % (package, str(e)), filename=file, package=package) pkg = sys.modules[package] if not hasattr(pkg, "__path__"): raise ZConfig.SchemaResourceError( "import name does not refer to a package", filename=file, package=package) for dir in pkg.__path__: dirname = os.path.abspath(dir) fn = os.path.join(dirname, file) if os.path.exists(fn): return "file://" + urllib.pathname2url(fn) else: raise ZConfig.SchemaResourceError("schema component not found", filename=file, package=package, path=pkg.__path__)
15733eb121f11f3ac3e79097b7fb01c16b2b724c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/15733eb121f11f3ac3e79097b7fb01c16b2b724c/loader.py
for id in self.objectIds_d(spec): a((id, g(id)))
for id in self.objectIds_d(t): a((id, g(id)))
def objectItems_d(self,t=None): r=[] a=r.append g=self._getOb for id in self.objectIds_d(spec): a((id, g(id))) return r
93a818b0085d4492e10b80b869508b942fa5d974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93a818b0085d4492e10b80b869508b942fa5d974/ObjectManager.py
def translate(self, msgid, domain=None, mapping=None, default=None):
c9cb902dd9b080b4e522fcf14703f67f9b4dbd12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c9cb902dd9b080b4e522fcf14703f67f9b4dbd12/Engine.py
self.program = [os.path.join(self.directory, "bin", "runzope")]
if config.runner and config.runner.program: self.program = config.runner.program else: self.program = [os.path.join(self.directory, "bin", "runzope")]
def realize(self, *args, **kw): ZDOptions.realize(self, *args, **kw) config = self.configroot self.directory = config.instancehome self.clienthome = config.clienthome self.program = [os.path.join(self.directory, "bin", "runzope")] self.sockname = os.path.join(self.clienthome, "zopectlsock") self.user = None self.python = sys.executable self.zdrun = os.path.join(os.path.dirname(zdaemon.__file__), "zdrun.py") self.exitcodes = [0, 2] if self.logfile is None and config.eventlog is not None: for handler in config.eventlog.handler_factories: if isinstance(handler, FileHandlerFactory): self.logfile = handler.section.path if self.logfile not in ("STDERR", "STDOUT"): break
86db1df3ee44390ba5ad8a0cda58e06dfadcb367 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/86db1df3ee44390ba5ad8a0cda58e06dfadcb367/zopectl.py
'config.setConfiguration(opts.configroot); ' %
'config.setConfiguration(opts.configroot); ' 'from Zope.Startup import do_posix_stuff; ' 'do_posix_stuff(opts.configroot); '%
def get_startup_cmd(self, python, more): cmdline = ( '%s -c "from Zope.Startup.options import ZopeOptions; ' 'from Zope.Startup import handlers as h; ' 'from App import config; ' 'opts=ZopeOptions(); ' 'opts.configfile=\'%s\'; ' 'opts.realize(); ' 'h.handleConfig(opts.configroot,opts.confighandlers);' 'config.setConfiguration(opts.configroot); ' % (python, self.options.configfile) ) return cmdline + more + '\"'
86db1df3ee44390ba5ad8a0cda58e06dfadcb367 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/86db1df3ee44390ba5ad8a0cda58e06dfadcb367/zopectl.py
def do_debug( self, arg ):
def do_debug(self, arg):
def do_debug( self, arg ): cmdline = self.get_startup_cmd(self.options.python + ' -i', 'import Zope; app=Zope.app()') print ('Starting debugger (the name "app" is bound to the top-level ' 'Zope object)') os.system(cmdline)
86db1df3ee44390ba5ad8a0cda58e06dfadcb367 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/86db1df3ee44390ba5ad8a0cda58e06dfadcb367/zopectl.py
def do_run( self, arg ):
def do_run(self, arg): self.setuid()
def do_run( self, arg ): cmdline = self.get_startup_cmd(self.options.python, 'import Zope; app=Zope.app(); execfile(\'%s\')' % arg) os.system(cmdline)
86db1df3ee44390ba5ad8a0cda58e06dfadcb367 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/86db1df3ee44390ba5ad8a0cda58e06dfadcb367/zopectl.py
value=join(value, ' ')
value=join(str(value), ' ')
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': value=join(value, ' ') elif type=='lines': value=join(value, '\n') # check for xml property attrs=item.get('meta', {}).get('__xml_attrs__', None) if attrs is not None: attrs=map(lambda n: ' %s="%s"' % n, attrs.items()) attrs=join(attrs, '') else: # Quote non-xml items here? attrs=''
e0626a9b5080e9539c67ec324b9517d31a3f7d64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e0626a9b5080e9539c67ec324b9517d31a3f7d64/PropertySheets.py
value=join(value, '\n')
value=join(str(value), '\n')
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': value=join(value, ' ') elif type=='lines': value=join(value, '\n') # check for xml property attrs=item.get('meta', {}).get('__xml_attrs__', None) if attrs is not None: attrs=map(lambda n: ' %s="%s"' % n, attrs.items()) attrs=join(attrs, '') else: # Quote non-xml items here? attrs=''
e0626a9b5080e9539c67ec324b9517d31a3f7d64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e0626a9b5080e9539c67ec324b9517d31a3f7d64/PropertySheets.py
value=join(value, ' ')
value=join(str(value), ' ')
def dav__propstat(self, name, result, propstat=propstat, propdesc=propdesc, join=string.join): # DAV helper method - return a propstat element indicating # property name and value for the requested property. xml_id=self.xml_namespace() propdict=self._propdict() if not propdict.has_key(name): prop='<n:%s xmlns:n="%s"/>\n' % (name, xml_id) code='404 Not Found' if not result.has_key(code): result[code]=[prop] else: result[code].append(prop) return else: item=propdict[name] name, type=item['id'], item.get('type','string') value=self.getProperty(name) if type=='tokens': value=join(value, ' ') elif type=='lines': value=join(value, '\n') # allow for xml properties attrs=item.get('meta', {}).get('__xml_attrs__', None) if attrs is not None: attrs=map(lambda n: ' %s="%s"' % n, attrs.items()) attrs=join(attrs, '') else: # quote non-xml items here? attrs='' prop='<n:%s%s xmlns:n="%s">%s</n:%s>\n' % ( name, attrs, xml_id, value, name) code='200 OK' if not result.has_key(code): result[code]=[prop] else: result[code].append(prop) return
e0626a9b5080e9539c67ec324b9517d31a3f7d64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e0626a9b5080e9539c67ec324b9517d31a3f7d64/PropertySheets.py
value=join(value, '\n')
value=join(str(value), '\n')
def dav__propstat(self, name, result, propstat=propstat, propdesc=propdesc, join=string.join): # DAV helper method - return a propstat element indicating # property name and value for the requested property. xml_id=self.xml_namespace() propdict=self._propdict() if not propdict.has_key(name): prop='<n:%s xmlns:n="%s"/>\n' % (name, xml_id) code='404 Not Found' if not result.has_key(code): result[code]=[prop] else: result[code].append(prop) return else: item=propdict[name] name, type=item['id'], item.get('type','string') value=self.getProperty(name) if type=='tokens': value=join(value, ' ') elif type=='lines': value=join(value, '\n') # allow for xml properties attrs=item.get('meta', {}).get('__xml_attrs__', None) if attrs is not None: attrs=map(lambda n: ' %s="%s"' % n, attrs.items()) attrs=join(attrs, '') else: # quote non-xml items here? attrs='' prop='<n:%s%s xmlns:n="%s">%s</n:%s>\n' % ( name, attrs, xml_id, value, name) code='200 OK' if not result.has_key(code): result[code]=[prop] else: result[code].append(prop) return
e0626a9b5080e9539c67ec324b9517d31a3f7d64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e0626a9b5080e9539c67ec324b9517d31a3f7d64/PropertySheets.py
def db_name(self): return self._p_jar.db.file_name
def db_name(self): return Globals.Bobobase._jar.db.file_name
def db_name(self): return self._p_jar.db.file_name
78dc4b21fd04e2b8eae40d9ac1e9bc0446c5529f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/78dc4b21fd04e2b8eae40d9ac1e9bc0446c5529f/ApplicationManager.py
path=string.split(URL2, REQUEST.script)[1][1:]
path=urllib.unquote(string.split(URL2, REQUEST.script)[1])
def manage_catalogFoundItems(self, REQUEST, RESPONSE, URL2, URL1, obj_metatypes=None, obj_ids=None, obj_searchterm=None, obj_expr=None, obj_mtime=None, obj_mspec=None, obj_roles=None, obj_permission=None): """ Find object according to search criteria and Catalog them """
8021d730eff663bc83f3d8f05e93b5c4b7e2393a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8021d730eff663bc83f3d8f05e93b5c4b7e2393a/ZCatalog.py
_ABSOLUTE_URL=r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\ _ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\
_ABSOLUTE_URL=r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\ _ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\
def doc_strong(self, s, expr = re.compile(r'\*\*([%s%s%s\s]+?)\*\*' % (letters, digits, strongem_punc)).search #expr = re.compile(r'\s*\*\*([ \n\r%s0-9.:/;,\'\"\?\-\_\/\=\-\>\<\(\)]+)\*\*(?!\*|-)' % letters).search, # old expr, inconsistent punc, failed to cross newlines. ):
4a62dd59a56984b3c1d384e092efd6af766bb019 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4a62dd59a56984b3c1d384e092efd6af766bb019/DocumentClass.py
pass
zLOG.LOG('Z2', zLOG.WARNING, 'A handler for %s failed!' % signame, error=sys.exc_info())
def signalHandler(self, signum, frame): """Meta signal handler that dispatches to registered handlers.""" signame = zdaemon.Daemon.get_signal_name(signum) zLOG.LOG('Z2', zLOG.INFO , "Caught signal %s" % signame)
f9e60e566b86160f07feced7273ca05c1532eb2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f9e60e566b86160f07feced7273ca05c1532eb2d/SignalHandler.py
if hasattr(sys, '__lg') and hasattr(sys.__lg, 'reopen'): sys.__lg.reopen()
reopen = getattr(getattr(sys, '__lg', None), 'reopen', None) if reopen is not None: reopen()
def sigusr2Handler(self): """Reopen log files on SIGUSR2. This is registered first, so it should be called after all other SIGUSR2 handlers.""" zLOG.LOG('Z2', zLOG.INFO , "Reopening log files") if hasattr(sys, '__lg') and hasattr(sys.__lg, 'reopen'): sys.__lg.reopen() zLOG.LOG('Z2', zLOG.BLATHER, "Reopened access log") if (hasattr(sys, '__detailedlog') and hasattr(sys.__detailedlog, 'reopen')): zLOG.LOG('Z2', zLOG.BLATHER,"Reopened detailed request log") sys.__detailedlog.reopen() if hasattr(zLOG, '_set_stupid_dest'): zLOG._set_stupid_dest(None) else: zLOG._stupid_dest = None ZLogger.stupidFileLogger._stupid_dest = None zLOG.LOG('Z2', zLOG.BLATHER, "Reopened event log") zLOG.LOG('Z2', zLOG.INFO, "Log files reopened successfully")
f9e60e566b86160f07feced7273ca05c1532eb2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f9e60e566b86160f07feced7273ca05c1532eb2d/SignalHandler.py
if (hasattr(sys, '__detailedlog') and hasattr(sys.__detailedlog, 'reopen')):
reopen = getattr(getattr(sys, '__detailedlog', None), 'reopen', None) if reopen is not None: reopen()
def sigusr2Handler(self): """Reopen log files on SIGUSR2. This is registered first, so it should be called after all other SIGUSR2 handlers.""" zLOG.LOG('Z2', zLOG.INFO , "Reopening log files") if hasattr(sys, '__lg') and hasattr(sys.__lg, 'reopen'): sys.__lg.reopen() zLOG.LOG('Z2', zLOG.BLATHER, "Reopened access log") if (hasattr(sys, '__detailedlog') and hasattr(sys.__detailedlog, 'reopen')): zLOG.LOG('Z2', zLOG.BLATHER,"Reopened detailed request log") sys.__detailedlog.reopen() if hasattr(zLOG, '_set_stupid_dest'): zLOG._set_stupid_dest(None) else: zLOG._stupid_dest = None ZLogger.stupidFileLogger._stupid_dest = None zLOG.LOG('Z2', zLOG.BLATHER, "Reopened event log") zLOG.LOG('Z2', zLOG.INFO, "Log files reopened successfully")
f9e60e566b86160f07feced7273ca05c1532eb2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f9e60e566b86160f07feced7273ca05c1532eb2d/SignalHandler.py
sys.__detailedlog.reopen()
def sigusr2Handler(self): """Reopen log files on SIGUSR2. This is registered first, so it should be called after all other SIGUSR2 handlers.""" zLOG.LOG('Z2', zLOG.INFO , "Reopening log files") if hasattr(sys, '__lg') and hasattr(sys.__lg, 'reopen'): sys.__lg.reopen() zLOG.LOG('Z2', zLOG.BLATHER, "Reopened access log") if (hasattr(sys, '__detailedlog') and hasattr(sys.__detailedlog, 'reopen')): zLOG.LOG('Z2', zLOG.BLATHER,"Reopened detailed request log") sys.__detailedlog.reopen() if hasattr(zLOG, '_set_stupid_dest'): zLOG._set_stupid_dest(None) else: zLOG._stupid_dest = None ZLogger.stupidFileLogger._stupid_dest = None zLOG.LOG('Z2', zLOG.BLATHER, "Reopened event log") zLOG.LOG('Z2', zLOG.INFO, "Log files reopened successfully")
f9e60e566b86160f07feced7273ca05c1532eb2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f9e60e566b86160f07feced7273ca05c1532eb2d/SignalHandler.py
def sigusr2Handler(self): """Reopen log files on SIGUSR2. This is registered first, so it should be called after all other SIGUSR2 handlers.""" zLOG.LOG('Z2', zLOG.INFO , "Reopening log files") if hasattr(sys, '__lg') and hasattr(sys.__lg, 'reopen'): sys.__lg.reopen() zLOG.LOG('Z2', zLOG.BLATHER, "Reopened access log") if (hasattr(sys, '__detailedlog') and hasattr(sys.__detailedlog, 'reopen')): zLOG.LOG('Z2', zLOG.BLATHER,"Reopened detailed request log") sys.__detailedlog.reopen() if hasattr(zLOG, '_set_stupid_dest'): zLOG._set_stupid_dest(None) else: zLOG._stupid_dest = None ZLogger.stupidFileLogger._stupid_dest = None zLOG.LOG('Z2', zLOG.BLATHER, "Reopened event log") zLOG.LOG('Z2', zLOG.INFO, "Log files reopened successfully")
f9e60e566b86160f07feced7273ca05c1532eb2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f9e60e566b86160f07feced7273ca05c1532eb2d/SignalHandler.py
self.__name__, expr = name, expr
self.__name__, self.expr = name, expr
def __init__(self, blocks):
5c3c4eaaeffa7648256eadb9d9bb4df824adf09f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5c3c4eaaeffa7648256eadb9d9bb4df824adf09f/DT_In.py
'manage_addIndex', 'manage_delIndexs', 'manage_main',],
'manage_addIndex', 'manage_delIndexes', 'manage_main',],
def manage_addZCatalog(self,id,title,REQUEST=None): """Add a ZCatalog object """ c=ZCatalog(id,title) self._setObject(id,c) if REQUEST is not None: return self.manage_main(self,REQUEST)
3e74d5f046f7286ad0384f2f3d476cd46a7b79c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3e74d5f046f7286ad0384f2f3d476cd46a7b79c5/ZCatalog.py
self._properties=self._properties+({'id':id,'type':type},) self._setPropValue(id, value)
if type in ('selection', 'multiple selection'): if not hasattr(self, value): raise 'Bad Request', 'No select variable %s' % value self._properties=self._properties + ( {'id':id, 'type':type, 'select_variable':value},) self._setPropValue(id, '') else: self._properties=self._properties+({'id':id,'type':type},) self._setPropValue(id, value)
def _setProperty(self, id, value, type='string'): if not self.valid_property_id(id): raise 'Bad Request', 'Invalid or duplicate property id' self._properties=self._properties+({'id':id,'type':type},) self._setPropValue(id, value)
575dfc86674d60f1f3da98044700cb7988a714bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/575dfc86674d60f1f3da98044700cb7988a714bd/PropertyManager.py
"""Returns a NodeList that contains all children of this node. If there are no children, this is a empty NodeList"""
"""The first child of this node. If there is no such node this returns None."""
def getFirstChild(self): """Returns a NodeList that contains all children of this node. If there are no children, this is a empty NodeList""" return None
92d9f9e74555de20766dc34c52e48dbeb52376d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92d9f9e74555de20766dc34c52e48dbeb52376d2/ZDOM.py
"""The last child of this node. If ther is no such node
"""The last child of this node. If there is no such node
def getLastChild(self): """The last child of this node. If ther is no such node this returns None.""" return None
92d9f9e74555de20766dc34c52e48dbeb52376d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92d9f9e74555de20766dc34c52e48dbeb52376d2/ZDOM.py
"""Returns a NodeList that contains all children of this node. If there are no children, this is a empty NodeList"""
"""The first child of this node. If there is no such node this returns None"""
def getFirstChild(self): """Returns a NodeList that contains all children of this node. If there are no children, this is a empty NodeList""" children = self.getChildNodes() if children: return children._data[0] return None
92d9f9e74555de20766dc34c52e48dbeb52376d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92d9f9e74555de20766dc34c52e48dbeb52376d2/ZDOM.py
"""The last child of this node. If ther is no such node
"""The last child of this node. If there is no such node
def getLastChild(self): """The last child of this node. If ther is no such node this returns None.""" children = self.getChildNodes() if children: return children._data[-1] return None
92d9f9e74555de20766dc34c52e48dbeb52376d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92d9f9e74555de20766dc34c52e48dbeb52376d2/ZDOM.py
nodeList.append( child )
nodeList.append(child)
def getElementsByTagName(self, tagname): """ Returns a NodeList of all the Elements with a given tag name in the order in which they would be encountered in a preorder traversal of the Document tree. Parameter: tagname The name of the tag to match (* = all tags). Return Value: A new NodeList object containing all the matched Elements. """ nodeList = [] for child in self.objectValues(): if (child.getNodeType()==ELEMENT_NODE and \ child.getTagName()==tagname or tagname== '*'): nodeList.append( child ) n1 = child.getElementsByTagName(tagname) nodeList = nodeList + n1._data return NodeList(nodeList)
92d9f9e74555de20766dc34c52e48dbeb52376d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/92d9f9e74555de20766dc34c52e48dbeb52376d2/ZDOM.py
return sys.modules[__name__[:rfind(__name__,'.')]].__path__[0]
return sys.modules[__name__].__path__[0]
def package_home(globals_dict):
61908bec20512309c26b9021844881d1c6f9a64a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/61908bec20512309c26b9021844881d1c6f9a64a/Globals.py
# def response(anHTTPResponse):
452178ae8c844705eb35e50ada1675e27d991612 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/452178ae8c844705eb35e50ada1675e27d991612/xmlrpc.py
def exception(self, fatal=0, info=None, absuri_match=None, tag_search=None): # Fetch our exception info. t is type, v is value and tb is the # traceback object. if type(info) is type(()) and len(info)==3: t,v,tb = info else: t,v,tb = sys.exc_info()
452178ae8c844705eb35e50ada1675e27d991612 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/452178ae8c844705eb35e50ada1675e27d991612/xmlrpc.py
f=Fault(-1, "Unexpected Zope exception: " + str(v))
f=Fault(-1, 'Unexpected Zope exception: %s' % value)
def exception(self, fatal=0, info=None, absuri_match=None, tag_search=None): # Fetch our exception info. t is type, v is value and tb is the # traceback object. if type(info) is type(()) and len(info)==3: t,v,tb = info else: t,v,tb = sys.exc_info()
452178ae8c844705eb35e50ada1675e27d991612 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/452178ae8c844705eb35e50ada1675e27d991612/xmlrpc.py
f=Fault(-2, "Unexpected Zope error value: " + str(v))
f=Fault(-2, 'Unexpected Zope error value: %s' % value)
def exception(self, fatal=0, info=None, absuri_match=None, tag_search=None): # Fetch our exception info. t is type, v is value and tb is the # traceback object. if type(info) is type(()) and len(info)==3: t,v,tb = info else: t,v,tb = sys.exc_info()
452178ae8c844705eb35e50ada1675e27d991612 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/452178ae8c844705eb35e50ada1675e27d991612/xmlrpc.py
<TABLE BORDER="0" WIDTH="100%"> <TR VALIGN="TOP"> <TD WIDTH="10%" ALIGN="CENTER">
<table border="0" width="100%"> <tr valign="top"> <td width="10%" align="center">
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
929a4dc23f3500225553752577d184e8b0dfb13c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/929a4dc23f3500225553752577d184e8b0dfb13c/HTTPResponse.py
</TD> <TD WIDTH="90%"> <H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P>""" + \
</td> <td width="90%"> <h2>Site Error</h2> <p>An error was encountered while publishing this resource. </p>""" + \
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
929a4dc23f3500225553752577d184e8b0dfb13c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/929a4dc23f3500225553752577d184e8b0dfb13c/HTTPResponse.py
<P><STRONG>%s</STRONG></P>
<p><strong>%s</strong></p>
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
929a4dc23f3500225553752577d184e8b0dfb13c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/929a4dc23f3500225553752577d184e8b0dfb13c/HTTPResponse.py
<HR NOSHADE> <P>Troubleshooting Suggestions</P> <UL> <LI>The URL may be incorrect.</LI> <LI>The parameters passed to this resource may be incorrect.</LI> <LI>A resource that this resource relies on may be encountering an error.</LI> </UL> <P>For more detailed information about the error, please
<hr noshade="noshade"/> <p>Troubleshooting Suggestions</p> <ul> <li>The URL may be incorrect.</li> <li>The parameters passed to this resource may be incorrect.</li> <li>A resource that this resource relies on may be encountering an error.</li> </ul> <p>For more detailed information about the error, please
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
929a4dc23f3500225553752577d184e8b0dfb13c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/929a4dc23f3500225553752577d184e8b0dfb13c/HTTPResponse.py
</P> <P>If the error persists please contact the site maintainer.
</p> <p>If the error persists please contact the site maintainer.
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
929a4dc23f3500225553752577d184e8b0dfb13c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/929a4dc23f3500225553752577d184e8b0dfb13c/HTTPResponse.py
</P> </TD></TR> </TABLE>""")
</p> </td></tr> </table>""")
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
929a4dc23f3500225553752577d184e8b0dfb13c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/929a4dc23f3500225553752577d184e8b0dfb13c/HTTPResponse.py
<<<<<<< ZCatalog.py
def manage_addZCatalog(self, id, title, vocab_id=None, REQUEST=None): """Add a ZCatalog object """ id=str(id) title=str(title) vocab_id=str(vocab_id) if vocab_id == 'create_default_catalog_': vocab_id = None c=ZCatalog(id, title, vocab_id, self) self._setObject(id, c) if REQUEST is not None: return self.manage_main(self, REQUEST)
c44e4f77fbd66350b9ea00d838a7f5bc01e09086 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c44e4f77fbd66350b9ea00d838a7f5bc01e09086/ZCatalog.py
)+Folder.manage_options ======= 'help':('ZCatalog','ZCatalog_Status.dtml')},
def manage_addZCatalog(self, id, title, vocab_id=None, REQUEST=None): """Add a ZCatalog object """ id=str(id) title=str(title) vocab_id=str(vocab_id) if vocab_id == 'create_default_catalog_': vocab_id = None c=ZCatalog(id, title, vocab_id, self) self._setObject(id, c) if REQUEST is not None: return self.manage_main(self, REQUEST)
c44e4f77fbd66350b9ea00d838a7f5bc01e09086 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c44e4f77fbd66350b9ea00d838a7f5bc01e09086/ZCatalog.py
>>>>>>> 1.60
def manage_addZCatalog(self, id, title, vocab_id=None, REQUEST=None): """Add a ZCatalog object """ id=str(id) title=str(title) vocab_id=str(vocab_id) if vocab_id == 'create_default_catalog_': vocab_id = None c=ZCatalog(id, title, vocab_id, self) self._setObject(id, c) if REQUEST is not None: return self.manage_main(self, REQUEST)
c44e4f77fbd66350b9ea00d838a7f5bc01e09086 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c44e4f77fbd66350b9ea00d838a7f5bc01e09086/ZCatalog.py
return self.manage_CacheParameters(self,REQUEST)
return self.manage_cacheParameters(self,REQUEST)
def manage_cache_size(self,value,REQUEST):
ee1ee3a587ba9a00441cbd069ac4c32938cc5334 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ee1ee3a587ba9a00441cbd069ac4c32938cc5334/CacheManager.py
for id in self._objects:
def tpValues(self): # Return a list of subobjects, used by tree tag. r=[] if hasattr(aq_base(self), 'tree_ids'): tree_ids=self.tree_ids try: tree_ids=list(tree_ids) except TypeError: pass if hasattr(tree_ids, 'sort'): tree_ids.sort() for id in tree_ids: if hasattr(self, id): r.append(self._getOb(id)) else: obj_ids=self.objectIds() obj_ids.sort() for id in obj_ids: for id in self._objects: o=self._getOb(id) if hasattr(o, 'isPrincipiaFolderish') and \ o.isPrincipiaFolderish: r.append(o) return r
5614d6611b949cd9234b8bbc85ac456729fb17ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5614d6611b949cd9234b8bbc85ac456729fb17ac/ObjectManager.py
not (d['product']==product and d['id']==id),
not (d['product'] in (product, 'methods') and d['id']==id),
def _manage_remove_product_data(self, type, product, id): values=filter( lambda d, product=product, id=id: not (d['product']==product and d['id']==id), self.aq_maybe('_getProductRegistryData')(type) )
d76c4ded7bb0d59c5b25ec6d1bd3050da7504737 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d76c4ded7bb0d59c5b25ec6d1bd3050da7504737/ProductRegistry.py
if size < n: read(size), size
if size < n: return read(size), size
def _read_data(self, file): n=1<<16 if type(file) is type(''): size=len(file) if size < n: return file, size return Pdata(file), size seek=file.seek read=file.read seek(0,2) size=end=file.tell() jar=self._p_jar if size <= 2*n or jar is None or Globals.DatabaseVersion=='2': seek(0) if size < n: read(size), size return Pdata(read(size)), size
2cc462e7dd40587e6f03cc1c173f7526e12fca2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2cc462e7dd40587e6f03cc1c173f7526e12fca2a/Image.py
if product is not None: self.__of__(product)._register()
def __init__(self, id, title, object_type, initial, product=None): self.id=id self.title=title self.object_type=object_type self.initial=initial if product is not None: self.__of__(product)._register()
53621b5296c7b1d8bf8bfb9857eee01df2f9794e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/53621b5296c7b1d8bf8bfb9857eee01df2f9794e/Factory.py
if getattr(container, '__class__', None) is Product.Product:
if (item is self or getattr(container, '__class__', None) is Product.Product):
def manage_afterAdd(self, item, container): if hasattr(self, 'aq_parent'): container=self.aq_parent elif item is not self: container=None
53621b5296c7b1d8bf8bfb9857eee01df2f9794e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/53621b5296c7b1d8bf8bfb9857eee01df2f9794e/Factory.py
if getattr(container, '__class__', None) is Product.Product:
if (item is self or getattr(container, '__class__', None) is Product.Product):
def manage_beforeDelete(self, item, container): if hasattr(self, 'aq_parent'): container=self.aq_parent elif item is not self: container=None
53621b5296c7b1d8bf8bfb9857eee01df2f9794e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/53621b5296c7b1d8bf8bfb9857eee01df2f9794e/Factory.py
sequence=self.sort_sequence(sequence)
sequence=self.sort_sequence(sequence, md)
def renderwb(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
sequence=self.sort_sequence(sequence)
sequence=self.sort_sequence(sequence, md)
def renderwb(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
sequence=self.sort_sequence(sequence)
sequence=self.sort_sequence(sequence, md)
def renderwob(self, md): """RENDER WithOutBatch""" expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
sequence=self.sort_sequence(sequence)
sequence=self.sort_sequence(sequence, md)
def renderwob(self, md): """RENDER WithOutBatch""" expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
def sort_sequence(self, sequence):
def sort_sequence(self, sequence, md):
def sort_sequence(self, sequence):
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
def sort_sequence(self, sequence):
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
sortfields = split(sort,',')
need_sortfunc = find(sort, '/') >= 0 sortfields = split(sort, ',')
def sort_sequence(self, sequence):
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
s.sort()
if need_sortfunc: by = SortBy(multsort, sf_list) s.sort(by) else: s.sort()
def sort_sequence(self, sequence):
4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4130f24e84d206ff8a7374ba5be0fbdfb1f02c2f/DT_In.py
default_license=0
default_license=30
def lic_check(product_name): default_license=0 path_join =os.path.join product_dir=path_join(SOFTWARE_HOME,'lib/python/Products') package_dir=path_join(product_dir, product_name) bobobase =Globals.Bobobase try: f=open(path_join(package_dir,'%s.lic' % product_name), 'rb') except: f, val = None, default_license if f is not None: dat=lcd(f.read()) f.close() if dat is None: name, val = '', default_license else: [name, val]=dat[:2] if name != product_name: val=default_license elif val is None: return 1 if not bobobase.has_key('_t_'): t=bobobase['_t_']={} else: t=bobobase['_t_'] if not t.has_key(product_name): t[product_name]=time.time() bobobase['_t_']=t if (t[product_name] + (86400.0 * val)) <= time.time(): # License has expired! product=getattr(__import__("Products.%s" % product_name), product_name) for s in pgetattr(product, 'classes', ()): p=rfind(s,'.') m='Products.%s.%s' % (product_name, s[:p]) c=s[p+1:] try: __import__(m) except: m=s[:p] __import__(m) setattr(sys.modules[m], c, Expired) return 0 return 1
eb5f265a38bdc6d04bd2b2bb6f253e2a33bfb877 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eb5f265a38bdc6d04bd2b2bb6f253e2a33bfb877/Application.py
def first(self,name):
def first(self,name,key=''):
def first(self,name):
bd67a3af4e80f136320ea4de0f8e801f16782160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd67a3af4e80f136320ea4de0f8e801f16782160/DT_InSV.py
def last(self,name):
def last(self,name,key=''):
def last(self,name):
bd67a3af4e80f136320ea4de0f8e801f16782160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd67a3af4e80f136320ea4de0f8e801f16782160/DT_InSV.py
def statistics(self,name):
def statistics(self,name,key):
def statistics(self,name):
bd67a3af4e80f136320ea4de0f8e801f16782160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd67a3af4e80f136320ea4de0f8e801f16782160/DT_InSV.py
def next_batches(self, suffix='batches'): if suffix != 'batches': raise KeyError, 'next-batches'
return data[key] def next_batches(self, suffix='batches',key=''): if suffix != 'batches': raise KeyError, key
def statistics(self,name):
bd67a3af4e80f136320ea4de0f8e801f16782160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd67a3af4e80f136320ea4de0f8e801f16782160/DT_InSV.py
def previous_batches(self, suffix='batches'): if suffix != 'batches': raise KeyError, 'previous-batches'
def previous_batches(self, suffix='batches',key=''): if suffix != 'batches': raise KeyError, key
def previous_batches(self, suffix='batches'):
bd67a3af4e80f136320ea4de0f8e801f16782160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd67a3af4e80f136320ea4de0f8e801f16782160/DT_InSV.py
'sequence-index': lambda self, suffix: self['sequence-'+suffix], 'sequence-index-is': lambda self, suffix: self['sequence-'+suffix],
'sequence-index': lambda self, suffix, key: self['sequence-'+suffix], 'sequence-index-is': lambda self, suffix, key: self['sequence-'+suffix],
def previous_batches(self, suffix='batches'):
bd67a3af4e80f136320ea4de0f8e801f16782160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd67a3af4e80f136320ea4de0f8e801f16782160/DT_InSV.py
return special_prefixes[prefix](self, suffix)
return special_prefixes[prefix](self, suffix, key)
def __getitem__(self,key, special_prefixes=special_prefixes, special_prefix=special_prefixes.has_key ): data=self.data if data.has_key(key): return data[key]
bd67a3af4e80f136320ea4de0f8e801f16782160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bd67a3af4e80f136320ea4de0f8e801f16782160/DT_InSV.py
headers, html = ts_reulsts[1]
headers, html = ts_results[1]
def decapitate(html, RESPONSE=None, header_re=ts_regex.compile( '\(\(' '[^\0- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=ts_regex.compile('\([ \t]+\)'), name_re=ts_regex.compile('\([^\0- <>:]+\):\([^\n]*\)'), ): ts_results = header_re.match_group(html, (1,3)) if not ts_results: return html headers, html = ts_reulsts[1] headers=string.split(headers,'\n') i=1 while i < len(headers): if not headers[i]: del headers[i] else: ts_results = space_re.match_group(headers[i], (1,)) if ts_reults: headers[i-1]="%s %s" % (headers[i-1], headers[i][len(ts_reults[1]):]) del headers[i] else: i=i+1 for i in range(len(headers)): ts_results = name_re.match_group(headers[i], (1,2)) if ts_reults: k, v = ts_reults[1] v=string.strip(v) else: raise ValueError, 'Invalid Header (%d): %s ' % (i,headers[i]) RESPONSE.setHeader(k,v) return html
6734e949af702940e30b9ede2d9167ca58950b3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6734e949af702940e30b9ede2d9167ca58950b3a/Aqueduct.py
if ts_reults:
if ts_results:
def decapitate(html, RESPONSE=None, header_re=ts_regex.compile( '\(\(' '[^\0- <>:]+:[^\n]*\n' '\|' '[ \t]+[^\0- ][^\n]*\n' '\)+\)[ \t]*\n\([\0-\377]+\)' ), space_re=ts_regex.compile('\([ \t]+\)'), name_re=ts_regex.compile('\([^\0- <>:]+\):\([^\n]*\)'), ): ts_results = header_re.match_group(html, (1,3)) if not ts_results: return html headers, html = ts_reulsts[1] headers=string.split(headers,'\n') i=1 while i < len(headers): if not headers[i]: del headers[i] else: ts_results = space_re.match_group(headers[i], (1,)) if ts_reults: headers[i-1]="%s %s" % (headers[i-1], headers[i][len(ts_reults[1]):]) del headers[i] else: i=i+1 for i in range(len(headers)): ts_results = name_re.match_group(headers[i], (1,2)) if ts_reults: k, v = ts_reults[1] v=string.strip(v) else: raise ValueError, 'Invalid Header (%d): %s ' % (i,headers[i]) RESPONSE.setHeader(k,v) return html
6734e949af702940e30b9ede2d9167ca58950b3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6734e949af702940e30b9ede2d9167ca58950b3a/Aqueduct.py
r=str(inst)
r=str(inst)
def __getitem__(self,key):
33f60964c7587575f853594704f00add969b7126 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/33f60964c7587575f853594704f00add969b7126/pDocumentTemplate.py