diff --git a/building/compile_po.py b/building/compile_po.py index 972d12c..4cb75c0 100644 --- a/building/compile_po.py +++ b/building/compile_po.py @@ -1,36 +1,6 @@ -import polib -import pathlib - -libRoot = pathlib.Path(__file__).absolute().parent.parent -root = libRoot / "src" -print(f"compiling .po files in {root.absolute()}") - -def compilePoFiles(root=root, errIfEmpty=True): - """Looks for all paths matching **/*.po and compiles to a .mo file using - python polib - - :param: root +raise Exception( """ - - po_files = list(pathlib.Path(root).glob('**/*.po')) - - for popath in po_files: - mopath = popath.with_suffix(".mo") - po = polib.pofile(popath) - po.save_as_mofile(mopath) - - if len(po_files) < 1: - if root.exists(): - raise FileNotFoundError( - f"Found no po files to compile to mo. Was this the right folder to search? \n" - f" {root}" - ) - else: - # if app folder doesn't exist, there's nothing to translate - print("No .po files to compile as this is a library-only installation.") - else: - print(f"compiled {len(po_files)} .po files to .mo in {root.absolute()}") - return len(po_files) - -if __name__ == "__main__": - n_files = compilePoFiles(root) \ No newline at end of file + The psychopy_app.compile_po has been removed. + Please use psychopy_translations.generate instead. + https://github.com/psychopy/psychopy-translations/blob/dev/psychopy_translations/generate.py + """) diff --git a/setupApp.py b/setupApp.py index 81974f1..1bff096 100644 --- a/setupApp.py +++ b/setupApp.py @@ -11,7 +11,6 @@ import py2app # noqa: needed to build app bundle, even though not explicitly used here from ctypes import util import importlib -from building import compile_po from building import semanticVersion from pathlib import Path import psychopy @@ -23,7 +22,6 @@ def glob_to_list(path, glob_pattern='*'): """Convert a glob pattern to a list of files.""" return [str(p.absolute()) for p in Path(path).glob(glob_pattern)] -compile_po.compilePoFiles() # semanticVersion.updateVersionFile() # semanticVersion.updateGitShaFile()