From 20c23763c1c75070c5006d539a9a0274dd28c2c9 Mon Sep 17 00:00:00 2001 From: Pieter Donker <donker@astron.nl> Date: Thu, 16 Mar 2017 12:44:02 +0000 Subject: [PATCH] Task #893 backup --- .../prestudy/YAML/make_documentation.py | 87 ------------------- 1 file changed, 87 deletions(-) delete mode 100755 tools/oneclick/prestudy/YAML/make_documentation.py diff --git a/tools/oneclick/prestudy/YAML/make_documentation.py b/tools/oneclick/prestudy/YAML/make_documentation.py deleted file mode 100755 index 0a5cce3150..0000000000 --- a/tools/oneclick/prestudy/YAML/make_documentation.py +++ /dev/null @@ -1,87 +0,0 @@ -#! /usr/bin/env python -""" -Make automatic documentation - -""" - -import sys -import os -import argparse -import subprocess -import traceback - -from py_mm_lib import * - -import common as cm - - -def main(): - root_dir = os.path.expandvars('$RADIOHDL/tools/oneclick/prestudy/YAML') - peri_lib = PeripheralLibrary(root_dir, "peripheral.yaml") - - data= {"system": "demo", "peripheral": "peri1", "description": "een iets lagere help tekst"} - make_documentation(data) - return "Normal ending" - - -def make_documentation(data): - """ - \vspace{1cm} - """ - header = \ -r''' -\documentclass{article} -\title{VHDL documentation} -\date{-now-} -\begin{document} -\textbf{\huge Documentation of %(system)s \\} -\\ -''' - footer= \ -r''' -\end{document} -''' - - content = \ -r''' -\textbullet \hspace{0.5cm} \textbf{%(peripheral)s \\} -%(description)s \\ -''' - with open('doc.tex','w') as f: - f.write(header%data) - f.write(content%data) - f.write(footer%data) - - proc = subprocess.Popen(['pdflatex', 'doc.tex']) - proc.communicate() - - os.unlink('doc.tex') - os.unlink('doc.aux') - os.unlink('doc.log') - - return - -if __name__ == "__main__": - # setup first log system before importing other user libraries - program_name = sys.argv[0].split('/')[-1].split('.')[0] - mylogger.set_logfile_name(name=program_name) - mylogger.set_stdout_log_level('INFO') - mylogger.set_file_log_level('DEBUG') - - parser = argparse.ArgumentParser() - parser.add_argument('-s', '--system', action='store_true', default=False, help='add system documentation') - parser.add_argument('-p', '--peripheral', action='store_true', default=False, help='add peripheral documentation') - parser.add_argument('-f', '--file', required=True, help='yaml file to generate documentation for.') - args = parser.parse_args() - - response = None - try: - response = main() - except: - logger.error('Program fault, reporting and cleanup') - logger.error('Caught %s', str(sys.exc_info()[0])) - logger.error(str(sys.exc_info()[1])) - logger.error('TRACEBACK:\n%s', traceback.format_exc()) - logger.error('Aborting NOW') - sys.exit("ERROR") - sys.exit(response) -- GitLab