From 050aa5c90e6f23d06c13d2fc774e63896a429ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Tue, 30 Jan 2024 18:59:17 +0300 Subject: [PATCH] d --- Modules/MicX/MicItem/MicItem.yml | 5 ++--- Utilities/platform/5/gen5.py | 1 + Utilities/platform/5/generate | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 120000 Utilities/platform/5/gen5.py create mode 100755 Utilities/platform/5/generate diff --git a/Modules/MicX/MicItem/MicItem.yml b/Modules/MicX/MicItem/MicItem.yml index def4dd8..276c9d7 100644 --- a/Modules/MicX/MicItem/MicItem.yml +++ b/Modules/MicX/MicItem/MicItem.yml @@ -1,5 +1,4 @@ version: 5 -viewmodel: - activityDates: [Date?, nil, recent] - timeout: [Bool, false, toggle] +activityDates: [Date?, nil, recent] +timeout: [Bool, false, toggle] diff --git a/Utilities/platform/5/gen5.py b/Utilities/platform/5/gen5.py new file mode 120000 index 0000000..27b874b --- /dev/null +++ b/Utilities/platform/5/gen5.py @@ -0,0 +1 @@ +/Users/mk/m/u/Utilities/platform/5/gen5.py \ No newline at end of file diff --git a/Utilities/platform/5/generate b/Utilities/platform/5/generate new file mode 100755 index 0000000..dc0f503 --- /dev/null +++ b/Utilities/platform/5/generate @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +import os +import sys +from gen5 import * + +DIR = os.path.dirname(os.path.realpath(sys.argv[0])) + +# Требуем имя модуля в качестве аргумента. +if len(sys.argv) < 2: + print("Usage: /path/to/generate MODULE") + sys.exit(1) + +# Импорт из общей для всех генераторов директории. +sys.path.append(f"{DIR}/../common") +from modulePaths import * +from readFile import * + +(PATH, MODULE) = modulePaths(sys.argv[1]) + +print(f"Генерируем платформу для модуля '{PATH}'...") + +FILE_IN = f"{DIR}/../../../Modules/{PATH}/{MODULE}.yml" +DIR_OUT = f"{DIR}/../../../Modules/{PATH}/src/" +FILE_OUT = os.path.join(DIR_OUT, f"{MODULE}.Generated.swift") + +gen5(DIR, DIR_OUT, FILE_IN, FILE_OUT, MODULE, PATH, readFile)