コード例 #1
0
 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()
コード例 #2
0
 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'
コード例 #3
0
 def footer(self) -> str:
     path = get_template_path('csd_footer')
     with open(path, 'r') as f:
         return preprocess_csd_code(f.read()) + '\n'