diff --git a/docs/autogen_magics.py b/docs/autogen_magics.py index d119e2b..1b94fd6 100644 --- a/docs/autogen_magics.py +++ b/docs/autogen_magics.py @@ -9,7 +9,7 @@ magics = shell.magics_manager.magics def _strip_underline(line): chars = set(line.strip()) - if len(chars) == 1 and ('-' in chars or '=' in chars): + if len(chars) == 1 and ("-" in chars or "=" in chars): return "" else: return line @@ -31,7 +31,7 @@ output = [ # Case insensitive sort by name def sortkey(s): return s[0].lower() -for name, func in sorted(magics['line'].items(), key=sortkey): +for name, func in sorted(magics["line"].items(), key=sortkey): if isinstance(func, Alias) or isinstance(func, MagicAlias): # Aliases are magics, but shouldn't be documented here # Also skip aliases to other magics @@ -47,11 +47,11 @@ output.extend([ "", ]) -for name, func in sorted(magics['cell'].items(), key=sortkey): +for name, func in sorted(magics["cell"].items(), key=sortkey): if name == "!": # Special case - don't encourage people to use %%! continue - if func == magics['line'].get(name, 'QQQP'): + if func == magics["line"].get(name, "QQQP"): # Don't redocument line magics that double as cell magics continue if isinstance(func, MagicAlias): @@ -62,6 +62,6 @@ for name, func in sorted(magics['cell'].items(), key=sortkey): ""]) src_path = Path(__file__).parent -dest = src_path.joinpath('source', 'interactive', 'magics-generated.txt') +dest = src_path.joinpath("source", "interactive", "magics-generated.txt") with open(dest, "w") as f: f.write("\n".join(output))