rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
yr=(yr>100) and yr or 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 |
if year < 100: year=year+CENTURY elif year < 1000: raise self.SyntaxError, string | year = _correctYear(year) if year < 1000: raise self.SyntaxError, string | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones =self._tzinfo._zidx TimeModifiers =['am','pm'] | 23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py |
t=0 | tod=0 | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones =self._tzinfo._zidx TimeModifiers =['am','pm'] | 23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py |
t=t+i/24.0 | tod = tod + int(i) * 3600 | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones =self._tzinfo._zidx TimeModifiers =['am','pm'] | 23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py |
t=t+i/1440.0 | tod = tod + int(i) * 60 | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones =self._tzinfo._zidx TimeModifiers =['am','pm'] | 23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py |
t=t+i/86400.0 | tod = tod + i | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones =self._tzinfo._zidx TimeModifiers =['am','pm'] | 23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py |
t=t*86400.0 t_int = long(math.floor(t)) hr,mn,sc = _calcHMS(t_int, t - t_int) | tod_int = int(math.floor(tod)) ms = tod - tod_int hr,mn,sc = _calcHMS(tod_int, ms) | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones =self._tzinfo._zidx TimeModifiers =['am','pm'] | 23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py |
tz = self._calcTimezoneName(x, t - t_int) | tz = self._calcTimezoneName(x, ms) | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones =self._tzinfo._zidx TimeModifiers =['am','pm'] | 23e1cea8a934628cff0a654c62adaaa5a72d3c64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/23e1cea8a934628cff0a654c62adaaa5a72d3c64/DateTime.py |
{'label':'Find', 'action':'manage_findFrame'}, | {'label':'Find', 'action':'manage_findFrame', 'target':'manage_main'}, | def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=Folder() i.id=id i.title=title self._setObject(id,i) if createUserF: i.manage_addUserFolder() if createPublic: i.manage_addDTMLDocument(id='index_html',title='') if REQUEST is not None: return self.manage_main(self,REQUEST,update_menu=1) | 60767845a30fb69223a43a47e950a7cac1f8e956 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/60767845a30fb69223a43a47e950a7cac1f8e956/Folder.py |
v=args[a] | try: v=args[a]['default'] except: v=None | def _argdata(self,REQUEST,raw=0,return_missing_keys=0): | a55efba4e9d61ce8ed357267943fc9321e5ec357 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a55efba4e9d61ce8ed357267943fc9321e5ec357/Aqueduct.py |
, arguments.items() | , items | def default_input_form(id,arguments,action='query'): if arguments: return ( "%s\n%s%s" % ( '<html><head><title>%s Input Data</title></head><body>\n' '<form action="<!--#var URL2-->/<!--#var id-->/%s" ' 'method="get">\n' '<h2>%s Input Data</h2>\n' 'Enter query parameters:<br>' '<table>\n' % (id,action,id), string.joinfields( map( lambda a: ('<tr>\t<td><strong>%s</strong>:</td>\n' '\t<td><input name="%s" width=30 value="%s">' '</td></tr>' % (nicify(a[0]), ( a[1].has_key('type') and ("%s:%s" % (a[0],a[1]['type'])) or a[0] ), a[1].has_key('default') and a[1]['default'] or '' )) , arguments.items() ), '\n'), '\n<tr><td></td><td>\n' '<input type="SUBMIT" name="SUBMIT" value="Submit Query">\n' '<!--#if HTTP_REFERER-->\n' ' <input type="SUBMIT" name="SUBMIT" value="Cancel">\n' ' <INPUT NAME="CANCEL_ACTION" TYPE="HIDDEN"\n' ' VALUE="<!--#var HTTP_REFERER-->">\n' '<!--#/if HTTP_REFERER-->\n' '</td></tr>\n</table>\n</form>\n</body>\n</html>\n' ) ) else: return ( '<html><head><title>%s Input Data</title></head><body>\n' '<form action="<!--#var URL2-->/<!--#var id-->/%s" ' 'method="get">\n' '<h2>%s Input Data</h2>\n' 'This query requires no input.<p>\n' '<input type="SUBMIT" name="SUBMIT" value="Submit Query">\n' '<!--#if HTTP_REFERER-->\n' ' <input type="SUBMIT" name="SUBMIT" value="Cancel">\n' ' <INPUT NAME="CANCEL_ACTION" TYPE="HIDDEN"\n' ' VALUE="<!--#var HTTP_REFERER-->">\n' '<!--#/if HTTP_REFERER-->\n' '</td></tr>\n</table>\n</form>\n</body>\n</html>\n' % (id, action, id) ) | a55efba4e9d61ce8ed357267943fc9321e5ec357 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a55efba4e9d61ce8ed357267943fc9321e5ec357/Aqueduct.py |
{'label': 'Vocabulary', 'action': 'manage_main', 'target': 'manage_workspace'}, {'label': 'Query', 'action': 'manage_query', 'target': 'manage_workspace'}, | {'label': 'Vocabulary', 'action': 'manage_main'}, {'label': 'Query', 'action': 'manage_query'}, | def manage_addVocabulary(self, id, title, globbing=None, REQUEST=None): """Add a Vocabulary object """ id=str(id) title=str(title) if globbing: globbing=1 c=Vocabulary(id, title, globbing) self._setObject(id, c) if REQUEST is not None: return self.manage_main(self,REQUEST) | b35934922a2852e80463eabb4b23a3560f49f7cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b35934922a2852e80463eabb4b23a3560f49f7cd/Vocabulary.py |
if not hasattr(obj, 'aq_parent'): return 0 obj=obj.aq_parent | if obj is None: return 0 | def hasRole(self,parent,roles=None): | 3b1f477d2ab8b2164b957fb0768ace9761e70a7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3b1f477d2ab8b2164b957fb0768ace9761e70a7f/User.py |
def hasRole(self,parent,roles=None): | 3b1f477d2ab8b2164b957fb0768ace9761e70a7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3b1f477d2ab8b2164b957fb0768ace9761e70a7f/User.py |
||
self.thread.join() | self.thread.join(2) | def tearDown(self): if self.thread: self.httpd.server_close() self.thread.join() | 361d2553dcd9ce048e34984b3b212a354c9f95c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/361d2553dcd9ce048e34984b3b212a354c9f95c6/test_AcceleratedHTTPCacheManager.py |
try: return md.AUTHENTICATED_USER.hasRole(value, roles) except AttributeError: return 0 | try: if md.AUTHENTICATED_USER.hasRole(value, roles): return 1 except AttributeError: pass for r in self._proxy_roles: if r in roles: return 1 return 0 | def validate(self, inst, parent, name, value, md): | 277a97227ea7a5bb49ae2a683280bfad439765c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/277a97227ea7a5bb49ae2a683280bfad439765c8/Document.py |
if hasattr(object, '__ac_local_roles__'): local_roles=object.__ac_local_roles__ | local_roles = getattr(object, '__ac_local_roles__', None) if local_roles: | def getRolesInContext(self, object): """Return the list of roles assigned to the user, including local roles assigned in context of the passed in object.""" name=self.getUserName() roles=self.getRoles() local={} object=getattr(object, 'aq_inner', object) while 1: if hasattr(object, '__ac_local_roles__'): local_roles=object.__ac_local_roles__ if callable(local_roles): local_roles=local_roles() dict=local_roles or {} for r in dict.get(name, []): local[r]=1 if hasattr(object, 'aq_parent'): object=object.aq_parent continue if hasattr(object, 'im_self'): object=object.im_self object=getattr(object, 'aq_inner', object) continue break roles=list(roles) + local.keys() return roles | fbe064679e95785e8c505b636d48b5a5731c5d08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fbe064679e95785e8c505b636d48b5a5731c5d08/User.py |
if hasattr(object, 'aq_parent'): object=object.aq_parent | inner = getattr(object, 'aq_inner', object) parent = getattr(inner, 'aq_parent', None) if parent: object = parent | def getRolesInContext(self, object): """Return the list of roles assigned to the user, including local roles assigned in context of the passed in object.""" name=self.getUserName() roles=self.getRoles() local={} object=getattr(object, 'aq_inner', object) while 1: if hasattr(object, '__ac_local_roles__'): local_roles=object.__ac_local_roles__ if callable(local_roles): local_roles=local_roles() dict=local_roles or {} for r in dict.get(name, []): local[r]=1 if hasattr(object, 'aq_parent'): object=object.aq_parent continue if hasattr(object, 'im_self'): object=object.im_self object=getattr(object, 'aq_inner', object) continue break roles=list(roles) + local.keys() return roles | fbe064679e95785e8c505b636d48b5a5731c5d08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fbe064679e95785e8c505b636d48b5a5731c5d08/User.py |
def getRolesInContext(self, object): """Return the list of roles assigned to the user, including local roles assigned in context of the passed in object.""" name=self.getUserName() roles=self.getRoles() local={} object=getattr(object, 'aq_inner', object) while 1: if hasattr(object, '__ac_local_roles__'): local_roles=object.__ac_local_roles__ if callable(local_roles): local_roles=local_roles() dict=local_roles or {} for r in dict.get(name, []): local[r]=1 if hasattr(object, 'aq_parent'): object=object.aq_parent continue if hasattr(object, 'im_self'): object=object.im_self object=getattr(object, 'aq_inner', object) continue break roles=list(roles) + local.keys() return roles | fbe064679e95785e8c505b636d48b5a5731c5d08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fbe064679e95785e8c505b636d48b5a5731c5d08/User.py |
||
n=0 if (len(id) > 8) and (id[8:]=='copy_of_'): | copy_match=self.copy_re.match(id) if (copy_match) and (copy_match.end() < len(id)): | def _get_id(self, id): # Allow containers to override the generation of # object copy id by attempting to call its _get_id # method, if it exists. n=0 if (len(id) > 8) and (id[8:]=='copy_of_'): n=1 orig_id=id while 1: if self._getOb(id, None) is None: return id id='copy%s_of_%s' % (n and n+1 or '', orig_id) n=n+1 | 507ab6cbc3f239fc11c529b3170e0accc22481ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/507ab6cbc3f239fc11c529b3170e0accc22481ad/CopySupport.py |
orig_id=id | orig_id=self.copy_re.sub('', id) else: n=0 orig_id=id | def _get_id(self, id): # Allow containers to override the generation of # object copy id by attempting to call its _get_id # method, if it exists. n=0 if (len(id) > 8) and (id[8:]=='copy_of_'): n=1 orig_id=id while 1: if self._getOb(id, None) is None: return id id='copy%s_of_%s' % (n and n+1 or '', orig_id) n=n+1 | 507ab6cbc3f239fc11c529b3170e0accc22481ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/507ab6cbc3f239fc11c529b3170e0accc22481ad/CopySupport.py |
__traceback_info__=(`ob`, `ob.manage_afterClone`) | def manage_pasteObjects(self, cb_copy_data=None, REQUEST=None): """Paste previously copied objects into the current object. If calling manage_pasteObjects from python code, pass the result of a previous call to manage_cutObjects or manage_copyObjects as the first argument.""" cp=None if cb_copy_data is not None: cp=cb_copy_data else: if REQUEST and REQUEST.has_key('__cp'): cp=REQUEST['__cp'] if cp is None: raise CopyError, eNoData try: cp=_cb_decode(cp) except: raise CopyError, eInvalid | bf20e71bfdfd491a8d1fd187377adbc9395b53ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bf20e71bfdfd491a8d1fd187377adbc9395b53ba/CopySupport.py |
|
def _construct(self, context, id, final): | def _construct(self, context, id): | def _construct(self, context, id, final): """Creates and returns the named folder.""" dispatcher = guarded_getattr(context, 'manage_addProduct')['OFSP'] factory = guarded_getattr(dispatcher, 'manage_addFolder') factory(id) o = context.restrictedTraverse(id) # Commit a subtransaction to assign the new object to # the correct database. transaction.commit(1) return o | 65aa2477be1d686d5e6b6c22b29e17540605f8b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/65aa2477be1d686d5e6b6c22b29e17540605f8b6/MountedObject.py |
def render(self,md): | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
try: collapse_all=md['collapse_all'] | try: collapse_all=md['collapse_all'] | def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
try: expand_all=md['expand_all'] | try: expand_all=md['expand_all'] | def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
except: state=[] | except: state=[] if state: md['RESPONSE'].setCookie('state',quote(str(state)[1:-1]+',')) else: md['RESPONSE'].expireCookie('state') | def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
data.append('<table cellspacing=0>\n') | data.append('<TABLE CELLSPACING="0">\n') | def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
data.append('</table>\n') | data.append('</TABLE>\n') | def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
def tpRender(self, md, section): # Check for collapse all, expand all, and state try: collapse_all=md['collapse_all'] except: collapse_all=None if collapse_all: state=[] else: try: expand_all=md['expand_all'] except: expand_all=None if expand_all: # in case of expand all - to maintain state correctly we # have to make state be the ids of ALL subobjects which # are non-empty (recursively). state=tpValuesIds(self) else: try: state=md['state'] if state[0] != '[': state=unquote(state) state=list(eval(state,{'__builtins__':{}})) except: state=[] # Try to save state in a cookie as well... # md['RESPONSE'].setCookie('state',state) root=md['URL'] l=rfind(root, '/') if l >= 0: root=root[l+1:] url='' data =[] data.append('<table cellspacing=0>\n') colspan=1+tpStateLevel(state) treeData={'tree-root-url': root} md.push(treeData) try: for item in self.tpValues(): data=tpRenderTABLE(item,root,url,state,state,data,colspan, section,md,treeData) data.append('</table>\n') result=join(data,'') finally: md.pop(1) return result | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
id=item.tpId() e=tpValuesIds(item) if e: id=[id,e] else: id=[id] r.append(id) | if item.tpValues(): id=item.tpId() e=tpValuesIds(item) if e: id=[id,e] else: id=[id] r.append(id) | def tpValuesIds(self): r=[] try: for item in self.tpValues(): try: id=item.tpId() e=tpValuesIds(item) if e: id=[id,e] else: id=[id] r.append(id) except: pass except: pass return r | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
try: items=self.tpValues() | try: items=self.tpValues() | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
try: id=self.tpId() | try: id=self.tpId() | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
try: id=self._p_oid | try: id=self._p_oid | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
output('<tr>') if level: output('<td></td>' * level) | output('<TR>\n') if level: output('<TD WIDTH="16"></TD>\n' * level) | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
output('<td valign=top>') | output('<TD WIDTH="16" VALIGN="TOP">') | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
output('<td>') output('</td>\n') | output('<TD WIDTH="16">') output('</TD>\n') | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
output('<td colspan=%s valign=top>' % colspan) | output('<TD COLSPAN="%s" VALIGN="TOP">' % (colspan-level)) | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
output('</td></tr>\n') | output('</TD>\n</TR>\n') | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
||
icoSpace='<IMG SRC="%s/TreeDisplay/Blank_icon.gif" ' \ ' BORDER="0">' % SOFTWARE_URL icoPlus ='<IMG SRC="%s/TreeDisplay/Plus_icon.gif" BORDER="0"' \ ' ALT="+">' % SOFTWARE_URL icoMinus='<IMG SRC="%s/TreeDisplay/Minus_icon.gif" BORDER="0"' \ ' ALT="-">' % SOFTWARE_URL | def tpRenderTABLE(self, root_url, url, state, substate, data, colspan, section, md, treeData, level=0): # We are being called from above try: items=self.tpValues() except: items=None tpUrl=self.tpURL() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl treeData['tree-item-url']=url try: id=self.tpId() except: id=None if id is None: try: id=self._p_oid except: id=None if id is None: id=pyid(self) exp=0 sub=None output=data.append # Add prefix output('<tr>') if level: output('<td></td>' * level) # Add tree expand/contract icon if items: output('<td valign=top>') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if exp: del substate[exp-1] output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoMinus)) substate.append(sub) else: substate.append([id]) output('<A HREF="%s?state=%s">%s</A>' % (root_url,quote(str(state)[1:-1]+','), icoPlus)) del substate[-1] else: output('<td>') output('</td>\n') # add item text output('<td colspan=%s valign=top>' % colspan) output(section(self, md)) output('</td></tr>\n') if exp: for item in items: if len(sub)==1: sub.append([]) data=tpRenderTABLE(item, root_url,url,state,sub[1],data, colspan, section, md, treeData, level+1) if not sub[1]: del sub[1] return data | 8126734c1ab390be0bbe9dafdfc014ddc7232fc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8126734c1ab390be0bbe9dafdfc014ddc7232fc5/TreeTag.py |
|
raise TALError("Bad syntax in substitution text: " + `onError`, position) | raise TALError("Bad syntax in substitution text: " + `arg`, position) | def parseSubstitution(arg, position=(None, None)): m = _subst_re.match(arg) if not m: raise TALError("Bad syntax in substitution text: " + `onError`, position) key, expr = m.group(1, 2) if not key: key = "text" return key, expr | c39c4f7de3dc74f1c51deb8f891d57274c41ee9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c39c4f7de3dc74f1c51deb8f891d57274c41ee9b/TALDefs.py |
if line[-1:] in '\r\n': line=line[:-1] | if line and line[-1:] in '\r\n': line=line[:-1] | def __getitem__(self,index): | f8bdeaafcd1a5326567dd197f148fb986771b9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8bdeaafcd1a5326567dd197f148fb986771b9fb/RDB.py |
if string.rfind(file, '.dtml') == len(file) -5: file=file[:-5] self.index_html=HTMLFile(file,'') | file,ext=os.path.splitext(file) prefix,file=os.path.split(file) self.index_html=HTMLFile(file,prefix) | def __init__(self, id, title, file, permissions=None, categories=None): self.id=id self.title=title if string.rfind(file, '.dtml') == len(file) -5: file=file[:-5] self.index_html=HTMLFile(file,'') if permissions is not None: self.permissions=permissions if categories is not None: self.categories=categories | e9e63a381d657a37e1314f26233be9aca73631e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e9e63a381d657a37e1314f26233be9aca73631e2/HelpTopic.py |
return '%s %s' % (self.title, self.obj.read()) | return '%s %s' % (self.title, self.index_html.read()) | def SearchableText(self): "The full text of the Help Topic, for indexing purposes" return '%s %s' % (self.title, self.obj.read()) | e9e63a381d657a37e1314f26233be9aca73631e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e9e63a381d657a37e1314f26233be9aca73631e2/HelpTopic.py |
if validate(None, self, None, o, None): | if validate(None, self, None, o, _noroles): | def filtered_manage_options(self, REQUEST=None): | 349ff766c0a46742f62831a7e147472608a6295d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/349ff766c0a46742f62831a7e147472608a6295d/Management.py |
newKeywords = getattr(obj, self.id, None) | newKeywords = getattr(obj, self.id, ()) | def index_object(self, documentId, obj, threshold=None): """ index an object 'obj' with integer id 'i' | 6fffa8d4273f5cc8378c707ba0ebf4424572dae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6fffa8d4273f5cc8378c707ba0ebf4424572dae7/UnKeywordIndex.py |
if newKeywords is None: self.unindex_object(documentId) return 0 | def index_object(self, documentId, obj, threshold=None): """ index an object 'obj' with integer id 'i' | 6fffa8d4273f5cc8378c707ba0ebf4424572dae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6fffa8d4273f5cc8378c707ba0ebf4424572dae7/UnKeywordIndex.py |
|
expr1 = re.compile("(\"[ a-zA-Z0-9\n\-\.\,\;\(\)\/\:\/]+\")(:)([a-zA-Z0-9\:\/\.\~\-]+)([,]*\s*)").search, expr2 = re.compile('(\"[ a-zA-Z0-9\n\-\.\:\;\(\)\/]+\")([,]+\s+)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\ | expr1 = re.compile("(\"[ a-zA-Z0-9\n\-\.\,\;\(\)\/\:\/\*\']+\")(:)([a-zA-Z0-9\:\/\.\~\-]+)([,]*\s*)").search, expr2 = re.compile('(\"[ a-zA-Z0-9\n\-\.\:\;\(\)\/\*\']+\")([,]+\s+)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\ | def doc_href( self, s, expr1 = re.compile("(\"[ a-zA-Z0-9\n\-\.\,\;\(\)\/\:\/]+\")(:)([a-zA-Z0-9\:\/\.\~\-]+)([,]*\s*)").search, expr2 = re.compile('(\"[ a-zA-Z0-9\n\-\.\:\;\(\)\/]+\")([,]+\s+)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\#]+)(\s*)').search): #expr1=re.compile('\"([ a-zA-Z0-9.:/;,\n\~\(\)\-]+)\"' # ':' # '([a-zA-Z0-9.:/;,\n\~]+)(?=(\s+|\.|\!|\?))' # ).search, #expr2=re.compile('\"([ a-zA-Z0-9./:]+)\"' # ',\s+' # '([ a-zA-Z0-9@.:/;]+)(?=(\s+|\.|\!|\?))' # ).search, punctuation = re.compile("[\,\.\?\!\;]+").match r=expr1(s) or expr2(s) | dd924f5d40392faa777339a3fba7fa8c568e1641 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dd924f5d40392faa777339a3fba7fa8c568e1641/ClassicDocumentClass.py |
self.__dict__['validate'] = security.DTMLValidate | if self.__dict__.has_key('validate'): first_time_through = 0 else: self.__dict__['validate'] = security.DTMLValidate first_time_through = 1 | def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """Render the document given a client object, REQUEST mapping, Response, and key word arguments.""" | 2f458b2919d206ec2ab6d79cd23c9c6ceff43b92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2f458b2919d206ec2ab6d79cd23c9c6ceff43b92/DTMLMethod.py |
try: del self.__dict__['validate'] except: pass | if first_time_through: del self.__dict__['validate'] | def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """Render the document given a client object, REQUEST mapping, Response, and key word arguments.""" | 2f458b2919d206ec2ab6d79cd23c9c6ceff43b92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2f458b2919d206ec2ab6d79cd23c9c6ceff43b92/DTMLMethod.py |
newline_to_break=1) | newline_to_br=1) | def __init__(self, args, fmt=''): | 11a8e2170d7e2e147953059a2d2f6940f3191c71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/11a8e2170d7e2e147953059a2d2f6940f3191c71/DT_Var.py |
if self.getBrowserIdManager().getToken(create=0): | key = self.getBrowserIdManager().getToken(create=0) if key: | def hasSessionData(self): """ """ if self.getBrowserIdManager().getToken(create=0): if self._hasSessionDataObject(key): return 1 | a8c331a62722a2475938905d0e6c43a34d68fc1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a8c331a62722a2475938905d0e6c43a34d68fc1a/SessionDataManager.py |
else: return mv()==jar.getVersion() | else: return mv(oid)==jar.getVersion() | def modified_in_version(self): """Was the object modified in this version? """ jar=self._p_jar oid=self._p_oid if jar is None or oid is None: return None try: mv=jar.db().modifiedInVersion except: pass else: return mv()==jar.getVersion() | 1f2c15e587dda07ef3a05974fdc054aa1d653030 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1f2c15e587dda07ef3a05974fdc054aa1d653030/PersistentExtra.py |
ms=REQUEST.get_header('If-Modified-Since', None) if ms is not None: ms=string.split(ms, ';')[0] ms=DateTime(ms).timeTime() if self._p_mtime > ms: | header=REQUEST.get_header('If-Modified-Since', None) if header is not None: header=string.split(header, ';')[0] mod_since=DateTime(header).timeTime() last_mod =self._p_mtime if last_mod > 0 and last_mod <= mod_since: | def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image. | 82138cad12b43dadcea9f80524d3a5fad7080d0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/82138cad12b43dadcea9f80524d3a5fad7080d0f/Image.py |
_create_mount_points = 0 | _create_mount_points = True | def _construct(self, context, id): """Creates and returns the named object.""" jar = self.base._p_jar klass = jar.db().classFactory(jar, self.module_name, self.class_name) obj = klass(id) obj._setId(id) context._setObject(id, obj) obj = context.unrestrictedTraverse(id) # Commit a subtransaction to assign the new object to # the correct database. transaction.commit(1) return obj | d9739be023a194e84ac5e2c4bbc1f6729e95d918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d9739be023a194e84ac5e2c4bbc1f6729e95d918/MountedObject.py |
if container_class or self._create_mount_points: | if self._create_mount_points: | def _traverseToMountedRoot(self, root, mount_parent): """Hook for getting the object to be mounted. """ params = self._v_mount_params if params is None: params = self._loadMountParams() real_root, real_path, container_class = params if real_root is None: real_root = 'Application' try: obj = root[real_root] except KeyError: if container_class or self._create_mount_points: # Create a database automatically. from OFS.Application import Application obj = Application() root[real_root] = obj # Get it into the database transaction.commit(1) else: raise | d9739be023a194e84ac5e2c4bbc1f6729e95d918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d9739be023a194e84ac5e2c4bbc1f6729e95d918/MountedObject.py |
if container_class or self._create_mount_points: | if container_class and self._create_mount_points: | def _traverseToMountedRoot(self, root, mount_parent): """Hook for getting the object to be mounted. """ params = self._v_mount_params if params is None: params = self._loadMountParams() real_root, real_path, container_class = params if real_root is None: real_root = 'Application' try: obj = root[real_root] except KeyError: if container_class or self._create_mount_points: # Create a database automatically. from OFS.Application import Application obj = Application() root[real_root] = obj # Get it into the database transaction.commit(1) else: raise | d9739be023a194e84ac5e2c4bbc1f6729e95d918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d9739be023a194e84ac5e2c4bbc1f6729e95d918/MountedObject.py |
self._init() | self._index=BTree() | def clear(self): | f8d4e017bcdc493e4f0cfb9aa5a2cf5f042df633 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8d4e017bcdc493e4f0cfb9aa5a2cf5f042df633/TextIndex.py |
def locked_in_version(self): return 0 | 09a53f7b22e8b7a3535198eed06430d5d91fc5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/09a53f7b22e8b7a3535198eed06430d5d91fc5a5/ApplicationManager.py |
||
def get_refcounts(self, n=100, t=(type(Fake), type(Acquisition.Implicit))): | _v_rcs=None _v_rst=None def refcount(self, n=None, t=(type(Fake), type(Acquisition.Implicit))): | def get_refcounts(self, n=100, t=(type(Fake), type(Acquisition.Implicit))): # get class refcount info | 09a53f7b22e8b7a3535198eed06430d5d91fc5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/09a53f7b22e8b7a3535198eed06430d5d91fc5a5/ApplicationManager.py |
pairs = map(lambda x: (x[1], '%s' % x[0].__name__), dict.items()) | pairs=[] append=pairs.append for ob, v in dict.items(): if hasattr(ob, '__module__'): name='%s.%s' % (ob.__module__, ob.__name__) else: name='%s' % ob.__name__ append((v, name)) | def get_refcounts(self, n=100, t=(type(Fake), type(Acquisition.Implicit))): # get class refcount info | 09a53f7b22e8b7a3535198eed06430d5d91fc5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/09a53f7b22e8b7a3535198eed06430d5d91fc5a5/ApplicationManager.py |
pairs=pairs[:n] | if n is not None: pairs=pairs[:n] | def get_refcounts(self, n=100, t=(type(Fake), type(Acquisition.Implicit))): # get class refcount info | 09a53f7b22e8b7a3535198eed06430d5d91fc5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/09a53f7b22e8b7a3535198eed06430d5d91fc5a5/ApplicationManager.py |
def refdict(self): rc=self.refcount() dict={} for v, n in rc: dict[n]=v return dict def rcsnapshot(self): self._v_rcs=self.refdict() self._v_rst=DateTime() def rcdate(self): return self._v_rst def rcdeltas(self): if self._v_rcs is None: self.rcsnapshot() nc=self.refdict() rc=self._v_rcs rd=[] for n, c in nc.items(): prev=rc[n] if c > prev: rd.append( (c - prev, (c, prev, n)) ) rd.sort() rd.reverse() return map(lambda n: {'name': n[1][2], 'delta': n[0], 'pc': n[1][1], 'rc': n[1][0]}, rd) | def get_refcounts(self, n=100, t=(type(Fake), type(Acquisition.Implicit))): # get class refcount info | 09a53f7b22e8b7a3535198eed06430d5d91fc5a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/09a53f7b22e8b7a3535198eed06430d5d91fc5a5/ApplicationManager.py |
|
if type(result) is type(''): result=RDB.File(StringIO(result),brain,self) | if type(result) is type(''): f=StringIO() f.write(result) result=RDB.File(f,brain,self) | def __call__(self, REQUEST=None, __ick__=None, src__=0, **kw): | 8e4cda08f82a28d426c6c1cd44b8a471b1de0bc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8e4cda08f82a28d426c6c1cd44b8a471b1de0bc4/DA.py |
if missing: raise self.MissingArgumentError, \ "The following arguments were omitted " \ " from the ZSQL method call: %s" % str(missing) | def _argdata(self, REQUEST): | cd7d2a453ba5a6f5f8d5c403d1addc6d5f520bb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cd7d2a453ba5a6f5f8d5c403d1addc6d5f520bb2/Aqueduct.py |
|
if REQUEST.get('raw'): | if REQUEST is not None and REQUEST.get('raw'): | def document_src(self, REQUEST=None, RESPONSE=None): """Return expanded document source.""" | 3381ed45101bfa02e3dd03b3ca7da2d3441500d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3381ed45101bfa02e3dd03b3ca7da2d3441500d3/ZopePageTemplate.py |
code = None, opt_args = [], *extras): | code = None, opt_args = [], extras = {}): | def __init__(self, mnem, class_name, base_class = '', code = None, opt_args = [], *extras): self.mnemonic = mnem self.class_name = class_name self.base_class = base_class if code: #If the user already made a CodeBlock, pick the parts from it if isinstance(code, CodeBlock): origCode = code.orig_code codeBlock = code else: origCode = code codeBlock = CodeBlock(code) compositeCode = '\n'.join([origCode] + [pair[1] for pair in extras]) compositeBlock = CodeBlock(compositeCode) for code_attr in compositeBlock.__dict__.keys(): setattr(self, code_attr, getattr(compositeBlock, code_attr)) for (key, snippet) in extras: setattr(self, key, CodeBlock(snippet).code) self.code = codeBlock.code self.orig_code = origCode else: self.constructor = '' self.flags = [] # Optional arguments are assumed to be either StaticInst flags # or an OpClass value. To avoid having to import a complete # list of these values to match against, we do it ad-hoc # with regexps. for oa in opt_args: if instFlagRE.match(oa): self.flags.append(oa) elif opClassRE.match(oa): self.op_class = oa else: error(0, 'InstObjParams: optional arg "%s" not recognized ' 'as StaticInst::Flag or OpClass.' % oa) | 7009d0e52339036e1b282b15a29e71863ada020c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/7009d0e52339036e1b282b15a29e71863ada020c/isa_parser.py |
compositeCode = '\n'.join([origCode] + [pair[1] for pair in extras]) | stringExtras = {} otherExtras = {} for (k, v) in extras.items(): if type(v) == str: stringExtras[k] = v else: otherExtras[k] = v compositeCode = "\n".join([origCode] + stringExtras.values()) | def __init__(self, mnem, class_name, base_class = '', code = None, opt_args = [], *extras): self.mnemonic = mnem self.class_name = class_name self.base_class = base_class if code: #If the user already made a CodeBlock, pick the parts from it if isinstance(code, CodeBlock): origCode = code.orig_code codeBlock = code else: origCode = code codeBlock = CodeBlock(code) compositeCode = '\n'.join([origCode] + [pair[1] for pair in extras]) compositeBlock = CodeBlock(compositeCode) for code_attr in compositeBlock.__dict__.keys(): setattr(self, code_attr, getattr(compositeBlock, code_attr)) for (key, snippet) in extras: setattr(self, key, CodeBlock(snippet).code) self.code = codeBlock.code self.orig_code = origCode else: self.constructor = '' self.flags = [] # Optional arguments are assumed to be either StaticInst flags # or an OpClass value. To avoid having to import a complete # list of these values to match against, we do it ad-hoc # with regexps. for oa in opt_args: if instFlagRE.match(oa): self.flags.append(oa) elif opClassRE.match(oa): self.op_class = oa else: error(0, 'InstObjParams: optional arg "%s" not recognized ' 'as StaticInst::Flag or OpClass.' % oa) | 7009d0e52339036e1b282b15a29e71863ada020c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/7009d0e52339036e1b282b15a29e71863ada020c/isa_parser.py |
for (key, snippet) in extras: | for (key, snippet) in stringExtras.items(): | def __init__(self, mnem, class_name, base_class = '', code = None, opt_args = [], *extras): self.mnemonic = mnem self.class_name = class_name self.base_class = base_class if code: #If the user already made a CodeBlock, pick the parts from it if isinstance(code, CodeBlock): origCode = code.orig_code codeBlock = code else: origCode = code codeBlock = CodeBlock(code) compositeCode = '\n'.join([origCode] + [pair[1] for pair in extras]) compositeBlock = CodeBlock(compositeCode) for code_attr in compositeBlock.__dict__.keys(): setattr(self, code_attr, getattr(compositeBlock, code_attr)) for (key, snippet) in extras: setattr(self, key, CodeBlock(snippet).code) self.code = codeBlock.code self.orig_code = origCode else: self.constructor = '' self.flags = [] # Optional arguments are assumed to be either StaticInst flags # or an OpClass value. To avoid having to import a complete # list of these values to match against, we do it ad-hoc # with regexps. for oa in opt_args: if instFlagRE.match(oa): self.flags.append(oa) elif opClassRE.match(oa): self.op_class = oa else: error(0, 'InstObjParams: optional arg "%s" not recognized ' 'as StaticInst::Flag or OpClass.' % oa) | 7009d0e52339036e1b282b15a29e71863ada020c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/7009d0e52339036e1b282b15a29e71863ada020c/isa_parser.py |
if value == Nxone: | if value == None: | def _convert(cls, value): if value == Nxone: return | 9fead747f5641021efc2bc240e62583607e8f06f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/9fead747f5641021efc2bc240e62583607e8f06f/config.py |
sob = [ base for base in bases \ if issubclass(base, ParamType) and base != ParamType ] if len(sob) == 1: | cnbase = [ base for base in bases if isConfigNode(base) ] if len(cnbase) == 1: | def __init__(cls, name, bases, dict): super(MetaConfigNode, cls).__init__(name, bases, dict) | ac547c64892f9b93817787cd3dcf5d63ba6e5521 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/ac547c64892f9b93817787cd3dcf5d63ba6e5521/config.py |
for key,val in sob[0]._values.iteritems(): | for key,val in cnbase[0]._values.iteritems(): | def __init__(cls, name, bases, dict): super(MetaConfigNode, cls).__init__(name, bases, dict) | ac547c64892f9b93817787cd3dcf5d63ba6e5521 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/ac547c64892f9b93817787cd3dcf5d63ba6e5521/config.py |
cls._params.parent = sob[0]._params cls._values.parent = sob[0]._values elif len(sob) > 1: | cls._params.parent = cnbase[0]._params cls._values.parent = cnbase[0]._values elif len(cnbase) > 1: | def __init__(cls, name, bases, dict): super(MetaConfigNode, cls).__init__(name, bases, dict) | ac547c64892f9b93817787cd3dcf5d63ba6e5521 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/ac547c64892f9b93817787cd3dcf5d63ba6e5521/config.py |
%s""" % str(sob)) | %s""" % str(cnbase)) | def __init__(cls, name, bases, dict): super(MetaConfigNode, cls).__init__(name, bases, dict) | ac547c64892f9b93817787cd3dcf5d63ba6e5521 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/ac547c64892f9b93817787cd3dcf5d63ba6e5521/config.py |
sim_seconds = source['sim_seconds'] | def disp(*args): print "%-35s %12s %12s %4s %5s %5s %5s %10s" % args | 29f50d934549f10b073a5492bd0d441d71534ace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/29f50d934549f10b073a5492bd0d441d71534ace/stats.py |
|
bps = etherdev.rxBandwidth + etherdev.txBandwidth | def disp(*args): print "%-35s %12s %12s %4s %5s %5s %5s %10s" % args | 29f50d934549f10b073a5492bd0d441d71534ace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/29f50d934549f10b073a5492bd0d441d71534ace/stats.py |
|
output.stat = packets / sim_seconds | output.stat = packets / source['sim_seconds'] | def display(): if options.graph: output.graph(command, options.graphdir, proxy) else: output.display(command, options.binned, options.printmode) | 29f50d934549f10b073a5492bd0d441d71534ace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/29f50d934549f10b073a5492bd0d441d71534ace/stats.py |
output.stat = bps / 1e9 | output.stat = (etherdev.rxBandwidth + etherdev.txBandwidth) / 1e9 | def display(): if options.graph: output.graph(command, options.graphdir, proxy) else: output.display(command, options.binned, options.printmode) | 29f50d934549f10b073a5492bd0d441d71534ace /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/29f50d934549f10b073a5492bd0d441d71534ace/stats.py |
self.inner_axes.set_ylim(self.ylim) | inner_axes.set_ylim(self.ylim) | def graph(self): if self.chartdata is None: raise AttributeError, "Data not set for bar chart!" | d50b6e524718a691b5b34b5bca83654ef8f0a66d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/d50b6e524718a691b5b34b5bca83654ef8f0a66d/barchart.py |
self.xsubticks.append('') inner_axes.set_xticklabels(self.xsubticks * cshape[2], fontsize=7, rotation=90) | xsubticks = list(self.xsubticks) + [ '' ] inner_axes.set_xticklabels(xsubticks * cshape[2], fontsize=7, rotation=30) | def graph(self): if self.chartdata is None: raise AttributeError, "Data not set for bar chart!" | d50b6e524718a691b5b34b5bca83654ef8f0a66d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/d50b6e524718a691b5b34b5bca83654ef8f0a66d/barchart.py |
disk.dir = joinpath('/n/zamp/z/ktlim/local/clean/linux', 'disks') | disk.dir = joinpath(system.dir, 'disks') | def system(): if not system.dir: try: path = env['M5_PATH'].split(':') except KeyError: path = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system' ] for system.dir in path: if os.path.isdir(system.dir): break else: raise ImportError, "Can't find a path to system files." if not binary.dir: binary.dir = joinpath(system.dir, 'binaries') if not disk.dir: disk.dir = joinpath('/n/zamp/z/ktlim/local/clean/linux', 'disks') if not script.dir: script.dir = joinpath(system.dir, 'boot') | e5b13138b1e045bb43a443882221b39d820553df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/e5b13138b1e045bb43a443882221b39d820553df/SysPaths.py |
scope = { '__file__' : sys.argv[0] } | def main(): import cc_main parse_args() done = False if options.copyright: done = True print info.LICENSE print if options.authors: done = True print 'Author information:' print print info.AUTHORS print if options.readme: done = True print 'Readme:' print print info.README print if options.release_notes: done = True print 'Release Notes:' print print info.RELEASE_NOTES print if done: sys.exit(0) if options.verbose >= 0: print "M5 Simulator System" print brief_copyright print print "M5 compiled %s" % cc_main.cvar.compileDate; print "M5 started %s" % datetime.now().ctime() print "M5 executing on %s" % socket.gethostname() # check to make sure we can find the listed script if not arguments or not os.path.isfile(arguments[0]): usage(2) # tell C++ about output directory cc_main.setOutputDir(options.outdir) # update the system path with elements from the -p option sys.path[0:0] = options.path import objects # set stats options objects.Statistics.text_file = options.stats_file # set debugging options objects.Debug.break_cycles = options.debug_break # set tracing options objects.Trace.flags = options.trace_flags objects.Trace.start = options.trace_start objects.Trace.file = options.trace_file objects.Trace.bufsize = options.trace_circlebuf objects.Trace.dump_on_exit = options.trace_dumponexit objects.Trace.ignore = options.trace_ignore # set execution trace options objects.ExecutionTrace.speculative = options.speculative objects.ExecutionTrace.print_cycle = options.print_cycle objects.ExecutionTrace.pc_symbol = options.print_symbol objects.ExecutionTrace.print_opclass = options.print_opclass objects.ExecutionTrace.print_thread = options.print_thread objects.ExecutionTrace.print_effaddr = options.print_effaddr objects.ExecutionTrace.print_data = options.print_data objects.ExecutionTrace.print_iregs = options.print_iregs objects.ExecutionTrace.print_fetchseq = options.print_fetch_seq objects.ExecutionTrace.print_cpseq = options.print_cpseq scope = { '__file__' : sys.argv[0] } sys.argv = arguments sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path exec("import readline", scope) execfile(sys.argv[0], scope) # once the script is done if options.interactive: interact = code.InteractiveConsole(scope) interact.interact("M5 Interactive Console") | 3218538740a6132273875f84ce0cb95a2c79a62d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/3218538740a6132273875f84ce0cb95a2c79a62d/main.py |
|
system = info.source.__dict__[options.system] | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populate() mydb.close() return if args[0] == 'init': if len(args) > 1: raise CommandException mydb.admin() mydb.create() mydb.connect() mydb.populate() mydb.close() return if args[0] == 'clean': if len(args) > 1: raise CommandException mydb.connect() mydb.clean() return raise CommandException import db, info info.source = db.Database() info.source.host = options.host info.source.db = options.db info.source.passwd = options.passwd info.source.user = options.user info.source.connect() info.source.update_dict(globals()) system = info.source.__dict__[options.system] if type(options.get) is str: info.source.get = options.get if options.runs is None: runs = info.source.allRuns else: rx = re.compile(options.runs) runs = [] for run in info.source.allRuns: if rx.match(run.name): runs.append(run) info.display_run = runs[0].run if command == 'runs': user = None opts, args = getopts(args, '-u') if len(args): raise CommandException for o,a in opts: if o == '-u': user = a info.source.listRuns(user) return if command == 'stats': if len(args) == 0: info.source.listStats() elif len(args) == 1: info.source.listStats(args[0]) else: raise CommandException return if command == 'stat': if len(args) != 1: raise CommandException stats = info.source.getStat(args[0]) for stat in stats: if options.graph: graphdata(runs, stat.name, stat.name, stat) else: if options.binned: print 'kernel ticks' stat.bins = 'kernel' printdata(runs, stat) print 'idle ticks' stat.bins = 'idle' printdata(runs, stat) print 'user ticks' stat.bins = 'user' printdata(runs, stat) print 'interrupt ticks' stat.bins = 'user' printdata(runs, stat) print 'total ticks' stat.bins = None print stat.name printdata(runs, stat) return if command == 'bins': if len(args) == 0: info.source.listBins() elif len(args) == 1: info.source.listBins(args[0]) else: raise CommandException return if command == 'formulas': if len(args) == 0: info.source.listFormulas() elif len(args) == 1: info.source.listFormulas(args[0]) else: raise CommandException return if command == 'samples': if len(args): raise CommandException info.source.listTicks(runs) return if len(args): raise CommandException if command == 'usertime': import copy kernel = copy.copy(system.full_cpu.numCycles) kernel.bins = 'kernel' user = copy.copy(system.full_cpu.numCycles) user.bins = 'user' if options.graph: graphdata(runs, 'usertime', 'User Fraction', user / system.full_cpu.numCycles) else: printdata(runs, user / system.full_cpu.numCycles) return if command == 'ticks': if options.binned: print 'kernel ticks' system.full_cpu.numCycles.bins = 'kernel' printdata(runs, system.full_cpu.numCycles) print 'idle ticks' system.full_cpu.numCycles.bins = 'idle' printdata(runs, system.full_cpu.numCycles) print 'user ticks' system.full_cpu.numCycles.bins = 'user' printdata(runs, system.full_cpu.numCycles) print 'total ticks' system.full_cpu.numCycles.bins = None printdata(runs, system.full_cpu.numCycles) return if command == 'packets': packets = system.tsunami.etherdev.rxPackets if options.graph: graphdata(runs, 'packets', 'Packets', packets) else: printdata(runs, packets) return if command == 'ppt' or command == 'tpp': ppt = system.tsunami.etherdev.rxPackets / sim_ticks printdata(runs, ppt, command == 'tpp') return if command == 'pps': pps = system.tsunami.etherdev.rxPackets / sim_seconds if options.graph: graphdata(runs, 'pps', 'Packets/s', pps) else: printdata(runs, pps) return if command == 'bpt' or command == 'tpb': bytes = system.tsunami.etherdev.rxBytes + system.tsunami.etherdev.txBytes bpt = bytes / sim_ticks * 8 if options.graph: graphdata(runs, 'bpt', 'bps / Hz', bpt) else: printdata(runs, bpt, command == 'tpb') return if command == 'bptb' or command == 'tpbb': bytes = system.tsunami.etherdev.rxBytes + system.tsunami.etherdev.txBytes print 'kernel stats' bytes.bins = 'kernel' printdata(runs, bytes / ticks) print 'idle stats' bytes.bins = 'idle' printdata(runs, bytes / ticks) print 'user stats' bytes.bins = 'user' printdata(runs, bytes / ticks) return if command == 'bytes': stat = system.tsunami.etherdev.rxBytes + system.tsunami.etherdev.txBytes if options.binned: print '%s kernel stats' % stat.name stat.bins = 'kernel' printdata(runs, stat) print '%s idle stats' % stat.name stat.bins = 'idle' printdata(runs, stat) print '%s user stats' % stat.name stat.bins = 'user' printdata(runs, stat) print '%s total stats' % stat.name stat.bins = None printdata(runs, stat) return if command == 'rxbps': gbps = system.tsunami.etherdev.rxBandwidth / 1e9 if options.graph: graphdata(runs, 'rxbps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'txbps': gbps = system.tsunami.etherdev.txBandwidth / 1e9 if options.graph: graphdata(runs, 'txbps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'bps': rxbps = system.tsunami.etherdev.rxBandwidth txbps = system.tsunami.etherdev.txBandwidth gbps = (rxbps + txbps) / 1e9 if options.graph: graphdata(runs, 'bps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'misses': stat = system.L2.overall_mshr_misses if options.binned: print '%s kernel stats' % stat.name stat.bins = 'kernel' printdata(runs, stat) print '%s idle stats' % stat.name stat.bins = 'idle' printdata(runs, stat) print '%s user stats' % stat.name stat.bins = 'user' printdata(runs, stat) print '%s total stats' % stat.name stat.bins = None if options.graph: graphdata(runs, 'misses', 'Overall MSHR Misses', stat) else: printdata(runs, stat) return if command == 'mpkb': misses = system.L2.overall_mshr_misses rxbytes = system.tsunami.etherdev.rxBytes txbytes = system.tsunami.etherdev.txBytes if options.binned: print 'mpkb kernel stats' misses.bins = 'kernel' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb idle stats' misses.bins = 'idle' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb user stats' misses.bins = 'user' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb total stats' mpkb = misses / ((rxbytes + txbytes) / 1024) misses.bins = None if options.graph: graphdata(runs, 'mpkb', 'Misses / KB', mpkb) else: printdata(runs, mpkb) return if command == 'execute': printdata(runs, system.full_cpu.ISSUE__count) return if command == 'commit': printdata(runs, system.full_cpu.COM__count) return if command == 'fetch': printdata(runs, system.full_cpu.FETCH__count) return if command == 'bpp': ed = system.tsunami.etherdev bpp = (ed.rxBytes + ed.txBytes) / (ed.rxPackets + ed.txPackets) if options.graph: graphdata(runs, 'bpp', 'Bytes / Packet', bpp) else: printdata(runs, bpp) return if command == 'rxbpp': bpp = system.tsunami.etherdev.rxBytes / system.tsunami.etherdev.rxPackets if options.graph: graphdata(runs, 'rxbpp', 'Receive Bytes / Packet', bpp) else: printdata(runs, bpp) return if command == 'txbpp': bpp = system.tsunami.etherdev.txBytes / system.tsunami.etherdev.txPackets if options.graph: graphdata(runs, 'txbpp', 'Transmit Bytes / Packet', bpp) else: printdata(runs, bpp) return if command == 'rtp': rtp = system.tsunami.etherdev.rxPackets / system.tsunami.etherdev.txPackets if options.graph: graphdata(runs, 'rtp', 'rxPackets / txPackets', rtp) else: printdata(runs, rtp) return if command == 'rtb': rtb = system.tsunami.etherdev.rxBytes / system.tsunami.etherdev.txBytes if options.graph: graphdata(runs, 'rtb', 'rxBytes / txBytes', rtb) else: printdata(runs, rtb) return raise CommandException | ee962a6b0bf71b9ca8ce0b3cadc17938266fa162 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/ee962a6b0bf71b9ca8ce0b3cadc17938266fa162/stats.py |
|
if isinstance(obj, BaseProxy): | if isinstance(obj, (BaseProxy, EthernetAddr)): | def isproxy(obj): if isinstance(obj, BaseProxy): return True elif isinstance(obj, (list, tuple)): for v in obj: if isproxy(v): return True return False | 38da461fd79bcfd3eed683076f1ba40465af775e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/38da461fd79bcfd3eed683076f1ba40465af775e/config.py |
__metaclass__ = Singleton | def IncEthernetAddr(addr, val = 1): bytes = map(lambda x: int(x, 16), addr.split(':')) bytes[5] += val for i in (5, 4, 3, 2, 1): val,rem = divmod(bytes[i], 256) bytes[i] = rem if val == 0: break bytes[i - 1] += val assert(bytes[0] <= 255) return ':'.join(map(lambda x: '%02x' % x, bytes)) | 38da461fd79bcfd3eed683076f1ba40465af775e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/38da461fd79bcfd3eed683076f1ba40465af775e/config.py |
|
self.value = self.addr self.addr = IncEthernetAddr(self.addr, inc) | self.value = NextEthernetAddr.addr NextEthernetAddr.addr = IncEthernetAddr(NextEthernetAddr.addr, inc) | def __init__(self, inc = 1): self.value = self.addr self.addr = IncEthernetAddr(self.addr, inc) | 38da461fd79bcfd3eed683076f1ba40465af775e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/38da461fd79bcfd3eed683076f1ba40465af775e/config.py |
self.value = self.value().value return self.value | return self.addr else: return self.value | def __str__(self): if self.value == NextEthernetAddr: self.value = self.value().value return self.value | 38da461fd79bcfd3eed683076f1ba40465af775e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/38da461fd79bcfd3eed683076f1ba40465af775e/config.py |
def unproxy(self,base): | def unproxy(self, base): | def unproxy(self,base): return self | 38da461fd79bcfd3eed683076f1ba40465af775e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/38da461fd79bcfd3eed683076f1ba40465af775e/config.py |
if self.isMem(): self.is_src = '' self.is_dest = '' | def finalize(self): self.flags = self.getFlags() self.constructor = self.makeConstructor() self.op_decl = self.makeDecl() | 485568efa972db7fc27f34708d9bc3a2f19871de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/485568efa972db7fc27f34708d9bc3a2f19871de/isa_parser.py |
|
def outputDot(self, dot): | 257be7434193c8a06e024f5fa9eca151025bda1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/257be7434193c8a06e024f5fa9eca151025bda1e/config.py |
||
def __setattr__(self, attr, value): if attr != 'ptype': raise AttributeError, \ 'Attribute %s not available in %s' % (attr, self.__class__) super(ParamFactory, self).__setattr__(attr, value) | 257be7434193c8a06e024f5fa9eca151025bda1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/257be7434193c8a06e024f5fa9eca151025bda1e/config.py |
||
def _string(cls, value): return value | 257be7434193c8a06e024f5fa9eca151025bda1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/257be7434193c8a06e024f5fa9eca151025bda1e/config.py |
||
def _string(): return 'NULL' | 257be7434193c8a06e024f5fa9eca151025bda1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/257be7434193c8a06e024f5fa9eca151025bda1e/config.py |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.