Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class AbsIntList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','absint.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('absint_list.html')
return template.render(data,project=proj)
class BlockList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','blockdata.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('block_list.html')
return template.render(data,project=proj)
class DocPage(BasePage):
"""
Abstract class to be inherited by all pages for items in the code.
class IndexPage(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'index.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '.'
ford.sourceform.set_base_url('.')
ford.pagetree.set_base_url('.')
template = env.get_template('index.html')
return template.render(data,project=proj,proj_docs=obj)
class SearchPage(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'search.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '.'
ford.sourceform.set_base_url('.')
ford.pagetree.set_base_url('.')
template = env.get_template('search.html')
return template.render(data,project=proj)
class ProcList(BasePage):
@property
def outfile(self):
class FileList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','files.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('file_list.html')
return template.render(data,project=proj)
class ModList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','modules.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('mod_list.html')
return template.render(data,project=proj)
class ProgList(BasePage):
@property
def outfile(self):
class TypeList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','types.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('types_list.html')
return template.render(data,project=proj)
class AbsIntList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','absint.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('absint_list.html')
return template.render(data,project=proj)
class BlockList(BasePage):
@property
def outfile(self):
def writeout(self):
out = open(self.outfile,'wb')
out.write(self.html.encode('utf8'))
out.close()
def render(self, data, proj, obj):
"""
Get the HTML for the page. This method must be overridden. Arguments
are proj_data, project object, and item in the code which the
page documents.
"""
raise NotImplementedError("Should not instantiate BasePage type")
class IndexPage(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'index.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '.'
ford.sourceform.set_base_url('.')
ford.pagetree.set_base_url('.')
template = env.get_template('index.html')
return template.render(data,project=proj,proj_docs=obj)
class SearchPage(BasePage):
@property
def outfile(self):
class ModList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','modules.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('mod_list.html')
return template.render(data,project=proj)
class ProgList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','programs.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('prog_list.html')
return template.render(data,project=proj)
class TypeList(BasePage):
@property
def outfile(self):
class SearchPage(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'search.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '.'
ford.sourceform.set_base_url('.')
ford.pagetree.set_base_url('.')
template = env.get_template('search.html')
return template.render(data,project=proj)
class ProcList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','procedures.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('proc_list.html')
return template.render(data,project=proj)
class FileList(BasePage):
@property
def outfile(self):
class BlockList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','blockdata.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('block_list.html')
return template.render(data,project=proj)
class DocPage(BasePage):
"""
Abstract class to be inherited by all pages for items in the code.
"""
@property
def loc(self):
return self.obj.get_dir() + '/' + self.obj.ident + '.html'
@property
def outfile(self):
return os.path.join(self.out_dir,self.obj.get_dir(),self.obj.ident+'.html')
class FilePage(DocPage):
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('prog_page.html')
return template.render(data,program=obj,project=proj)
class BlockPage(DocPage):
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('block_page.html')
return template.render(data,blockdat=obj,project=proj)
class PagetreePage(BasePage):
@property
def loc(self):
return 'page/' + self.obj.location + '/' + self.obj.filename + '.html'
@property
def outfile(self):
return os.path.join(self.out_dir,'page',self.obj.location,self.obj.filename+'.html')
def render(self,data,proj,obj):
if data['relative']:
base_url = ('../'*len(obj.hierarchy))[:-1]
if obj.filename == 'index':
if len(obj.hierarchy) > 0:
base_url = base_url + '/..'
else:
base_url = '..'
class ProgList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','programs.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('prog_list.html')
return template.render(data,project=proj)
class TypeList(BasePage):
@property
def outfile(self):
return os.path.join(self.out_dir,'lists','types.html')
def render(self,data,proj,obj):
if data['relative']:
data['project_url'] = '..'
ford.sourceform.set_base_url('..')
ford.pagetree.set_base_url('..')
template = env.get_template('types_list.html')
return template.render(data,project=proj)
class AbsIntList(BasePage):
@property
def outfile(self):