Changeset 9
- Timestamp:
- 10/02/07 03:10:26 (22 months ago)
- Files:
-
- 1 modified
-
trunk/pycallgraph.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pycallgraph.py
r8 r9 44 44 } 45 45 settings = { 46 'node_attributes': { 47 'label': r'%(func)s\ncalls: %(hits)i', 48 'color': '%(col)s', 49 }, 46 50 'node_color': lambda calls, : '%f %f %f' % (calls / 2 + .5, calls, 0.9), 47 51 'edge_color': lambda calls, : '%f %f %f' % (calls / 2 + .5, calls, 0.7), … … 98 102 else: 99 103 if class_name in settings['exclude_class']: 100 print 'exclude_class', class_name101 104 dont_keep = True 102 105 class_name += '.' … … 155 158 frac = float(hits) / func_count_max 156 159 col = settings['node_color'](frac) 157 grp = func.split('.', 1)[0]158 #ret.append('"%(func)s" [label="%(func)s\\n%(hits)i calls", color = "%(col)s", group = "%(grp)s"]' % locals())159 ret.append( '"%(func)s" [label="%(func)s\\ncalls: %(hits)i", color = "%(col)s"]'% locals())160 attribs = ['%s="%s"' % a for a in settings['node_attributes'].items()] 161 node_str = '"%s" [%s];' % (func, ','.join(attribs)) 162 ret.append(node_str % locals()) 160 163 for fr_key, fr_val in call_dict.items(): 161 164 if fr_key == '': … … 167 170 ret.append('"%s"->"%s" %s' % (fr_key, to_key, edge)) 168 171 ret.append('}') 169 print '\n'.join(ret)170 172 return '\n'.join(ret) 171 173