-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added batch folder deserialization and support for argparse arguments…
… to both executables.
- Loading branch information
1 parent
35925c6
commit d3d10f8
Showing
9 changed files
with
189 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
""" | ||
Десериализация бинарных файлов Flatbuffers по заданной схеме c открытием диалогового окна для | ||
поиска компилятора схемы при его отсутствии в рабочей директории. | ||
Десериализация выбранных бинарных файлов Flatbuffers по выбранной схеме. | ||
""" | ||
import os | ||
import sys | ||
import argparse | ||
from i18n import t | ||
|
||
from main import prepare_app, get_flatc_path, execute_deserialize # pylint: disable=import-error | ||
|
||
if __name__ == "__main__": | ||
prepare_app("images/flatbuffers-logo-clean.png") | ||
sys.exit(execute_deserialize(get_flatc_path(True, os.getcwd(), True))) | ||
parser = argparse.ArgumentParser(prog=t("main.flatc_deserializer_name"), | ||
description=t("main.flatc_deserializer_desc")) | ||
parser.add_argument("-s", "--schema_path", type=str, default="", help=t("main.schema_file_arg")) | ||
parser.add_argument("-b", "--binary_paths", nargs="+", default=[], | ||
help=t("main.binary_files_arg")) | ||
parser.add_argument("-o", "--output_path", type=str, default="", | ||
help=t("main.output_directory_arg")) | ||
parser.add_argument("-f", "--flatc_path", type=str, default="", help=t("main.flatc_path_arg")) | ||
args = parser.parse_args() | ||
sys.exit(execute_deserialize( | ||
get_flatc_path(os.getcwd(), True) if args.flatc_path == "" else args.flatc_path, | ||
args.schema_path, args.binary_paths, args.output_path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
Десериализация бинарных файлов Flatbuffers в выбранной директории по всем схемам в другой | ||
выбранной директории. | ||
""" | ||
import os | ||
import sys | ||
import argparse | ||
from i18n import t | ||
|
||
from main import prepare_app, get_flatc_path, \ | ||
execute_deserialize_batch # pylint: disable=import-error | ||
|
||
if __name__ == "__main__": | ||
prepare_app("images/flatbuffers-batch-logo-clean.png") | ||
parser = argparse.ArgumentParser(prog=t("main.flatc_deserializer_name"), | ||
description=t("main.flatc_derializer_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="", | ||
help=t("main.binaries_directory_arg")) | ||
parser.add_argument("-o", "--output_path", type=str, default="", | ||
help=t("main.output_directory_arg")) | ||
parser.add_argument("-f", "--flatc_path", type=str, default="", help=t("main.flatc_path_arg")) | ||
args = parser.parse_args() | ||
sys.exit(execute_deserialize_batch( | ||
get_flatc_path(os.getcwd(), True) if args.flatc_path == "" else args.flatc_path, | ||
args.schemas_path, args.binaries_path, args.output_path)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
download_start: Retrieving Flatbuffers latest release data... | ||
download_failed: Can't find valid latest Flatbuffers release. | ||
download_finish: "Downloaded latest Flatbuffers release to %s." | ||
download_finish: Downloaded latest Flatbuffers release to %s. | ||
unpack_path: Unpacked %s archive to %s. | ||
archive_removed: Flatbuffers archive is removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
download_start: Получение данных о последней версии Flatbuffers... | ||
download_failed: Не удалось найти валидную последнюю версию Flatbuffers. | ||
download_finish: "Последняя версия Flatbuffers была загружена в %s." | ||
download_finish: Последняя версия Flatbuffers была загружена в %s. | ||
unpack_path: Архив %s распакован в %s. | ||
archive_removed: Архив Flatbuffers был удалён. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters