From 084e623dc80fbd898a858d8cd36b12eeefa425d8 Mon Sep 17 00:00:00 2001 From: dreamer Date: Tue, 3 Dec 2024 09:41:07 +0100 Subject: [PATCH] move meta type to types folder; rename class to Generator --- hvcc/__init__.py | 2 +- hvcc/generators/c2daisy/c2daisy.py | 6 +++--- hvcc/generators/c2dpf/c2dpf.py | 6 +++--- hvcc/generators/c2js/c2js.py | 6 +++--- hvcc/generators/c2owl/c2owl.py | 6 +++--- hvcc/generators/c2pdext/c2pdext.py | 6 +++--- hvcc/generators/c2unity/c2unity.py | 6 +++--- hvcc/generators/c2wwise/c2wwise.py | 6 +++--- hvcc/generators/types/__init__.py | 0 hvcc/types/compiler.py | 4 ++-- hvcc/{generators => }/types/meta.py | 0 hvcc/utils.py | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 hvcc/generators/types/__init__.py rename hvcc/{generators => }/types/meta.py (100%) diff --git a/hvcc/__init__.py b/hvcc/__init__.py index c2513eb0..2518fab5 100644 --- a/hvcc/__init__.py +++ b/hvcc/__init__.py @@ -34,8 +34,8 @@ from hvcc.generators.c2pdext import c2pdext from hvcc.generators.c2wwise import c2wwise from hvcc.generators.c2unity import c2unity -from hvcc.generators.types.meta import Meta from hvcc.types.compiler import CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.meta import Meta class Colours: diff --git a/hvcc/generators/c2daisy/c2daisy.py b/hvcc/generators/c2daisy/c2daisy.py index ed6f45fb..3dfaa777 100644 --- a/hvcc/generators/c2daisy/c2daisy.py +++ b/hvcc/generators/c2daisy/c2daisy.py @@ -7,11 +7,11 @@ from typing import Any, Dict, Optional from ..copyright import copyright_manager -from ..types.meta import Meta, Daisy from . import parameters from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.types.compiler import Compiler, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.compiler import Generator, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.meta import Meta, Daisy hv_midi_messages = { @@ -26,7 +26,7 @@ } -class c2daisy(Compiler): +class c2daisy(Generator): """ Generates a Daisy wrapper for a given patch. """ diff --git a/hvcc/generators/c2dpf/c2dpf.py b/hvcc/generators/c2dpf/c2dpf.py index 558ee379..d9d43fdd 100644 --- a/hvcc/generators/c2dpf/c2dpf.py +++ b/hvcc/generators/c2dpf/c2dpf.py @@ -23,11 +23,11 @@ from ..filters import filter_uniqueid from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.generators.types.meta import Meta, DPF -from hvcc.types.compiler import Compiler, CompilerResp, CompilerMsg, CompilerNotif +from hvcc.types.compiler import Generator, CompilerResp, CompilerMsg, CompilerNotif +from hvcc.types.meta import Meta, DPF -class c2dpf(Compiler): +class c2dpf(Generator): """ Generates a DPF wrapper for a given patch. """ diff --git a/hvcc/generators/c2js/c2js.py b/hvcc/generators/c2js/c2js.py index daaff852..cda3e981 100644 --- a/hvcc/generators/c2js/c2js.py +++ b/hvcc/generators/c2js/c2js.py @@ -26,11 +26,11 @@ from ..copyright import copyright_manager from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.generators.types.meta import Meta -from hvcc.types.compiler import Compiler, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.compiler import Generator, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.meta import Meta -class c2js(Compiler): +class c2js(Generator): """Compiles a directory of C source files into javascript. Requires the emscripten library to be installed - https://github.com/kripken/emscripten """ diff --git a/hvcc/generators/c2owl/c2owl.py b/hvcc/generators/c2owl/c2owl.py index cf96247f..7e2e16e4 100644 --- a/hvcc/generators/c2owl/c2owl.py +++ b/hvcc/generators/c2owl/c2owl.py @@ -10,15 +10,15 @@ from ..copyright import copyright_manager from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.generators.types.meta import Meta -from hvcc.types.compiler import Compiler, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.compiler import Generator, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.meta import Meta heavy_hash = HeavyLangObject.HeavyLangObject.get_hash OWL_BUTTONS = ['Push', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8'] -class c2owl(Compiler): +class c2owl(Generator): """ Generates a OWL wrapper for a given patch. """ diff --git a/hvcc/generators/c2pdext/c2pdext.py b/hvcc/generators/c2pdext/c2pdext.py index 039da424..4a6fc03f 100644 --- a/hvcc/generators/c2pdext/c2pdext.py +++ b/hvcc/generators/c2pdext/c2pdext.py @@ -24,11 +24,11 @@ from ..filters import filter_max from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.generators.types.meta import Meta -from hvcc.types.compiler import Compiler, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.compiler import Generator, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.meta import Meta -class c2pdext(Compiler): +class c2pdext(Generator): """Generates a Pure Data external wrapper for a given patch. """ diff --git a/hvcc/generators/c2unity/c2unity.py b/hvcc/generators/c2unity/c2unity.py index 21433b3b..5ba49986 100644 --- a/hvcc/generators/c2unity/c2unity.py +++ b/hvcc/generators/c2unity/c2unity.py @@ -24,11 +24,11 @@ from ..filters import filter_string_cap, filter_templates, filter_xcode_build, filter_xcode_fileref from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.generators.types.meta import Meta -from hvcc.types.compiler import Compiler, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.compiler import Generator, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.meta import Meta -class c2unity(Compiler): +class c2unity(Generator): """Generates a Audio Native Plugin wrapper for Unity 5. """ diff --git a/hvcc/generators/c2wwise/c2wwise.py b/hvcc/generators/c2wwise/c2wwise.py index e492a061..1ffe83f4 100644 --- a/hvcc/generators/c2wwise/c2wwise.py +++ b/hvcc/generators/c2wwise/c2wwise.py @@ -24,11 +24,11 @@ from ..filters import filter_plugin_id from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.generators.types.meta import Meta -from hvcc.types.compiler import Compiler, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.compiler import Generator, CompilerResp, CompilerNotif, CompilerMsg +from hvcc.types.meta import Meta -class c2wwise(Compiler): +class c2wwise(Generator): """Generates a plugin wrapper for Audiokinetic's Wwise game audio middleware platform. """ diff --git a/hvcc/generators/types/__init__.py b/hvcc/generators/types/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/hvcc/types/compiler.py b/hvcc/types/compiler.py index 16e21fa6..f02aad81 100644 --- a/hvcc/types/compiler.py +++ b/hvcc/types/compiler.py @@ -5,7 +5,7 @@ from pydantic import BaseModel from hvcc.interpreters.pd2hv.NotificationEnum import NotificationEnum -from hvcc.generators.types.meta import Meta +from hvcc.types.meta import Meta class CompilerMsg(BaseModel): @@ -33,7 +33,7 @@ class CompilerResp(BaseModel): ir: Dict[str, Any] = {} # TODO: improve Any type in Graph objects -class Compiler(ABC): +class Generator(ABC): @abstractmethod def compile( diff --git a/hvcc/generators/types/meta.py b/hvcc/types/meta.py similarity index 100% rename from hvcc/generators/types/meta.py rename to hvcc/types/meta.py diff --git a/hvcc/utils.py b/hvcc/utils.py index 469d0a43..4bd97a59 100644 --- a/hvcc/utils.py +++ b/hvcc/utils.py @@ -19,7 +19,7 @@ from hvcc.core.hv2ir.HeavyLangObject import HeavyLangObject from hvcc.interpreters.pd2hv.PdParser import PdParser -from hvcc.generators.types.meta import Meta, DPF, Daisy +from hvcc.types.meta import Meta, DPF, Daisy gens = {