def dumpContext(self, context): url = self.contextURL(context) o = XMLOutput(open(url, 'w')) o.url = url with o.scope('html'): with o.scope('head'): with o.scope('title'): o << context.signature.code o << ' - ' o << id(context) with o.scope('body'): with o.scope('p'): o << '[' with o.scope('a', href='index.html'): o << "Index" o << ']' o.endl() with o.scope('p'): self.displayContext(context, o, link=False) self.fold(context, o) self.code(context, o) self.criticalOps(context, o) self.invokesIn(context, o) self.invokesOut(context, o) self.locals(context, o) self.objects(context, o) self.constraints(context.constraints, o)
def index(self, contexts, root): def forward(context): return set([invoke.dst for invoke in context.invokeOut.itervalues()]) idoms = dominator.findIDoms([root], forward) tree = dominator.treeFromIDoms(idoms) url = os.path.join(self.directory, 'index.html') o = XMLOutput(open(url, 'w')) o.url = url self.dumpTree(None, tree, o)