aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/fs.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/modules/fs.py')
-rw-r--r--mesonbuild/modules/fs.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py
index 7340fb7..523ad2b 100644
--- a/mesonbuild/modules/fs.py
+++ b/mesonbuild/modules/fs.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import typing
+import typing as T
import hashlib
from pathlib import Path, PurePath
@@ -22,7 +22,7 @@ from . import ModuleReturnValue
from ..mesonlib import MesonException
from ..interpreterbase import stringArgs, noKwargs
-if typing.TYPE_CHECKING:
+if T.TYPE_CHECKING:
from ..interpreter import ModuleState
class FSModule(ExtensionModule):
@@ -38,7 +38,7 @@ class FSModule(ExtensionModule):
"""
return Path(state.source_root) / state.subdir / Path(arg).expanduser()
- def _check(self, check: str, state: 'ModuleState', args: typing.Sequence[str]) -> ModuleReturnValue:
+ def _check(self, check: str, state: 'ModuleState', args: T.Sequence[str]) -> ModuleReturnValue:
if len(args) != 1:
raise MesonException('fs.{} takes exactly one argument.'.format(check))
test_file = self._resolve_dir(state, args[0])
@@ -46,27 +46,27 @@ class FSModule(ExtensionModule):
@stringArgs
@noKwargs
- def exists(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def exists(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
return self._check('exists', state, args)
@stringArgs
@noKwargs
- def is_symlink(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def is_symlink(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
return self._check('is_symlink', state, args)
@stringArgs
@noKwargs
- def is_file(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def is_file(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
return self._check('is_file', state, args)
@stringArgs
@noKwargs
- def is_dir(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def is_dir(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
return self._check('is_dir', state, args)
@stringArgs
@noKwargs
- def hash(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def hash(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
if len(args) != 2:
raise MesonException('method takes exactly two arguments.')
file = self._resolve_dir(state, args[0])
@@ -82,7 +82,7 @@ class FSModule(ExtensionModule):
@stringArgs
@noKwargs
- def size(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def size(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
if len(args) != 1:
raise MesonException('method takes exactly one argument.')
file = self._resolve_dir(state, args[0])
@@ -95,7 +95,7 @@ class FSModule(ExtensionModule):
@stringArgs
@noKwargs
- def is_samepath(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def is_samepath(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
if len(args) != 2:
raise MesonException('fs.is_samepath takes exactly two arguments.')
file1 = self._resolve_dir(state, args[0])
@@ -111,7 +111,7 @@ class FSModule(ExtensionModule):
@stringArgs
@noKwargs
- def replace_suffix(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def replace_suffix(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
if len(args) != 2:
raise MesonException('method takes exactly two arguments.')
original = PurePath(args[0])
@@ -120,7 +120,7 @@ class FSModule(ExtensionModule):
@stringArgs
@noKwargs
- def parent(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def parent(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
if len(args) != 1:
raise MesonException('method takes exactly one argument.')
original = PurePath(args[0])
@@ -129,7 +129,7 @@ class FSModule(ExtensionModule):
@stringArgs
@noKwargs
- def name(self, state: 'ModuleState', args: typing.Sequence[str], kwargs: dict) -> ModuleReturnValue:
+ def name(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue:
if len(args) != 1:
raise MesonException('method takes exactly one argument.')
original = PurePath(args[0])