Allow languages to be updated from any directory
Now these commands will work: python .\lang\update-po.py python .\lang\update-pot.py When current working directory is .\Prusa-Firmware\ Previously, you'd need to call the script within the lang folder.
This commit is contained in:
parent
53ced0cb21
commit
7966633c1a
|
|
@ -12,7 +12,7 @@ from pathlib import Path, PurePosixPath
|
|||
FILE_LIST: list[Path] = []
|
||||
|
||||
# Absolute path
|
||||
BASE_DIR: Path = Path.cwd().resolve()
|
||||
BASE_DIR: Path = Path.absolute(Path(__file__).parent)
|
||||
PO_DIR: Path = BASE_DIR / "po"
|
||||
|
||||
# Pathlib can't change the working directory yet
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from pathlib import Path
|
|||
import polib
|
||||
from polib import POFile
|
||||
|
||||
BASE_DIR: Path = Path.cwd()
|
||||
BASE_DIR: Path = Path.absolute(Path(__file__).parent)
|
||||
PO_DIR: Path = BASE_DIR / "po"
|
||||
PO_FILE_LIST: list[Path] = []
|
||||
POT_REFERENCE: POFile = polib.pofile(PO_DIR/'Firmware.pot')
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import shutil
|
|||
import subprocess
|
||||
from subprocess import CalledProcessError
|
||||
|
||||
BASE_DIR: Path = Path.cwd().resolve()
|
||||
BASE_DIR: Path = Path.absolute(Path(__file__).parent)
|
||||
PROJECT_DIR: Path = BASE_DIR.parent
|
||||
PO_DIR: Path = BASE_DIR / "po"
|
||||
|
||||
|
|
@ -45,11 +45,12 @@ def main():
|
|||
print(error)
|
||||
|
||||
# Run the lang-extract.py script
|
||||
SCRIPT_PATH = BASE_DIR.joinpath("lang-extract.py")
|
||||
try:
|
||||
subprocess.check_call(
|
||||
[
|
||||
"python",
|
||||
"lang-extract.py",
|
||||
SCRIPT_PATH,
|
||||
"--no-missing",
|
||||
"-s",
|
||||
"-o",
|
||||
|
|
|
|||
Loading…
Reference in New Issue