aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Bonnici <marc.bonnici@arm.com>2017-08-14 17:19:03 +0100
committerMarc Bonnici <marc.bonnici@arm.com>2017-08-16 16:24:38 +0100
commitf194ef281be2d56dcdd4f07b43232690d2047b4a (patch)
treefa97a83aaa6abf1443d62c694f8e169c3890b34b
parent4d607b46c531e747911d59e0edff740b3a6c893c (diff)
Documentation/Builds: Delete previously generated docs
As the Makefile is no longer responsible for calling the extension and instrumentation documentation ensure any previously generated documentation is deleted from the respective build file.
-rwxr-xr-xdoc/build_extension_docs.py4
-rwxr-xr-xdoc/build_instrumentation_method_map.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/doc/build_extension_docs.py b/doc/build_extension_docs.py
index bee61cdd..f0569d0a 100755
--- a/doc/build_extension_docs.py
+++ b/doc/build_extension_docs.py
@@ -17,6 +17,7 @@
import os
import sys
+import shutil
from wlauto import ExtensionLoader
from wlauto.utils.doc import get_rst_from_extension, underline
@@ -30,6 +31,9 @@ def generate_extension_documentation(source_dir, outdir, ignore_paths):
loader = ExtensionLoader(keep_going=True)
loader.clear()
loader.update(paths=[source_dir], ignore_paths=ignore_paths)
+ if os.path.exists(outdir):
+ shutil.rmtree(outdir)
+ os.makedirs(outdir)
for ext_type in loader.extension_kinds:
if not ext_type in GENERATE_FOR:
continue
diff --git a/doc/build_instrumentation_method_map.py b/doc/build_instrumentation_method_map.py
index a9438c92..7dc61c92 100755
--- a/doc/build_instrumentation_method_map.py
+++ b/doc/build_instrumentation_method_map.py
@@ -38,6 +38,8 @@ def generate_instrumentation_method_map(outfile):
headers=['method name', 'signal'], align='<<')
priority_table = format_simple_table([(escape_trailing_underscore(k), v) for k, v in PRIORITY_MAP.iteritems()],
headers=['prefix', 'priority'], align='<>')
+ if os.path.isfile(outfile):
+ os.unlink(outfile)
with open(OUTPUT_TEMPLATE_FILE) as fh:
template = string.Template(fh.read())
with open(outfile, 'w') as wfh: