#!/usr/bin/env python3 """ Make backend documentation """ import os import subprocess marker = "\n" % (backend, backend) out_file.write(start_full) output_docs(backend, out_file) out_file.write(stop+" -->\n") altered = True if not in_docs: out_file.write(line) if in_docs: if stop in line: in_docs = False os.rename(doc_file, doc_file+"~") os.rename(new_file, doc_file) if not altered: raise ValueError("Didn't find '%s' markers for in %s" % (start, doc_file)) if __name__ == "__main__": failed, success = 0, 0 for backend in find_backends(): try: alter_doc(backend) except Exception as e: print("Failed adding docs for %s backend: %s" % (backend, e)) failed += 1 else: success += 1 print("Added docs for %d backends with %d failures" % (success, failed))