diff --git a/docs/autogen_config.py b/docs/autogen_config.py index ec24392..98d13d3 100755 --- a/docs/autogen_config.py +++ b/docs/autogen_config.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -from os.path import join, dirname, abspath import inspect from pathlib import Path from IPython.terminal.ipapp import TerminalIPythonApp @@ -8,9 +7,9 @@ from ipykernel.kernelapp import IPKernelApp from traitlets import Undefined from collections import defaultdict -here = abspath(dirname(__file__)) -options = join(here, 'source', 'config', 'options') -generated = join(options, 'config-generated.txt') +here = (Path(__file__)).parent +options = here / "source" / "config" / "options" +generated = options / "config-generated.txt" import textwrap indent = lambda text,n: textwrap.indent(text,n*' ') @@ -102,11 +101,11 @@ def reverse_aliases(app): def write_doc(name, title, app, preamble=None): trait_aliases = reverse_aliases(app) - filename = join(options, name+'.rst') - with open(filename, 'w') as f: - f.write(title + '\n') - f.write(('=' * len(title)) + '\n') - f.write('\n') + filename = options / (name + ".rst") + with open(filename, "w") as f: + f.write(title + "\n") + f.write(("=" * len(title)) + "\n") + f.write("\n") if preamble is not None: f.write(preamble + '\n\n') #f.write(app.document_config_options())