Пример #1
0
 def build_callsite(self, dotted_name, call_site, index):
     tbtag = H.Content(self.gen_traceback(dotted_name, reversed(call_site)))
     parent_dotted_name, _ = split_of_last_part(dotted_name)
     nav = self.build_navigation(parent_dotted_name, False)
     id = 'callsite_%s_%s' % (dotted_name, index)
     reltargetpath = "api/%s.html" % (id,)
     self.linker.set_link(id, reltargetpath)
     href = self.linker.get_lazyhref(id)
     self.write_page('call site %s for %s' % (index, dotted_name),
                     reltargetpath, tbtag, nav)
     sourcefile = call_site[0].filename
     sourcepath = get_rel_sourcepath(self.projpath, sourcefile, sourcefile)
     return H.CallStackLink(sourcepath, call_site[0].lineno + 1, href)
Пример #2
0
 def build_function_pages(self, method_dotted_names):
     passed = []
     for dotted_name in sorted(method_dotted_names):
         if self.capture:
             self.capture.err.writeorg('.')
         # XXX should we create a build_function_view instead?
         parent_dotted_name, _ = split_of_last_part(dotted_name)
         sibling_dotted_names = self.namespace_tree[parent_dotted_name]
         tag = H.Content(self.build_callable_view(dotted_name))
         nav = self.build_navigation(dotted_name, False)
         reltargetpath = "api/%s.html" % (dotted_name,)
         self.linker.set_link(dotted_name, reltargetpath)
         title = '%s API' % (dotted_name,)
         rev = self.get_revision(dotted_name)
         if rev:
             title += ' [rev. %s]' % (rev,)
         self.write_page(title, reltargetpath, tag, nav)
     return passed
Пример #3
0
 def build_class_pages(self, classes_dotted_names):
     passed = []
     for dotted_name in sorted(classes_dotted_names):
         if self.capture:
             self.capture.err.writeorg('.')
         parent_dotted_name, _ = split_of_last_part(dotted_name)
         try:
             sibling_dotted_names = self.namespace_tree[parent_dotted_name]
         except KeyError:
             # no siblings (built-in module or sth)
             sibling_dotted_names = []
         tag = H.Content(self.build_class_view(dotted_name))
         nav = self.build_navigation(dotted_name, False)
         reltargetpath = "api/%s.html" % (dotted_name,)
         self.linker.set_link(dotted_name, reltargetpath)
         title = '%s API' % (dotted_name,)
         rev = self.get_revision(dotted_name)
         if rev:
             title += ' [rev. %s]' % (rev,)
         self.write_page(title, reltargetpath, tag, nav)
     return passed