diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-05-14 16:39:38 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-05-14 16:43:29 -0700 |
commit | 75aa3d096c85705d5190b409fbcc98a1b654a828 (patch) | |
tree | 65fe1383ab859d91312190793963dcdaf5b8ace3 | |
parent | 0b381717101fcfe022fca331051905c368c90eba (diff) | |
download | meson-75aa3d096c85705d5190b409fbcc98a1b654a828.zip meson-75aa3d096c85705d5190b409fbcc98a1b654a828.tar.gz meson-75aa3d096c85705d5190b409fbcc98a1b654a828.tar.bz2 |
dependencies/base: Add some annotations to ExternalProgram
as required by mtest.
-rw-r--r-- | mesonbuild/dependencies/base.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 8f38d6c..e7cf6eb 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1982,7 +1982,8 @@ class DubDependency(ExternalDependency): class ExternalProgram: windows_exts = ('exe', 'msc', 'com', 'bat', 'cmd') - def __init__(self, name, command=None, silent=False, search_dir=None): + def __init__(self, name: str, command: typing.Optional[typing.List[str]] = None, + silent: bool = False, search_dir: typing.Optional[str] = None): self.name = name if command is not None: self.command = listify(command) @@ -2006,11 +2007,11 @@ class ExternalProgram: else: mlog.log('Program', mlog.bold(name), 'found:', mlog.red('NO')) - def __repr__(self): + def __repr__(self) -> str: r = '<{} {!r} -> {!r}>' return r.format(self.__class__.__name__, self.name, self.command) - def description(self): + def description(self) -> str: '''Human friendly description of the command''' return ' '.join(self.command) @@ -2169,7 +2170,7 @@ class ExternalProgram: # all executables whether in PATH or with an absolute path return [command] - def found(self): + def found(self) -> bool: return self.command[0] is not None def get_command(self): |