From 9d87a9561766783f49fadaac62bd16811a7188a5 Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 6 Feb 2012 07:29:53 +0000 Subject: [PATCH] Implementation of the "0020839: EDF 1370 DOC : Update of the TUI features documentation / help(aMethod)" issue. --- salome_adm/cmake_files/Makefile.am | 2 ++ .../cmake_files/prepare_generating_doc.py | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 salome_adm/cmake_files/prepare_generating_doc.py diff --git a/salome_adm/cmake_files/Makefile.am b/salome_adm/cmake_files/Makefile.am index b66106db8..50d715e45 100644 --- a/salome_adm/cmake_files/Makefile.am +++ b/salome_adm/cmake_files/Makefile.am @@ -41,3 +41,5 @@ FindSWIG.cmake \ FindSPHINX.cmake \ install_python_from_idl.cmake \ install_and_compile_python_file.cmake + +bin_SCRIPTS = prepare_generating_doc.py diff --git a/salome_adm/cmake_files/prepare_generating_doc.py b/salome_adm/cmake_files/prepare_generating_doc.py new file mode 100755 index 000000000..5992979f3 --- /dev/null +++ b/salome_adm/cmake_files/prepare_generating_doc.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import sys, re +outfile = open(sys.argv[1], 'wb') +isCom = False +for line in open(sys.argv[2], 'rb').readlines(): + if re.match('class '+sys.argv[3]+'DC', line): + continue + n = line.find('"""') + n1 = line[(n+2):].find('"""') + if (n > -1) and (n1 > -1): + continue + if isCom: + if n > -1: + isCom = False + continue + else: + if n > -1: + isCom = True + continue + line = re.sub(r'^\s+#', '#', line) + line = re.sub(r'^\s+def', 'def', line) + line = re.sub(sys.argv[3]+'DC', sys.argv[3], line) + outfile.write(line) +outfile.close() \ No newline at end of file -- 2.39.2