diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-08-29 21:23:43 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-09-08 20:15:56 +0200 |
commit | a4f4379c44c7f13bc9e44bc01504077af1f3a338 (patch) | |
tree | 6f969b023a4311c7bad7b1dbdd61fa845cadfef3 /mesonbuild/scripts/gtkdochelper.py | |
parent | 0d57e307b2fea541a9ee368873431fe224e5c982 (diff) | |
download | meson-a4f4379c44c7f13bc9e44bc01504077af1f3a338.zip meson-a4f4379c44c7f13bc9e44bc01504077af1f3a338.tar.gz meson-a4f4379c44c7f13bc9e44bc01504077af1f3a338.tar.bz2 |
typing: fully annotate scripts
Diffstat (limited to 'mesonbuild/scripts/gtkdochelper.py')
-rw-r--r-- | mesonbuild/scripts/gtkdochelper.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py index 812604a..86949e5 100644 --- a/mesonbuild/scripts/gtkdochelper.py +++ b/mesonbuild/scripts/gtkdochelper.py @@ -18,6 +18,7 @@ import shutil import argparse from ..mesonlib import MesonException, Popen_safe, is_windows, is_cygwin, split_args from . import destdir_join +import typing as T parser = argparse.ArgumentParser() @@ -50,7 +51,7 @@ for tool in ['scan', 'scangobj', 'mkdb', 'mkhtml', 'fixxref']: program_name = 'gtkdoc-' + tool parser.add_argument('--' + program_name, dest=program_name.replace('-', '_')) -def gtkdoc_run_check(cmd, cwd, library_paths=None): +def gtkdoc_run_check(cmd: T.List[str], cwd: str, library_paths: T.Optional[T.List[str]] = None) -> None: if library_paths is None: library_paths = [] @@ -85,12 +86,12 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None): except UnicodeEncodeError: pass -def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, - main_file, module, module_version, - html_args, scan_args, fixxref_args, mkdb_args, - gobject_typesfile, scanobjs_args, run, ld, cc, ldflags, cflags, - html_assets, content_files, ignore_headers, namespace, - expand_content_files, mode, options): +def build_gtkdoc(source_root: str, build_root: str, doc_subdir: str, src_subdirs: T.List[str], + main_file: str, module: str, module_version: str, + html_args: T.List[str], scan_args: T.List[str], fixxref_args: T.List[str], mkdb_args: T.List[str], + gobject_typesfile: str, scanobjs_args: T.List[str], run: str, ld: str, cc: str, ldflags: str, cflags: str, + html_assets: T.List[str], content_files: T.List[str], ignore_headers: T.List[str], namespace: str, + expand_content_files: T.List[str], mode: str, options: argparse.Namespace) -> None: print("Building documentation for %s" % module) src_dir_args = [] @@ -217,13 +218,13 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, shutil.move(os.path.join(htmldir, '{}.devhelp2'.format(module)), os.path.join(htmldir, '{}-{}.devhelp2'.format(module, module_version))) -def install_gtkdoc(build_root, doc_subdir, install_prefix, datadir, module): +def install_gtkdoc(build_root: str, doc_subdir: str, install_prefix: str, datadir: str, module: str) -> None: source = os.path.join(build_root, doc_subdir, 'html') final_destination = os.path.join(install_prefix, datadir, module) shutil.rmtree(final_destination, ignore_errors=True) shutil.copytree(source, final_destination) -def run(args): +def run(args: T.List[str]) -> int: options = parser.parse_args(args) if options.htmlargs: htmlargs = options.htmlargs.split('@@') |