diff --git a/.github/workflows/build_executable.yml b/.github/workflows/build_executable.yml index 6a45b57..cbbcd9a 100644 --- a/.github/workflows/build_executable.yml +++ b/.github/workflows/build_executable.yml @@ -6,6 +6,7 @@ on: - master jobs: build-windows: + name: Build for Windows runs-on: windows-latest steps: - name: Checkout @@ -15,9 +16,12 @@ jobs: with: python-version: "3.11" - name: Install requirements - run: pip install pillow tqdm i18nice[YAML] pyinstaller + run: pip install -r requirements.txt + - name: Install PyInstaller + run: pip install pyinstaller - name: Run PyInstaller for Deserializer, Downloader and Batch Deserializer run: | + set PYTHONOPTIMIZE=2 pyinstaller --onefile --name="flatc_deserializer" --console --icon=images\flatbuffers-logo-clean.png --add-data="images:images" --add-data="localization:localization" flatc_deserializer.py pyinstaller --onefile --name="flatc_downloader" --console --icon=images\flatbuffers-downloader-logo-clean.png --add-data="images:images" --add-data="localization:localization" flatc_downloader.py pyinstaller --onefile --name="flatc_deserializer_batch" --console --icon=images\flatbuffers-batch-logo-clean.png --add-data="images:images" --add-data="localization:localization" flatc_deserializer_batch.py diff --git a/.github/workflows/build_executable_nuitka.yml b/.github/workflows/build_executable_nuitka.yml index 0b5ce29..78e5e9e 100644 --- a/.github/workflows/build_executable_nuitka.yml +++ b/.github/workflows/build_executable_nuitka.yml @@ -6,6 +6,7 @@ on: - master jobs: build-windows: + name: Build for Windows runs-on: windows-latest steps: - name: Checkout @@ -15,7 +16,7 @@ jobs: with: python-version: "3.11" - name: Install requirements - run: pip install pillow tqdm i18nice[YAML] imageio + run: pip install -r requirements.txt - name: Run Nuitka for Deserializer uses: Nuitka/Nuitka-Action@main with: @@ -24,8 +25,10 @@ jobs: onefile: true enable-plugins: tk-inter include-data-dir: | - localization=localization - images=images + .\localization=localization + .\images=images + product-name: Flatbuffers Deserializer + file-description: Program for deserialization of Flatbuffers binary files based on single schema. windows-icon-from-ico: "images/flatbuffers-logo-clean.png" - name: Run Nuitka for Downloader uses: Nuitka/Nuitka-Action@main @@ -35,8 +38,10 @@ jobs: onefile: true enable-plugins: tk-inter include-data-dir: | - localization=localization - images=images + .\localization=localization + .\images=images + product-name: Flatbuffers Schema Compiler Downloader + file-description: Program for downloading latest version of Flatbuffers schema compiler for Windows. windows-icon-from-ico: "images/flatbuffers-downloader-logo-clean.png" - name: Run Nuitka for Batch Deserializer uses: Nuitka/Nuitka-Action@main @@ -46,8 +51,10 @@ jobs: onefile: true enable-plugins: tk-inter include-data-dir: | - localization=localization - images=images + .\localization=localization + .\images=images + product-name: Flatbuffers Batch Deserializer + file-description: Program for deserialization of Flatbuffers binary files based on multiple schemas. windows-icon-from-ico: "images/flatbuffers-batch-logo-clean.png" - name: Move Executables from build to root directory run: | diff --git a/flatc_deserializer_batch.py b/flatc_deserializer_batch.py index 4d8f6e7..76249ca 100644 --- a/flatc_deserializer_batch.py +++ b/flatc_deserializer_batch.py @@ -13,8 +13,8 @@ if __name__ == "__main__": sys.tracebacklimit = 0 init_app("images/flatbuffers-batch-logo-clean.png") - parser = argparse.ArgumentParser(prog=t("main.flatc_deserializer_name"), - description=t("main.flatc_deserializer_desc")) + parser = argparse.ArgumentParser(prog=t("main.flatc_deserializer_batch_name"), + description=t("main.flatc_deserializer_batch_desc")) parser.add_argument("-s", "--schemas_path", type=str, default="", help=t("main.schemas_directory_arg")) parser.add_argument("-b", "--binaries_path", type=str, default="", diff --git a/localization/en_US/main.yml b/localization/en_US/main.yml index f2467dd..4d19256 100644 --- a/localization/en_US/main.yml +++ b/localization/en_US/main.yml @@ -1,12 +1,12 @@ tkinter_flatc_select: Select schema compiler exe_filetype: Windows Executable tkinter_fbs_select: Select schema file -fbs_filetype: Flatbuffers scheme +fbs_filetype: Flatbuffers schema tkinter_binaries_select: Select binary files flatc_binary_filetype: Binary Flatbuffers file tkinter_output_select: Select output directory files: Files -unsupported_platform: "Can't run on unsupported platform: %s." +unsupported_platform: "%s platform is not supported." executable_not_found: Executable %s not found. file_not_found: File %s not found. directory_not_found: Directory %s not found. @@ -22,8 +22,10 @@ output_directory_arg: Output directory for deserialized files schema_file_arg: Schema file binary_files_arg: Binary files flatc_path_arg: Path to schema compiler (flatc) -flatc_deserializer_name: Flatbuffers Batch Deserializer -flatc_deserializer_desc: Program for batch deserialization of Flatbuffers binary files. +flatc_deserializer_name: Flatbuffers Deserializer +flatc_deserializer_desc: Program for deserialization of Flatbuffers binary files based on single schema. +flatc_deserializer_batch_name: Flatbuffers Batch Deserializer +flatc_deserializer_batch_desc: Program for deserialization of Flatbuffers binary files based on multiple schemas. file_failed_to_open: Failed to open file %s. flatc_downloader_name: Flatbuffers Schema Compiler Downloader flatc_downloader_desc: Program for downloading latest version of Flatbuffers schema compiler for this platform. diff --git a/localization/ru_RU/main.yml b/localization/ru_RU/main.yml index ec78807..8040414 100644 --- a/localization/ru_RU/main.yml +++ b/localization/ru_RU/main.yml @@ -6,7 +6,7 @@ tkinter_binaries_select: Выбор бинарных файлов flatc_binary_filetype: Бинарный файл Flatbuffers tkinter_output_select: Выбор директории вывода files: Файлы -unsupported_platform: "Запуск невозможен на неподдерживаемой платформе: %s." +unsupported_platform: "Платформа %s не поддерживается." executable_not_found: Исполняемый файл %s не найден. file_not_found: Файл %s не найден. directory_not_found: Директория %s не найдена. @@ -22,8 +22,10 @@ output_directory_arg: Директория вывода для десериал schema_file_arg: Файл схемы binary_files_arg: Бинарные файлы flatc_path_arg: Путь к компилятору схемы (flatc) -flatc_deserializer_name: Flatbuffers Batch Deserializer -flatc_deserializer_desc: Программа для пакетной десериализации бинарных файлов Flatbuffers. +flatc_deserializer_name: Flatbuffers Deserializer +flatc_deserializer_desc: Программа для десериализации бинарных файлов Flatbuffers, основанных на одной схеме. +flatc_deserializer_batch_name: Flatbuffers Batch Deserializer +flatc_deserializer_batch_desc: Программа для десериализации бинарных файлов Flatbuffers, основанных на нескольких схемах. file_failed_to_open: Не удалось открыть файл %s. flatc_downloader_name: Flatbuffers Schema Compiler Downloader flatc_downloader_desc: Программа для скачивания последней версии компилятора схемы Flatbuffers для данной платформы. diff --git a/pyproject.toml b/pyproject.toml index 6f236a1..dc8df16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ dependencies = [ "i18nice[YAML]" ] authors = [{name = "Shararamosh"}] -description = "Program for batch deserialization of Flatbuffers binary files." +description = "Program for deserialization of Flatbuffers binary files based on single or multiple schemas." keywords = [ "json", "flatbuffers", diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d0d600f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pillow +tqdm +i18nice[YAML] \ No newline at end of file