[std/os] split and re-export (#20593)
* [std/os] split and export * move to private modules * fixes docs and tests Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
This commit is contained in:
parent
ea5dcdbe8f
commit
f6a002c8a5
7 changed files with 2251 additions and 2047 deletions
|
|
@ -22,8 +22,9 @@ when declared(math.signbit):
|
|||
# ditto
|
||||
from std/math as math3 import signbit
|
||||
|
||||
|
||||
from std/envvars import getEnv, existsEnv, delEnv, putEnv, envPairs
|
||||
from std/os import dirExists, fileExists, walkDir, getAppFilename
|
||||
from std/os import walkDir, getAppFilename, dirExists, fileExists
|
||||
|
||||
from std/times import cpuTime
|
||||
from std/hashes import hash
|
||||
|
|
@ -44,6 +45,8 @@ template mathop(op) {.dirty.} =
|
|||
template osop(op) {.dirty.} =
|
||||
registerCallback(c, "stdlib.os." & astToStr(op), `op Wrapper`)
|
||||
|
||||
template oscommonop(op) {.dirty.} =
|
||||
registerCallback(c, "stdlib.oscommon." & astToStr(op), `op Wrapper`)
|
||||
template envvarsop(op) {.dirty.} =
|
||||
registerCallback(c, "stdlib.envvars." & astToStr(op), `op Wrapper`)
|
||||
|
||||
|
|
@ -226,8 +229,8 @@ proc registerAdditionalOps*(c: PCtx) =
|
|||
wrap1s(existsEnv, envvarsop)
|
||||
wrap2svoid(putEnv, envvarsop)
|
||||
wrap1svoid(delEnv, envvarsop)
|
||||
wrap1s(dirExists, osop)
|
||||
wrap1s(fileExists, osop)
|
||||
wrap1s(dirExists, oscommonop)
|
||||
wrap1s(fileExists, oscommonop)
|
||||
wrapDangerous(writeFile, ioop)
|
||||
wrap1s(readFile, ioop)
|
||||
wrap2si(readLines, ioop)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue