rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for info in db.transaction_info(first_transaction, last_transaction, path):
try: trans_info=db.transaction_info(first_transaction, last_transaction,path) except: trans_info=[] for info in trans_info:
def undoable_transactions(self, AUTHENTICATION_PATH=None, first_transaction=None, last_transaction=None):
10c95267ea60cb45fa269034349f21bef3affcb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/10c95267ea60cb45fa269034349f21bef3affcb8/Undo.py
return r
return r or []
def undoable_transactions(self, AUTHENTICATION_PATH=None, first_transaction=None, last_transaction=None):
10c95267ea60cb45fa269034349f21bef3affcb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/10c95267ea60cb45fa269034349f21bef3affcb8/Undo.py
if defineMacro: self.pushProgram() self.emit("version", TAL_VERSION) self.emit("mode", self.xml and "xml" or "html") todo["defineMacro"] = defineMacro if useMacro: self.pushSlots() self.pushProgram() todo["useMacro"] = useMacro if fillSlot: self.pushProgram() todo["fillSlot"] = fillSlot if defineSlot: self.pushProgram() todo["defineSlot"] = defineSlot
if self.inMacroUse: if fillSlot: self.pushProgram() todo["fillSlot"] = fillSlot self.inMacroUse = 0 else: if fillSlot: raise METALError, ("fill-slot must be within a use-macro", position) if not self.inMacroUse: if defineMacro: self.pushProgram() self.emit("version", TAL_VERSION) self.emit("mode", self.xml and "xml" or "html") todo["defineMacro"] = defineMacro self.inMacroDef = self.inMacroDef + 1 if useMacro: self.pushSlots() self.pushProgram() todo["useMacro"] = useMacro self.inMacroUse = 1 if defineSlot: if not self.inMacroDef: raise METALError, ( "define-slot must be within a define-macro", position) self.pushProgram() todo["defineSlot"] = defineSlot
def emitStartElement(self, name, attrlist, taldict, metaldict, position=(None, None), isend=0): if not taldict and not metaldict: # Handle the simple, common case self.emitStartTag(name, attrlist, isend) self.todoPush({}) if isend: self.emitEndElement(name, isend) return
113b82e2a8d18d92cff675a824f8651f6cef4dba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/113b82e2a8d18d92cff675a824f8651f6cef4dba/TALGenerator.py
self.emitStartTag(name, attrlist)
self.emitStartTag(name, list(attrlist))
def emitStartElement(self, name, attrlist, taldict, metaldict, position=(None, None), isend=0): if not taldict and not metaldict: # Handle the simple, common case self.emitStartTag(name, attrlist, isend) self.todoPush({}) if isend: self.emitEndElement(name, isend) return
113b82e2a8d18d92cff675a824f8651f6cef4dba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/113b82e2a8d18d92cff675a824f8651f6cef4dba/TALGenerator.py
if not url:
if not url or not self.checkInstallation(REQUEST): REQUEST.set('hide_next', 0)
def tutorialShowLesson(self, id, REQUEST): """ Navigate management frame to a given lesson's screen. """ url=self.lessonURL(id, REQUEST) if not url: return """\
b8659956296c12ed66e02ff66e20c6c4d6f9b792 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8659956296c12ed66e02ff66e20c6c4d6f9b792/TutorialTopic.py
if k is None or k == MV: return 0
def index_object(self, i, obj, threshold=None): """ index and object 'obj' with integer id 'i'""" index = self._index unindex = self._unindex
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
if set is None:
if set is None:
def index_object(self, i, obj, threshold=None): """ index and object 'obj' with integer id 'i'""" index = self._index unindex = self._unindex
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
def index_object(self, i, obj, threshold=None): """ index and object 'obj' with integer id 'i'""" index = self._index unindex = self._unindex
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
pdb.set_trace()
def _apply_index(self, request, cid=''): """Apply the index to query parameters given in the argument, request
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
if hi: setlist = index.items(lo,hi) else: setlist = index.items(lo) for k,set in setlist: if r is None: r = set else: r = r.union(set) except KeyError: pass
if hi: setlist = index.items(lo,hi) else: setlist = index.items(lo) for k, set in setlist: print 'adding set %s to %s' % (tuple(set), id) if r is None: r = set else: r = r.union(set) except KeyError: pass
def _apply_index(self, request, cid=''): """Apply the index to query parameters given in the argument, request
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
if key: anyTrue = 1
if key: anyTrue = 1
def _apply_index(self, request, cid=''): """Apply the index to query parameters given in the argument, request
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
if r is None: r = set else: r = r.union(set)
if r is None: r = set else: r = r.union(set)
def _apply_index(self, request, cid=''): """Apply the index to query parameters given in the argument, request
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
if anyTrue: r=intSet() else: return None
if anyTrue: r=intSet() else: return None print 'UnIndex says there are %s records' % len(r)
def _apply_index(self, request, cid=''): """Apply the index to query parameters given in the argument, request
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
id='copy%s_of_%s' % (n and n+1 or '', id)
id='copy%s_of_%s' % (n and n+1 or '', orig_id)
def _get_id(ob, id): try: ob=ob.aq_base except: pass n=0 if (len(id) > 8) and (id[8:]=='copy_of_'): n=1 while (hasattr(ob, id)): id='copy%s_of_%s' % (n and n+1 or '', id) n=n+1 return id
870f9cf416f680ffce5e88b0e10a042273301d14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/870f9cf416f680ffce5e88b0e10a042273301d14/CopySupport.py
if __debug__:
if Z_DEBUG_MODE:
def pt_render(self, source=0, extra_context={}): """Render this Page Template""" if self._v_errors: raise RuntimeError, 'Page Template %s has errors.' % self.id output = StringIO() c = self.pt_getContext() c.update(extra_context) if __debug__: __traceback_info__ = pprint.pformat(c)
8661868ca26b8c99bd5bba75b7180634f5a51233 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8661868ca26b8c99bd5bba75b7180634f5a51233/PageTemplate.py
def manage_move_objects_up(self, REQUEST, ids=None, delta=None):
def manage_move_objects_up(self, REQUEST, ids=None, delta=1):
def manage_move_objects_up(self, REQUEST, ids=None, delta=None): """ Move specified sub-objects up by delta in container. """ if ids: try: attempt = self.moveObjectsUp(ids, delta) message = '%d item%s moved up.' % ( attempt, ( (attempt!=1) and 's' or '' ) ) except ValueError, errmsg: message = 'Error: %s' % (errmsg) else: message = 'Error: No items were specified!' return self.manage_main(self, REQUEST, skey='position', manage_tabs_message=message)
860436c3039baff6e86aa780feab89ebd2b2a9f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/860436c3039baff6e86aa780feab89ebd2b2a9f8/OrderSupport.py
def manage_move_objects_down(self, REQUEST, ids=None, delta=None):
def manage_move_objects_down(self, REQUEST, ids=None, delta=1):
def manage_move_objects_down(self, REQUEST, ids=None, delta=None): """ Move specified sub-objects down by delta in container. """ if ids: try: attempt = self.moveObjectsDown(ids, delta) message = '%d item%s moved down.' % ( attempt, ( (attempt!=1) and 's' or '' ) ) except ValueError, errmsg: message = 'Error: %s' % (errmsg) else: message = 'Error: No items were specified!' return self.manage_main(self, REQUEST, skey='position', manage_tabs_message=message)
860436c3039baff6e86aa780feab89ebd2b2a9f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/860436c3039baff6e86aa780feab89ebd2b2a9f8/OrderSupport.py
try: sm= response.setMessage except: sm= None
sm = None if response is not None: sm = getattr(response, "setMessage", None)
def publish(request, module_name, after_list, debug=0, # Optimize: call_object=call_object, missing_name=missing_name, dont_publish_class=dont_publish_class, mapply=mapply, ): (bobo_before, bobo_after, object, realm, debug_mode, err_hook, validated_hook, transactions_manager)= get_module_info(module_name) parents=None try: request.processInputs() request_get=request.get response=request.response # First check for "cancel" redirect: cancel='' if request_get('SUBMIT','').strip().lower()=='cancel': cancel=request_get('CANCEL_ACTION','') if cancel: raise 'Redirect', cancel after_list[0]=bobo_after if debug_mode: response.debug_mode=debug_mode if realm and not request.get('REMOTE_USER',None): response.realm=realm if bobo_before is not None: bobo_before() # Get a nice clean path list: path=request_get('PATH_INFO').strip() request['PARENTS']=parents=[object] if transactions_manager: transactions_manager.begin() object=request.traverse(path, validated_hook=validated_hook) if transactions_manager: transactions_manager.recordMetaData(object, request) result=mapply(object, request.args, request, call_object,1, missing_name, dont_publish_class, request, bind=1) if result is not response: response.setBody(result) if transactions_manager: transactions_manager.commit() return response except: if transactions_manager: transactions_manager.abort() # DM: provide nicer error message for FTP try: sm= response.setMessage except: sm= None if sm is not None: from ZServer.medusa.asyncore import compact_traceback cl,val= sys.exc_info()[:2] sm('%s: %s %s' % (getattr(cl,'__name__',cl), val, debug_mode and compact_traceback()[-1] or '')) if err_hook is not None: if parents: parents=parents[0] try: return err_hook(parents, request, sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2], ) except Retry: # We need to try again.... if not request.supports_retry(): return err_hook(parents, request, sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2], ) newrequest=request.retry() request.close() # Free resources held by the request. try: return publish(newrequest, module_name, after_list, debug) finally: newrequest.close() else: raise
5aa6b549734369a39ecb78ec3453bb19d5e48aad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5aa6b549734369a39ecb78ec3453bb19d5e48aad/Publish.py
object = object + 1
object += 1
def __iadd__(self, other): return self.__class__(self.value + other)
f7b9f3b22ddefe5f21dcff892d110600399d2d3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f7b9f3b22ddefe5f21dcff892d110600399d2d3b/testExtensionClass.py
object = object + 1
object += 1
def __iadd__(self, other): return self.__class__(self.value + other)
f7b9f3b22ddefe5f21dcff892d110600399d2d3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f7b9f3b22ddefe5f21dcff892d110600399d2d3b/testExtensionClass.py
r"\s*(?:(global|local)\s+)?(%s)\s+(.*)" % NAME_RE, part)
r"(?s)\s*(?:(global|local)\s+)?(%s)\s+(.*)\Z" % NAME_RE, part)
def emitDefines(self, defines, position): for part in splitParts(defines): m = re.match( r"\s*(?:(global|local)\s+)?(%s)\s+(.*)" % NAME_RE, part) if not m: raise TALError("invalid define syntax: " + `part`, position) scope, name, expr = m.group(1, 2, 3) scope = scope or "local" cexpr = self.compileExpression(expr) if scope == "local": self.emit("setLocal", name, cexpr) else: self.emit("setGlobal", name, cexpr)
32ec6e8b6ad0137829e1048e4eb5bd754c010480 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/32ec6e8b6ad0137829e1048e4eb5bd754c010480/TALGenerator.py
m = re.match("\s*(%s)\s+(.*)" % NAME_RE, arg)
m = re.match("(?s)\s*(%s)\s+(.*)\Z" % NAME_RE, arg)
def emitRepeat(self, arg): m = re.match("\s*(%s)\s+(.*)" % NAME_RE, arg) if not m: raise TALError("invalid repeat syntax: " + `repeat`) name, expr = m.group(1, 2) cexpr = self.compileExpression(expr) program = self.popProgram() self.emit("loop", name, cexpr, program)
32ec6e8b6ad0137829e1048e4eb5bd754c010480 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/32ec6e8b6ad0137829e1048e4eb5bd754c010480/TALGenerator.py
refer to the HTML source for this page.
refer to error log.
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
8f3979d954cddd75df5031bb5e26e6a6a457b169 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f3979d954cddd75df5031bb5e26e6a6a457b169/HTTPResponse.py
p = aq_parent(aq_inner(self)
p = aq_parent(aq_inner(self))
def getPhysicalPath(self): '''Returns a path (an immutable sequence of strings) that can be used to access this object again later, for example in a copy/paste operation. getPhysicalRoot() and getPhysicalPath() are designed to operate together. ''' path = (self.getId(),) p = aq_parent(aq_inner(self) if p is not None: path = p.getPhysicalPath() + path
cddf8940df827d49b0051e763d8ab6233ee1206e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cddf8940df827d49b0051e763d8ab6233ee1206e/Traversable.py
address 18092
address 18092
def testSetupServersWithConflict(self): conf = self.load_config_text(""" <http-server> address 18092 </http-server> <ftp-server> address 18092 # conflict </ftp-server>""") starter = ZopeStarter(conf) # do the job the 'handler' would have done (call prepare) for server in conf.servers: server.prepare('', None, 'Zope', {}, None) try: self.assertRaises(ZConfig.ConfigurationError, starter.setupServers) finally: del conf.servers
fbe26e69c69c6f85ce81b1376f03e0401e809d3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fbe26e69c69c6f85ce81b1376f03e0401e809d3e/testStarter.py
try: mtime=os.stat(self.filename)[8] except: mtime=0 if hasattr(self, '_v_program') and mtime == self._v_last_read:
try: mtime = os.path.getmtime(self.filename) except OSError: mtime = 0 if self._v_program is not None and mtime == self._v_last_read:
def _cook_check(self): if self._v_last_read and not DevelopmentMode: return __traceback_info__ = self.filename try: mtime=os.stat(self.filename)[8] except: mtime=0 if hasattr(self, '_v_program') and mtime == self._v_last_read: return self.pt_edit(open(self.filename), None) self._cook() if self._v_errors: LOG('PageTemplateFile', ERROR, 'Error in template', '\n'.join(self._v_errors)) return self._v_last_read = mtime
54e270fb4dc84c49fa824247d8953bb0fa4c47a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/54e270fb4dc84c49fa824247d8953bb0fa4c47a9/PageTemplateFile.py
try: db=self._jar.db()
try: db=self._p_jar.db()
def __bobo_traverse__(self, REQUEST, name): if name[-9:]=='__draft__': return getattr(self, name)
cf3c265aff25100bf9c83bace0cb95b70b951c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cf3c265aff25100bf9c83bace0cb95b70b951c95/Draft.py
try: db=self._jar.db()
try: db=self._p_jar.db()
def nonempty(self): try: db=self._jar.db() except: # BoboPOS 2 return Globals.VersionBase[self._version].nonempty() else: # ZODB 3 return not db.versionEmpty(self._version)
cf3c265aff25100bf9c83bace0cb95b70b951c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cf3c265aff25100bf9c83bace0cb95b70b951c95/Draft.py
try: db=self._jar.db()
try: db=self._p_jar.db()
def manage_Save__draft__(self, remark, REQUEST=None): """Make version changes permanent""" try: db=self._jar.db() except: # BoboPOS 2 Globals.VersionBase[self._version].commit(remark) else: # ZODB 3 s=self._version d=self._p_jar.getVersion() if d==s: d='' db.commitVersion(s, d) if REQUEST: REQUEST['RESPONSE'].redirect(REQUEST['URL2']+'/manage_main')
cf3c265aff25100bf9c83bace0cb95b70b951c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cf3c265aff25100bf9c83bace0cb95b70b951c95/Draft.py
try: db=self._jar.db()
try: db=self._p_jar.db()
def manage_Discard__draft__(self, REQUEST=None): 'Discard changes made during the version' try: db=self._jar.db() except: # BoboPOS 2 Globals.VersionBase[self._version].abort() else: # ZODB 3 db.abortVersion(self._version)
cf3c265aff25100bf9c83bace0cb95b70b951c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cf3c265aff25100bf9c83bace0cb95b70b951c95/Draft.py
if security.validate(accessed, container, name, value, roles): return 1
if roles is _noroles: if security.validate(accessed, container, name, value): return 1 else: if security.validate(accessed, container, name, value, roles): return 1
def authorize(self, user, accessed, container, name, value, roles): user = getattr(user, 'aq_base', user).__of__(self) newSecurityManager(None, user) security = getSecurityManager() try: try: if security.validate(accessed, container, name, value, roles): return 1 except: noSecurityManager() raise except Unauthorized: pass return 0
a69225a65d6ff2e1c765c71c5b3601b096ded90e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a69225a65d6ff2e1c765c71c5b3601b096ded90e/User.py
In all cases, invalid date, time, or timezone components will raise a DateTimeError.
If a string argument passed to the DateTime constructor cannot be parsed, it will raise DateTime.SyntaxError. Invalid date, time, or timezone components will raise a DateTime.DateTimeError.
def __init__(self,*args): """Return a new date-time object
7a4df51020cf87198fa4097d97d2af8ce52f1f3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7a4df51020cf87198fa4097d97d2af8ce52f1f3e/DateTime.py
attempts = attempts + 1
attempts = attempts - 1
def forkit(attempts = FORK_ATTEMPTS): while attempts: # if at first you don't succeed... attempts = attempts + 1 try: pid = os.fork() except os.error: pstamp('Houston, the fork failed') time.sleep(2) else: pstamp('Houston, we have forked') return pid
421e5a749fdb0e3ad5ae33045a0976a1e8b1deeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/421e5a749fdb0e3ad5ae33045a0976a1e8b1deeb/zdeamon.py
def get(self, key, default):
def get(self, key, default=None):
def get(self, key, default): """Get a variable value
72c3097793d750862c7f006cae342ab68ba30306 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/72c3097793d750862c7f006cae342ab68ba30306/BaseRequest.py
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
signal.signal(signal.SIGCHLD, _ignoreSIGCHLD)
def main(args=None): # This is exactly like zdctl.main(), but uses ZopeCtlOptions and # ZopeCmd instead of ZDCtlOptions and ZDCmd, so the default values # are handled properly for Zope. options = ZopeCtlOptions() options.realize(args) c = ZopeCmd(options) if options.args: c.onecmd(" ".join(options.args)) else: options.interactive = 1 if options.interactive: try: import readline except ImportError: pass print "program:", " ".join(options.program) c.do_status() c.cmdloop()
1c75ebfca8e697c69a5695ecfd537aad446e66e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1c75ebfca8e697c69a5695ecfd537aad446e66e5/zopectl.py
"""Less silly interface to find_source""" return find_source(func.func_globals['__file__'], func.func_code)[1]
"""Less silly interface to find_source""" file = func.func_globals['__file__'] if file.endswith('.pyc'): file = file[:-1] source = find_source(file, func.func_code)[1] assert source.strip(), "Source should not be empty!" return source
def get_source(func): """Less silly interface to find_source""" # Sheesh return find_source(func.func_globals['__file__'], func.func_code)[1]
b2ce85ffe09a48858cfc642fcb209fb9fbcc3089 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b2ce85ffe09a48858cfc642fcb209fb9fbcc3089/testRestrictions.py
from RestrictedPython.tests import before_and_after
def checkBeforeAndAfter(self): from RestrictedPython.RCompile import RModule
b2ce85ffe09a48858cfc642fcb209fb9fbcc3089 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b2ce85ffe09a48858cfc642fcb209fb9fbcc3089/testRestrictions.py
globals = {"_getiter_": getiter}
globals = {"_getiter_": getiter, '_inplacevar_': inplacevar_wrapper}
def getiter(seq): calls.append(seq) return list(seq)
b2ce85ffe09a48858cfc642fcb209fb9fbcc3089 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b2ce85ffe09a48858cfc642fcb209fb9fbcc3089/testRestrictions.py
if request_get('SUBMIT','')=='cancel':
if lower(strip(request_get('SUBMIT','')))=='cancel':
def publish(self, module_name, after_list, published='web_objects', imported_modules={}, module_dicts={},debug=0):
ca960783fdf276d81c8d450c9e90b8b11e8d532b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ca960783fdf276d81c8d450c9e90b8b11e8d532b/Publish.py
n1 = child.getElementsByTagName(tagname) nodeList = nodeList + n1._data
if hasattr(child, 'getElementsByTagName'): n1 = child.getElementsByTagName(tagname) nodeList = nodeList + n1._data
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)
2ea6d7f12e15dc9783b94f10419ebfd0ba8ac8f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2ea6d7f12e15dc9783b94f10419ebfd0ba8ac8f4/ZDOM.py
self._txn.commit() def _abort(self, tid, user, desc, ext):
self._transaction.commit() def _abort(self):
def _finish(self, tid, user, desc, ext): """Called from BaseStorage.tpc_finish(), this commits the underlying BSDDB transaction.
c702bc72d9d31c6e011d9f8467d50147edd90878 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c702bc72d9d31c6e011d9f8467d50147edd90878/BerkeleyBase.py
self._txn.abort()
self._transaction.abort()
def _abort(self, tid, user, desc, ext): """Called from BaseStorage.tpc_abort(), this aborts the underlying BSDDB transaction. tid is the transaction id user is the transaction user desc is the transaction description ext is the transaction extension
c702bc72d9d31c6e011d9f8467d50147edd90878 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c702bc72d9d31c6e011d9f8467d50147edd90878/BerkeleyBase.py
return h>=0 and h<=23 and m>=0 and m<=59 and s>=0 and s<=59
return h>=0 and h<=23 and m>=0 and m<=59 and s>=0 and s < 60
def _validTime(self,h,m,s): return h>=0 and h<=23 and m>=0 and m<=59 and s>=0 and s<=59
ba65ee356a3e20979f023146eb0d55bcbcd0fb85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ba65ee356a3e20979f023146eb0d55bcbcd0fb85/DateTime.py
o=object[name]
try: o=object[name] except AttributeError: raise 'NotFound', name
def unrestrictedTraverse(self, path, default=_marker, restricted=0):
56d121693ad7de2193e84f55de10b21e4acc4ff1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/56d121693ad7de2193e84f55de10b21e4acc4ff1/Traversable.py
def next_object(self): # Get the next object pickle data. Return the oid and the pickle # string. Raise a LogCorruptedError if there's an incomplete marshal # record. rec = self._next() if rec is None: return None try: key, (oid, pickle) = rec except ValueError: raise LogCorruptedError, 'incomplete record' if key <> 'o': raise LogCorruptedError, 'bad record key: %s' % key return oid, pickle
63fcfce7f82a912a3a5d79c069c9c2c73f9294ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/63fcfce7f82a912a3a5d79c069c9c2c73f9294ad/CommitLog.py
def write_object(self, oid, pickle): self._append('o', (oid, pickle))
def __init__(self, file=None, dir='.'): """Initialize the `full' commit log, usually with a new file.""" CommitLog.__init__(self, file, dir) self.__versions = {} def finish(self): CommitLog.finish(self) self.__versions.clear() def get_vid(self, version, missing=None): """Given a version string, return the associated vid. If not present, return `missing'. """ return self.__versions.get(version, missing) def write_object(self, oid, vid, nvrevid, pickle, prevrevid): self._append('o', (oid, vid, nvrevid, '', pickle, prevrevid)) def write_nonversion_object(self, oid, lrevid, prevrevid, zero='\0'*8): self._append('o', (oid, zero, zero, lrevid, '', prevrevid)) def write_moved_object(self, oid, vid, nvrevid, lrevid, prevrevid): self._append('o', (oid, vid, nvrevid, lrevid, '', prevrevid))
def write_object(self, oid, pickle): self._append('o', (oid, pickle))
63fcfce7f82a912a3a5d79c069c9c2c73f9294ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/63fcfce7f82a912a3a5d79c069c9c2c73f9294ad/CommitLog.py
return NOne
return None
def next_object(self): # Get the next object record. Return the key for unpacking and the # object record data. rec = self._next() if rec is None: return NOne try: key, data = rec except ValueError: raise LogCorruptedError, 'incomplete record' if key not in 'ovd': raise LogCorruptedError, 'bad record key: %s' % key return key, data
63fcfce7f82a912a3a5d79c069c9c2c73f9294ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/63fcfce7f82a912a3a5d79c069c9c2c73f9294ad/CommitLog.py
def store(self, oid, vid, nv, dataptr, pickle, previous, dump=marshal.dump): dump(('s',(oid,vid,nv,data,pickle,previous)), self._file) def storeNV(self, oid, data, tid, dump=marshal.dump, zero='\0\0\0\0\0\0\0\0'): dump(('s',(oid,zero,zero,data,'',tid)), self._file)
def next_object(self): # Get the next object record. Return the key for unpacking and the # object record data. rec = self._next() if rec is None: return NOne try: key, data = rec except ValueError: raise LogCorruptedError, 'incomplete record' if key not in 'ovd': raise LogCorruptedError, 'bad record key: %s' % key return key, data
63fcfce7f82a912a3a5d79c069c9c2c73f9294ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/63fcfce7f82a912a3a5d79c069c9c2c73f9294ad/CommitLog.py
'<em>%s</em> sucessfully exported to <em>%s</em>' % (id,f),
'<em>%s</em> successfully exported to <em>%s</em>' % (id,f),
def manage_exportObject(self, id='', download=None, toxml=None, RESPONSE=None,REQUEST=None): """Exports an object to a file and returns that file.""" if not id: # can't use getId() here (breaks on "old" exported objects) id=self.id if hasattr(id, 'im_func'): id=id() ob=self else: ob=self._getOb(id)
f4601e003f7ebd44a2b970754aa26fa048be31a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f4601e003f7ebd44a2b970754aa26fa048be31a6/ObjectManager.py
manage_tabs_message='<em>%s</em> sucessfully imported' % id,
manage_tabs_message='<em>%s</em> successfully imported' % id,
def manage_importObject(self, file, REQUEST=None, set_owner=1): """Import an object from a file""" dirname, file=os.path.split(file) if dirname: raise BadRequestException, 'Invalid file name %s' % escape(file)
f4601e003f7ebd44a2b970754aa26fa048be31a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f4601e003f7ebd44a2b970754aa26fa048be31a6/ObjectManager.py
if attrs.has_key('expires'): cookie='set-cookie: %s="%s"' % (name,attrs['value']) else: cookie=('set-cookie: %s="%s"; Version="1"' % (name,attrs['value']))
cookie='set-cookie: %s="%s"' % (name,attrs['value'])
def _cookie_list(self):
fc2fce2a59774c481623cfd80fa7d71409e095d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fc2fce2a59774c481623cfd80fa7d71409e095d0/Response.py
return self.formatSupplementLine('__traceback_info__: %s' % tbi)
return self.formatSupplementLine('__traceback_info__: %s' % (tbi,))
def formatTracebackInfo(self, tbi): return self.formatSupplementLine('__traceback_info__: %s' % tbi)
488d94d7117d4d37e0a8a1990a745c80b73f9d10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/488d94d7117d4d37e0a8a1990a745c80b73f9d10/ExceptionFormatter.py
level>=0 starts searching at the given level level<0 not implemented yet
level >= 0 starts searching at the given level level < 0 not implemented yet
def search(self,path,default_level=0): """ path is either a string representing a relative URL or a part of a relative URL or a tuple (path,level).
3ac4c21d1338a984d5a50a51d2b59e29f9efc874 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3ac4c21d1338a984d5a50a51d2b59e29f9efc874/PathIndex.py
if level >=0:
if len(comps) == 0: return IISet(self._unindex.keys()) if level >= 0:
def search(self,path,default_level=0): """ path is either a string representing a relative URL or a part of a relative URL or a tuple (path,level).
3ac4c21d1338a984d5a50a51d2b59e29f9efc874 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3ac4c21d1338a984d5a50a51d2b59e29f9efc874/PathIndex.py
return (StructuredTextInnerLink(s[start2+1,end2-1],start2,end2))
return (StructuredTextInnerLink(s[start2+1:end2-1],start2,end2))
def doc_inner_link(self, s, expr1 = re.compile(r"\.\.\s*").search, expr2 = re.compile(r"\[[%s%s]+\]" % (letters, digits) ).search): # make sure we dont grab a named link if expr2(s) and expr1(s): start1,end1 = expr1(s).span() start2,end2 = expr2(s).span() if end1 == start2: # uh-oh, looks like a named link return None else: # the .. is somewhere else, ignore it return (StructuredTextInnerLink(s[start2+1,end2-1],start2,end2)) return None elif expr2(s) and not expr1(s): start,end = expr2(s).span() return (StructuredTextInnerLink(s[start+1:end-1]),start,end) return None
442ef3d41c801e277d48a39966f3d505c0821a2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/442ef3d41c801e277d48a39966f3d505c0821a2a/DocumentClass.py
f=BoboFunction(url, method=method, username=self.username, password=self.password, timeout=self.timeout)
f=Function(url, method=method, username=self.username, password=self.password, timeout=self.timeout)
def __getattr__(self, name):
e368287148c790c8588f7daced6851eca387750e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e368287148c790c8588f7daced6851eca387750e/Client.py
obj = self.sq_parent.resolve_url(self.getpath(rid), REQUEST)
obj = self.aq_parent.resolve_url(self.getpath(rid), REQUEST)
def getobject(self, rid, REQUEST=None): """ Return a cataloged object given a 'data_record_id_' """ try: obj = self.aq_parent.restrictedTraverse(self.getpath(rid)) if not obj: if REQUEST is None: REQUEST=self.REQUEST obj = self.sq_parent.resolve_url(self.getpath(rid), REQUEST) return obj except: pass
a68fd60c84c371c8e47be49ac0651f1fa676d4a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a68fd60c84c371c8e47be49ac0651f1fa676d4a9/ZCatalog.py
if realm: self['WWW-authenticate']='basic realm="%s"' % realm
if realm: self.setHeader('WWW-Authenticate', 'basic realm="%s"' % realm, 1)
def _unauthorized(self): realm=self.realm if realm: self['WWW-authenticate']='basic realm="%s"' % realm
c3567e9400237daddb0cf001a5d307c83abbd89d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c3567e9400237daddb0cf001a5d307c83abbd89d/HTTPResponse.py
self.output_encoding = 'utf-8'
self.output_encoding = encoding
def __init__(self, id, text=None, content_type=None, encoding='utf-8', strict=True): self.id = id self.expand = 0 self.ZBindings_edit(self._default_bindings) self.output_encoding = 'utf-8'
30bcf1f37df5dea4049a36f9da97d2b605014ece /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/30bcf1f37df5dea4049a36f9da97d2b605014ece/ZopePageTemplate.py
encoding = self.output_encoding
else: encoding = self.output_encoding
def pt_edit(self, text, content_type, keep_output_encoding=False):
30bcf1f37df5dea4049a36f9da97d2b605014ece /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/30bcf1f37df5dea4049a36f9da97d2b605014ece/ZopePageTemplate.py
app.Control_Panel.initialize_cache()
def initialize(app): # Initialize the application # Initialize the cache: app.Control_Panel.initialize_cache() # The following items marked b/c are backward compatibility hacks # which make sure that expected system objects are added to the # bobobase. This is required because the bobobase in use may pre- # date the introduction of certain system objects such as those # which provide Lever support. # b/c: Ensure that Control Panel exists. if not hasattr(app, 'Control_Panel'): cpl=ApplicationManager() cpl._init() app._setObject('Control_Panel', cpl) get_transaction().note('Added Control_Panel') get_transaction().commit() # b/c: Ensure that a ProductFolder exists. if not hasattr(app.Control_Panel.aq_base, 'Products'): app.Control_Panel.Products=App.Product.ProductFolder() get_transaction().note('Added Control_Panel.Products') get_transaction().commit() # Ensure that a temp folder exists if not hasattr(app, 'temp_folder'): from Products.TemporaryFolder.TemporaryFolder import \ MountedTemporaryFolder tf = MountedTemporaryFolder('temp_folder','Temporary Folder') app._setObject('temp_folder', tf) get_transaction().note('Added temp_folder') get_transaction().commit() del tf # Ensure that there is a transient container in the temp folder tf = app.temp_folder if not hasattr(tf, 'session_data'): env_has = os.environ.get from Products.Transience.Transience import TransientObjectContainer addnotify = env_has('ZSESSION_ADD_NOTIFY', None) delnotify = env_has('ZSESSION_DEL_NOTIFY', None) default_limit = 1000 limit = env_has('ZSESSION_OBJECT_LIMIT', default_limit) try: limit=int(limit) if limit != default_limit: LOG('Zope Default Object Creation', INFO, ('using ZSESSION_OBJECT_LIMIT-specified max objects ' 'value of %s' % limit)) except ValueError: LOG('Zope Default Object Creation', WARNING, ('Noninteger value %s specified for ZSESSION_OBJECT_LIMIT, ' 'defaulting to %s' % (limit, default_limit))) limit = default_limit if addnotify and app.unrestrictedTraverse(addnotify, None) is None: LOG('Zope Default Object Creation', WARNING, ('failed to use nonexistent "%s" script as ' 'ZSESSION_ADD_NOTIFY' % addnotify)) addnotify=None elif addnotify: LOG('Zope Default Object Creation', INFO, 'using %s as add notification script' % addnotify) if delnotify and app.unrestrictedTraverse(delnotify, None) is None: LOG('Zope Default Object Creation', WARNING, ('failed to use nonexistent "%s" script as ' 'ZSESSION_DEL_NOTIFY' % delnotify)) delnotify=None elif delnotify: LOG('Zope Default Object Creation', INFO, 'using %s as delete notification script' % delnotify) toc = TransientObjectContainer('session_data', 'Session Data Container', addNotification = addnotify, delNotification = delnotify, limit=limit) timeout_spec = env_has('ZSESSION_TIMEOUT_MINS', '') if timeout_spec: try: timeout_spec = int(timeout_spec) except ValueError: LOG('Zope Default Object Creation', WARNING, ('"%s" is an illegal value for ZSESSION_TIMEOUT_MINS, ' 'using default timeout instead.' % timeout_spec)) else: LOG('Zope Default Object Creation', INFO, ('using ZSESSION_TIMEOUT_MINS-specified session timeout ' 'value of %s' % timeout_spec)) toc = TransientObjectContainer('session_data', 'Session Data Container', timeout_mins = timeout_spec, addNotification=addnotify, delNotification = delnotify, limit=limit) tf._setObject('session_data', toc) tf_reserved = getattr(tf, '_reserved_names', ()) if 'session_data' not in tf_reserved: tf._reserved_names = tf_reserved + ('session_data',) get_transaction().note('Added session_data to temp_folder') get_transaction().commit() del toc del addnotify del delnotify del timeout_spec del env_has del tf # Ensure that a browser ID manager exists if not hasattr(app, 'browser_id_manager'): from Products.Sessions.BrowserIdManager import BrowserIdManager bid = BrowserIdManager('browser_id_manager', 'Browser Id Manager') app._setObject('browser_id_manager', bid) get_transaction().note('Added browser_id_manager') get_transaction().commit() del bid # Ensure that a session data manager exists if not hasattr(app, 'session_data_manager'): from Products.Sessions.SessionDataManager import SessionDataManager sdm = SessionDataManager('session_data_manager', title='Session Data Manager', path='/temp_folder/session_data', requestName='SESSION') app._setObject('session_data_manager', sdm) get_transaction().note('Added session_data_manager') get_transaction().commit() del sdm # Ensure that there's an Examples folder with examples. # However, make sure that if the examples have been added already # and then deleted that we don't add them again. if not hasattr(app, 'Examples') and not \ hasattr(app, '_Zope25_examples_have_been_added'): examples_path = os.path.join(Globals.SOFTWARE_HOME, \ '..','..','import', 'Examples.zexp') if os.path.isfile(examples_path): app._importObjectFromFile(examples_path, verify=0) app._Zope25_examples_have_been_added=1 get_transaction().note('Added Examples folder') get_transaction().commit() else: LOG('Zope Default Object Creation', INFO, '%s examples import file could not be found.' % examples_path) # b/c: Ensure that Owner role exists. if hasattr(app, '__ac_roles__') and not ('Owner' in app.__ac_roles__): app.__ac_roles__=app.__ac_roles__ + ('Owner',) get_transaction().note('Added Owner role') get_transaction().commit() # ensure the Authenticated role exists. if hasattr(app, '__ac_roles__'): if not 'Authenticated' in app.__ac_roles__: app.__ac_roles__=app.__ac_roles__ + ('Authenticated',) get_transaction().note('Added Authenticated role') get_transaction().commit() # Make sure we have Globals root=app._p_jar.root() if not root.has_key('ZGlobals'): import BTree app._p_jar.root()['ZGlobals']=BTree.BTree() get_transaction().note('Added Globals') get_transaction().commit() # Install the initial user. if hasattr(app, 'acl_users'): users = app.acl_users if hasattr(users, '_createInitialUser'): app.acl_users._createInitialUser() get_transaction().note('Created initial user') get_transaction().commit() install_products(app) install_standards(app) # Note that the code from here on only runs if we are not a ZEO # client, or if we are a ZEO client and we've specified by way # of env variable that we want to force products to load. if (os.environ.get('ZEO_CLIENT') and not os.environ.get('FORCE_PRODUCT_LOAD')): return # Check for dangling pointers (broken zclass dependencies) in the # global class registry. If found, rebuild the registry. Note that # if the check finds problems but fails to successfully rebuild the # registry we abort the transaction so that we don't leave it in an # indeterminate state. did_fixups=0 bad_things=0 try: if app.checkGlobalRegistry(): LOG('Zope', INFO, 'Beginning attempt to rebuild the global ZClass registry.') app.fixupZClassDependencies(rebuild=1) did_fixups=1 LOG('Zope', INFO, 'The global ZClass registry has successfully been rebuilt.') get_transaction().note('Rebuilt global product registry') get_transaction().commit() except: bad_things=1 LOG('Zope', ERROR, 'The attempt to rebuild the registry failed.', error=sys.exc_info()) get_transaction().abort() # Now we need to see if any (disk-based) products were installed # during intialization. If so (and the registry has no errors), # there may still be zclasses dependent on a base class in the # newly installed product that were previously broken and need to # be fixed up. If any really Bad Things happened (dangling pointers # were found in the registry but it couldn't be rebuilt), we don't # try to do anything to avoid making the problem worse. if (not did_fixups) and (not bad_things): # App.Product.initializeProduct will set this if a disk-based # product was added or updated and we are not a ZEO client. if getattr(Globals, '__disk_product_installed__', 0): try: LOG('Zope', INFO, 'New disk product detected, determining '\ 'if we need to fix up any ZClasses.') if app.fixupZClassDependencies(): LOG('Zope', INFO, 'Repaired broken ZClass dependencies.') get_transaction().commit() except: LOG('Zope', ERROR, 'Attempt to fixup ZClass dependencies after detecting ' \ 'an updated disk-based product failed.', error=sys.exc_info()) get_transaction().abort()
46b57e43ac861f750a8afcf7711068b942d66d2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/46b57e43ac861f750a8afcf7711068b942d66d2d/Application.py
self.setDefaultRoles(permission_name, item[2])
self.setPermissionDefault(permission_name, item[2])
def apply(self, classobj): """Apply security information to the given class object.""" dict = classobj.__dict__
0b109961abf2d793286c5137e81bd4311f1407f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0b109961abf2d793286c5137e81bd4311f1407f0/SecurityInfo.py
new = string.join(map(lambda s: d[s], S), '')
new = string.join(map(reprs.get, S), '')
def convert(S, find=string.find): new = '' encoding = 'repr' new = string.join(map(lambda s: d[s], S), '') if len(new) > (1.4*len(S)): encoding = 'base64' new = base64.encodestring(S)[:-1] elif find(new,'>') >= 0 or find(new,'<') >= 0 or find(new,'&') >= 0: if find(new, ']]>') <0 : new='<![CDATA[\n\n'+new+'\n\n]]>' encoding='cdata' else: new=string.join(map(lambda s: d2[s], new), '') return encoding, new
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
new=string.join(map(lambda s: d2[s], new), '')
new=string.join(map(lambda s: reprs2.get(s,s), new), '')
def convert(S, find=string.find): new = '' encoding = 'repr' new = string.join(map(lambda s: d[s], S), '') if len(new) > (1.4*len(S)): encoding = 'base64' new = base64.encodestring(S)[:-1] elif find(new,'>') >= 0 or find(new,'<') >= 0 or find(new,'&') >= 0: if find(new, ']]>') <0 : new='<![CDATA[\n\n'+new+'\n\n]]>' encoding='cdata' else: new=string.join(map(lambda s: d2[s], new), '') return encoding, new
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
if v < 0: v=t32-v
if v < 0: v=t32+v
def u64(v, unpack=struct.unpack): h, v = unpack(">ii", v) if v < 0: v=t32-v if h: if h < 0: h=t32-h v=h*t32+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
if h < 0: h=t32-h
if h < 0: h=t32+h
def u64(v, unpack=struct.unpack): h, v = unpack(">ii", v) if v < 0: v=t32-v if h: if h < 0: h=t32-h v=h*t32+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
def cp(f1, f2, l): read=f1.read write=f2.write n=8192 while l > 0: if n > l: n=l d=read(n) write(d) l = l - len(d)
def u64(v, unpack=struct.unpack): h, v = unpack(">ii", v) if v < 0: v=t32-v if h: if h < 0: h=t32-h v=h*t32+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
def end_none(self,tag,data): return None def end_reference(self, tag, data): return self._pickleids[data[1]['id']]
def end_none(self,tag,data): return None
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
def end_item(self, tag, data): v=data[2:] return v
def end_dictionary(self, tag, data): D={} a=data[1] for k, v in data[2:]: D[k]=v if a.has_key('id'): self._pickleids[a['id']]=D return D
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
'none': end_none,
'none': lambda self, tag, data: None,
def end_item(self, tag, data): v=data[2:] return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
'item': end_item, 'reference': end_reference,
'item': lambda self, tag, data: data[2:], 'reference': lambda self, tag, data: self._pickleids[data[1]['id']],
def end_item(self, tag, data): v=data[2:] return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
def save_none(self, tag, data): return 'N'
def end_item(self, tag, data): v=data[2:] return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v=v+put+id else: v=v+put+id+"\012" return v
return save_put(self, v, a)
def save_string(self, tag, data): binary=self.binary v='' a=data[1] if len(data)>2: for x in data[2:]: v=v+x encoding=a['encoding'] if encoding is not '': v=unconvert(encoding,v) put='p' if binary: l=len(v) s=mdumps(l)[1:] if (l<256): v='U'+s[0]+v else: v='T'+s+v put='q' else: v="S'"+v+"'\012" if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v=v+put+id else: v=v+put+id+"\012" return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
binary=self.binary
def save_tuple(self, tag, data): binary=self.binary T=data[2:] a=data[1] v='' put='p' for x in T: v=v+x if v is '': return ')' v='('+v+'t' if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v=v+put+id else: v=v+put+id+'\012' return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
a=data[1] v='' put='p' for x in T: v=v+x if v is '': return ')' v='('+v+'t' if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v=v+put+id else: v=v+put+id+'\012' return v
if not T: return ')' return save_put(self, '('+string.join(T,'')+'t', data[1])
def save_tuple(self, tag, data): binary=self.binary T=data[2:] a=data[1] v='' put='p' for x in T: v=v+x if v is '': return ')' v='('+v+'t' if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v=v+put+id else: v=v+put+id+'\012' return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
binary=self.binary
def save_list(self, tag, data): binary=self.binary L=data[2:] a=data[1] v='' x=0 if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: while x<len(L): v=v+L[x] x=x+1 if id: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' if v is not '': v=']'+put+id+'('+v+'e' else: v=']'+put+id else: while x<len(L): v=v+L[x]+'a' x=x+1 if id: v='(lp'+id+'\012'+v if v=='': v=']' return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
v='' x=0 if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: while x<len(L): v=v+L[x] x=x+1 if id: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' if v is not '': v=']'+put+id+'('+v+'e' else: v=']'+put+id
if self.binary: v=save_put(self, ']', a) if L: v=v+'('+string.join(L,'')+'e'
def save_list(self, tag, data): binary=self.binary L=data[2:] a=data[1] v='' x=0 if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: while x<len(L): v=v+L[x] x=x+1 if id: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' if v is not '': v=']'+put+id+'('+v+'e' else: v=']'+put+id else: while x<len(L): v=v+L[x]+'a' x=x+1 if id: v='(lp'+id+'\012'+v if v=='': v=']' return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
while x<len(L): v=v+L[x]+'a' x=x+1 if id: v='(lp'+id+'\012'+v if v=='': v=']'
v=save_put(self, '(l', a) if L: v=string.join(L,'a')+'a'
def save_list(self, tag, data): binary=self.binary L=data[2:] a=data[1] v='' x=0 if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: while x<len(L): v=v+L[x] x=x+1 if id: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' if v is not '': v=']'+put+id+'('+v+'e' else: v=']'+put+id else: while x<len(L): v=v+L[x]+'a' x=x+1 if id: v='(lp'+id+'\012'+v if v=='': v=']' return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
binary=self.binary
def save_dict(self, tag, data): binary=self.binary D=data[2:] a=data[1] id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v='}'+put+id if len(D)>0: v=v+'(' x=0 while x < len(D): v=v+D[x] x=x+1 if len(D)>0: v=v+'u' else: v='(dp'+id+'\012' x=0 while x<len(D): v=v+D[x]+'s' x=x+1 return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
a=data[1] id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v='}'+put+id if len(D)>0: v=v+'(' x=0 while x < len(D): v=v+D[x] x=x+1 if len(D)>0: v=v+'u'
if self.binary: v=save_put(self, '}', data[1]) if D: v=v+'('+string.join(D,'')+'u'
def save_dict(self, tag, data): binary=self.binary D=data[2:] a=data[1] id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v='}'+put+id if len(D)>0: v=v+'(' x=0 while x < len(D): v=v+D[x] x=x+1 if len(D)>0: v=v+'u' else: v='(dp'+id+'\012' x=0 while x<len(D): v=v+D[x]+'s' x=x+1 return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
v='(dp'+id+'\012' x=0 while x<len(D): v=v+D[x]+'s' x=x+1 return v def save_item(self, tag, data): v='' for x in data[2:]: v=v+x return v def save_pickle(self, tag, data): v=data[2]+'.'
v=save_put(self, '(d', data[1]) if D: v=v+string.join(D,'s')+'s'
def save_dict(self, tag, data): binary=self.binary D=data[2:] a=data[1] id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v='}'+put+id if len(D)>0: v=v+'(' x=0 while x < len(D): v=v+D[x] x=x+1 if len(D)>0: v=v+'u' else: v='(dp'+id+'\012' x=0 while x<len(D): v=v+D[x]+'s' x=x+1 return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
a=data[1]
a=data[1]
def save_reference(self, tag, data): binary=self.binary a=data[1] id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] get='g' if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] get='h' else: id=s get='j' v=get+id else: v=get+id+'\012' return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
binary=self.binary
v='('+data[2] x=data[3][1:] stop=string.rfind(x,'t') if stop>=0: x=x[:stop] v=save_put(self, v+x+'o', data[1]) v=v+data[4]+'b' return v def save_global(self, tag, data):
def save_object(self, tag, data): binary=self.binary a=data[1] v='(' j=0 id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] put='p' if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' for x in data[2:]: if j==0: v=v + x elif j==1: x=x[1:] stop=string.rfind(x,'t') if stop>=0: x=x[:stop] v=v+x+'o'+put+id elif j==2: v=v+x j=j+1 else: for x in data[2:]: if j==0: v=v+x elif j==1: x=x[1:] stop=string.rfind(x,'t') if stop>=0: x=x[:stop] v=v+x+'o'+put+id+'\012' elif j==2: v=v+x j=j+1 v=v+'b' if a.has_key('id'): self._pickleids[a['id']]=v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
v='(' j=0 id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] put='p' if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' for x in data[2:]: if j==0: v=v + x elif j==1: x=x[1:] stop=string.rfind(x,'t') if stop>=0: x=x[:stop] v=v+x+'o'+put+id elif j==2: v=v+x j=j+1 else: for x in data[2:]: if j==0: v=v+x elif j==1: x=x[1:] stop=string.rfind(x,'t') if stop>=0: x=x[:stop] v=v+x+'o'+put+id+'\012' elif j==2: v=v+x j=j+1 v=v+'b' if a.has_key('id'): self._pickleids[a['id']]=v return v def save_global(self, tag, data): binary=self.binary a=data[1] if a.has_key('id'): id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] put='p' if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' v='c'+a['module']+'\012'+a['name']+'\012'+put+id else: v=a['module']+'\012'+a['name']+'\012'+put+id+'\012' self._pickleids[a['id']]=v else: v=a['module']+'\012'+a['name']+'\012' return v
return save_put(self, 'c'+a['module']+'\012'+a['name']+'\012', a)
def save_object(self, tag, data): binary=self.binary a=data[1] v='(' j=0 id=a['id'] prefix=string.rfind(id,'.') if prefix>=0: id=id[prefix+1:] put='p' if binary: id=string.atoi(id) s=mdumps(id)[1:] if (id < 256): id=s[0] put='q' else: id=s put='r' for x in data[2:]: if j==0: v=v + x elif j==1: x=x[1:] stop=string.rfind(x,'t') if stop>=0: x=x[:stop] v=v+x+'o'+put+id elif j==2: v=v+x j=j+1 else: for x in data[2:]: if j==0: v=v+x elif j==1: x=x[1:] stop=string.rfind(x,'t') if stop>=0: x=x[:stop] v=v+x+'o'+put+id+'\012' elif j==2: v=v+x j=j+1 v=v+'b' if a.has_key('id'): self._pickleids[a['id']]=v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
binary=self.binary
def save_persis(self, tag, data): binary=self.binary v=data[2] if binary: v=v+'Q' else: v='P'+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
if binary:
if self.binary:
def save_persis(self, tag, data): binary=self.binary v=data[2] if binary: v=v+'Q' else: v='P'+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
def save_persis(self, tag, data): binary=self.binary v=data[2] if binary: v=v+'Q' else: v='P'+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
start_handlers={'pickle': start_pickle,}
start_handlers={ 'pickle': lambda self, tag, attrs: [tag, attrs], }
def save_persis(self, tag, data): binary=self.binary v=data[2] if binary: v=v+'Q' else: v='P'+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
'pickle': save_pickle, 'none': save_none,
'pickle': lambda self, tag, data: data[2]+'.', 'none': lambda self, tag, data: 'N',
def save_persis(self, tag, data): binary=self.binary v=data[2] if binary: v=v+'Q' else: v='P'+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
'item': save_item,
'item': lambda self, tag, data, j=string.join: j(data[2:],''),
def save_persis(self, tag, data): binary=self.binary v=data[2] if binary: v=v+'Q' else: v='P'+v return v
b3044d78409b750569423711b47a47edfd53dde3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3044d78409b750569423711b47a47edfd53dde3/ppml.py
%s zpasswd
%s zpasswd.py
def write_access(home, user='', group=''): import whrandom pw_choices = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "abcdefghijklmnopqrstuvwxyz" \ "0123456789!" ac_path=os.path.join(home, 'access') if not os.path.exists(ac_path): print 'creating default access file' acfile=open(ac_path, 'w') pw = '' for i in range(8): pw = pw + whrandom.choice(pw_choices) acfile.write('superuser:' + generate_passwd(pw, 'SHA')) acfile.close() os.system('chmod 644 access') print """Note: The super user name and password are 'superuser' and '%s'. You can change the superuser name and password with the zpasswd script. To find out more, type: %s zpasswd """ % (pw, sys.executable) import do; do.ch(ac_path, user, group)
4c4772efd880a56bd9d5e31938f88aa1775d28ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4c4772efd880a56bd9d5e31938f88aa1775d28ad/zpasswd.py
$Id: Publish.py,v 1.43 1997/05/14 15:07:22 jim Exp $"""
$Id: Publish.py,v 1.44 1997/06/13 16:02:10 jim Exp $"""
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
835d90b27a6a934b9f526a4b0ced014ec0fd8cc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/835d90b27a6a934b9f526a4b0ced014ec0fd8cc1/Publish.py
__version__='$Revision: 1.43 $'[11:-2]
__version__='$Revision: 1.44 $'[11:-2]
def taste(spam): "a favorable reviewer" return spam,'yum yum, I like ' + spam
835d90b27a6a934b9f526a4b0ced014ec0fd8cc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/835d90b27a6a934b9f526a4b0ced014ec0fd8cc1/Publish.py
try: transaction=get_transaction()
try: transaction=get_transaction() except: transaction=None if transaction is not None:
def publish(self, module_name, after_list, published='web_objects',
835d90b27a6a934b9f526a4b0ced014ec0fd8cc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/835d90b27a6a934b9f526a4b0ced014ec0fd8cc1/Publish.py
u=self.request['AUTHENTICATED_USER'] try: u="%s.%s" % (u, self.request['session__domain']) except: pass try: info=u+info
try: u=self.request['AUTHENTICATED_USER'] try: u="%s.%s" % (u, self.request['session__domain']) except: pass try: info=u+info except: pass
def publish(self, module_name, after_list, published='web_objects',
835d90b27a6a934b9f526a4b0ced014ec0fd8cc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/835d90b27a6a934b9f526a4b0ced014ec0fd8cc1/Publish.py
except: transaction=None
def publish(self, module_name, after_list, published='web_objects',
835d90b27a6a934b9f526a4b0ced014ec0fd8cc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/835d90b27a6a934b9f526a4b0ced014ec0fd8cc1/Publish.py
except: pass
def __call__(self, *args, **kw): self._a() try: return apply(self._f, args, kw) finally: self._r()
33637ce12adca9a32915dfb0b68aa7d295d78a5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/33637ce12adca9a32915dfb0b68aa7d295d78a5b/ts_regex.py
def __init__(self, *dicts): self._mm = apply(MultiMapping, dicts) def __getitem__(self, index): return self._mm[index] def __len__(self): return len(self._mm) def _push(self, arg): self._mm.push(arg) def _pop(self): return self._mm.pop() def has_key(self, key): return self._mm.has_key(key)
push = pop = None def _push(self, ob): MultiMapping.push(self, ob) def _pop(self, *args): if args: return apply(MultiMapping.pop, (self,) + args) else: return MultiMapping.pop(self)
def __init__(self, *dicts): self._mm = apply(MultiMapping, dicts)
0cefd1eecc1d8e9da3a35f4d70be144fd372bd59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cefd1eecc1d8e9da3a35f4d70be144fd372bd59/TALES.py
v = self._mm.get(key, self) if v is self:
v = self.get(key, _marker) if v is _marker:
def has_get(self, key): v = self._mm.get(key, self) if v is self: return 0, None else: return 1, v
0cefd1eecc1d8e9da3a35f4d70be144fd372bd59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0cefd1eecc1d8e9da3a35f4d70be144fd372bd59/TALES.py
if not yr>100: yr=yr+CENTURY
yr = _correctYear(yr)
def __init__(self,*args): """Return a new date-time object
23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py