def ft_statements(self) -> str: s = StringIO() s.write('\n') path_wildcard = os.path.join(get_template_dir(), 'csd_ft_*.txt') for ft in glob(path_wildcard): with open(ft, 'r') as f: s.write(preprocess_csd_code(f.read())) s.write('\n') return s.getvalue()
def udo_defs(self): udo_src = {u.get_name(): u.get_src() for u in self.udos} names = sorted(udo_src.keys()) return '\n\n'.join([preprocess_csd_code(udo_src[n]) for n in names]) + '\n'
def footer(self) -> str: path = get_template_path('csd_footer') with open(path, 'r') as f: return preprocess_csd_code(f.read()) + '\n'