Update os type definition

This commit is contained in:
Shunsuke Shibayama 2023-08-09 23:07:53 +09:00
parent 07679238bc
commit 3fb6354fb1

View file

@ -1,6 +1,19 @@
.path = pyimport "path"
# .PathLike: ClassType
.DirEntry: ClassType
.DirEntry.
name: Str
path: Str
inode: (self: .DirEntry) -> Nat
is_dir: (self: .DirEntry) -> Bool
is_file: (self: .DirEntry) -> Bool
is_symlink: (self: .DirEntry) -> Bool
.ctermid!: () => Str
# TODO: _Environ
.environ: {Str: Str}
.environb: {Bytes: Bytes}
'''
The name of the operating system dependent module imported. The following names have currently been registered:
'posix', 'nt', 'java'.
@ -10,17 +23,49 @@ The name of the operating system dependent module imported. The following names
.chdir!: (path: PathLike, ) => NoneType
.chmod!: (path: PathLike, mode: Nat) => NoneType
.getcwd!: () => Str
.getcwdb!: () => Bytes
.getegid!: () => Nat
.getenv!: |D <: Str or NoneType|(key: Str, default: D := NoneType) => Str or D
.getenvb!: |D <: Bytes or NoneType|(key: Bytes, default: D := NoneType) => Bytes or D
.geteuid!: () => Nat
.getgid!: () => Nat
.getgroups!: () => [Nat; _]
.getlogin!: () => Str
.getpgid!: (pid: Nat) => Nat
.getpgrp!: () => Nat
.getpid!: () => Nat
.getppid!: () => Nat
.getuid!: () => Nat
# TODO:
.isatty!: (fd: Obj) => Bool
.listdir!: (path := PathLike,) => [Str; _]
.mkdir!: (path: PathLike, mode := Nat) => NoneType
.makedirs!: (path: PathLike, mode := Nat, exist_ok := Bool) => NoneType
.pipe!: () => (Nat, Nat)
.putenv!: (key: Str, value: Str) => NoneType
.remove!: (path: PathLike,) => NoneType
.removedirs!: (path: PathLike,) => NoneType
.rename!: (src: PathLike, dst: PathLike) => NoneType
.renames!: (old: PathLike, new: PathLike) => NoneType
.replace!: (src: PathLike, dst: PathLike) => NoneType
.rmdir!: (path: PathLike,) => NoneType
.scandir!: (path := PathLike,) => Iterator DirEntry
.setegid!: (egid: Nat) => NoneType
.seteuid!: (euid: Nat) => NoneType
.setgid!: (gid: Nat) => NoneType
.setgroups!: (groups: Sequence(Nat)) => NoneType
.setpgrp!: () => NoneType
.setpgid!: (pid: Nat, pgid: Nat) => NoneType
# posix = pyimport "posix"
# .uname!: () => posix.UnameResult
.uname!: () => {
sysname = Str
nodename = Str
release = Str
version = Str
machine = Str
}
.getrandom!: (size: Nat) => Bytes
.urandom!: (size: Nat) => Bytes