Adjust Python module path handling

Simplifies top-level scripts and removes linting exceptions.
This commit is contained in:
2Shirt 2023-03-19 19:42:54 -07:00
parent dad1d3e7f9
commit 16ee95b1d9
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
8 changed files with 13 additions and 41 deletions

View file

@ -1,12 +1,7 @@
"""WizardKit: Auto Repair Tool"""
# vim: sts=2 sw=2 ts=2
import os
import sys
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
import wk
# Classes

View file

@ -1,12 +1,7 @@
"""WizardKit: Auto System Setup Tool"""
# vim: sts=2 sw=2 ts=2
import os
import sys
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
import wk
# Classes

View file

@ -1,12 +1,7 @@
"""WizardKit: Build Kit (Windows)."""
# vim: sts=2 sw=2 ts=2
import os
import sys
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
import wk
if __name__ == '__main__':

View file

@ -5,12 +5,9 @@ python.exe -i embedded_python_env.py
"""
# vim: sts=2 sw=2 ts=2
import os
import sys
import wk
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
wk.std.print_colored(
(wk.cfg.main.KIT_NAME_FULL, ': ', 'Debug Console'),
('GREEN', None, 'YELLOW'),

View file

@ -1,11 +1,6 @@
"""WizardKit: Export Bitlocker Tool"""
# vim: sts=2 sw=2 ts=2
import os
import sys
import wk
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
wk.os.win.export_bitlocker_info()
wk.os.win.export_bitlocker_info()

View file

@ -1,13 +1,9 @@
"""WizardKit: Launch Snappy Driver Installer Origin"""
# vim: sts=2 sw=2 ts=2
import os
import sys
import wk
from wk.cfg.net import SDIO_SERVER
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
from wk.cfg.net import SDIO_SERVER # pylint: disable=wrong-import-position
# STATIC VARIABLES
MOUNT_EXCEPTIONS = (

View file

@ -3,14 +3,10 @@
# pylint: disable=invalid-name
# vim: sts=2 sw=2 ts=2
import os
import pathlib
import pickle
import sys
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.getcwd())
import wk # pylint: disable=wrong-import-position
import wk
# STATIC VARIABLES

View file

@ -180,6 +180,9 @@ if ($MyInvocation.InvocationName -ne ".") {
}
Remove-Item "$Temp\python*.zip"
Remove-Item "$Temp\*.whl"
foreach ($File in Get-ChildItem "$Bin\Python\*\*._pth") {
Add-Content "$File" "`n#WizardKit`n..\..\Scripts"
}
## Done ##
Pop-Location