def __init__(self, tree, filepath, dstpath, blob, resmap, conn = None): # Read and expand all templates self.html_header = tree.getTemplateFile("dxr-header.html") self.html_footer = tree.getTemplateFile("dxr-footer.html") self.html_sidebar_header = tree.getTemplateFile("dxr-sidebar-header.html") self.html_sidebar_footer = tree.getTemplateFile("dxr-sidebar-footer.html") self.html_main_header = tree.getTemplateFile("dxr-main-header.html") self.html_main_footer = tree.getTemplateFile("dxr-main-footer.html") self.source = dxr.readFile(filepath) self.virtroot = tree.virtroot self.treename = tree.tree self.filename = os.path.basename(filepath) self.filepath = filepath self.srcroot = tree.sourcedir self.dstpath = os.path.normpath(dstpath) self.srcpath = filepath.replace(self.srcroot + '/', '') self.show_sidebar = False self.blob = blob self.resmap = resmap self.tree = tree self.conn = conn # Config info used by dxr.js self.globalScript = ['var virtroot = "%s", tree = "%s";' % (self.virtroot, self.treename)]
def ensureHtmlifier(blob, srcpath, treecfg, conn=None, dbpath=None): global htmlifier_current_path global htmlifier_current if srcpath != htmlifier_current_path: htmlifier_current_path = srcpath if dbpath is None: dbpath = srcpath htmlifier_current = CxxHtmlifier(blob, dbpath, treecfg, conn) htmlifier_current.tokenizer = CppTokenizer(dxr.readFile(srcpath)) return htmlifier_current
def __init__(self, tree, filepath, dstpath, blob, resmap, conn=None, dbpath=None): # Read and expand all templates self.html_header = tree.getTemplateFile("dxr-header.html") self.html_footer = tree.getTemplateFile("dxr-footer.html") self.html_sidebar_header = tree.getTemplateFile( "dxr-sidebar-header.html") self.html_sidebar_footer = tree.getTemplateFile( "dxr-sidebar-footer.html") self.html_main_header = tree.getTemplateFile("dxr-main-header.html") self.html_main_footer = tree.getTemplateFile("dxr-main-footer.html") self.source = dxr.readFile(filepath) self.virtroot = tree.virtroot self.treename = tree.tree self.filename = os.path.basename(filepath) self.filepath = filepath self.srcroot = tree.sourcedir self.dstpath = os.path.normpath(dstpath) self.srcpath = filepath.replace(self.srcroot + '/', '') self.dbpath = dbpath self.show_sidebar = False self.blob = blob self.resmap = resmap self.tree = tree self.conn = conn # Config info used by dxr.js self.globalScript = [ 'var virtroot = "%s", tree = "%s";' % (self.virtroot, self.treename) ]
def __init__(self, blob, srcpath, treecfg): self.source = dxr.readFile(srcpath) self.srcpath = srcpath.replace(treecfg.sourcedir + '/', '') self.blob_file = blob["byfile"].get(self.srcpath, None) self.blob = blob