Skip to content
Snippets Groups Projects
Commit 8c84d391 authored by Simon Künzel's avatar Simon Künzel
Browse files

Fix pipeline generator and bug in json serializable

parent c638ef4b
No related branches found
No related tags found
No related merge requests found
Pipeline #7425 passed
Pipeline: backend

#7426

    ...@@ -7,7 +7,8 @@ from argparse import ArgumentParser ...@@ -7,7 +7,8 @@ from argparse import ArgumentParser
    sys.path.append(str(Path("common_py/src/").resolve())) sys.path.append(str(Path("common_py/src/").resolve()))
    os.environ["VIDEOAG_CONFIG"] = "/dev/null" os.environ["VIDEOAG_CONFIG"] = "/dev/null"
    from videoag_common.miscellaneous import CJsonValue, JsonDataClass, JsonSerializableEnum, json_field, JsonOnlyDeserializable from videoag_common.miscellaneous import CJsonValue, JsonDataClass, JsonSerializableEnum, json_field, JsonSerializable, \
    JsonTypes
    class OsType(JsonSerializableEnum): class OsType(JsonSerializableEnum):
    ...@@ -15,7 +16,7 @@ class OsType(JsonSerializableEnum): ...@@ -15,7 +16,7 @@ class OsType(JsonSerializableEnum):
    ALPINE = "alpine" ALPINE = "alpine"
    class OsModuleDependencies(JsonOnlyDeserializable): class OsModuleDependencies(JsonSerializable):
    def __init__(self, names_by_type: dict[OsType, set[str]] or None = None): def __init__(self, names_by_type: dict[OsType, set[str]] or None = None):
    super().__init__() super().__init__()
    ...@@ -33,6 +34,10 @@ class OsModuleDependencies(JsonOnlyDeserializable): ...@@ -33,6 +34,10 @@ class OsModuleDependencies(JsonOnlyDeserializable):
    names_list.append(val.as_string(max_length=100)) names_list.append(val.as_string(max_length=100))
    return OsModuleDependencies(names_by_type) return OsModuleDependencies(names_by_type)
    def to_json(self) -> JsonTypes:
    # Not supported/needed
    raise NotImplementedError()
    def update(self, other: "OsModuleDependencies"): def update(self, other: "OsModuleDependencies"):
    for type, names in other._names_by_type.items(): for type, names in other._names_by_type.items():
    self._names_by_type[type].update(names) self._names_by_type[type].update(names)
    ......
    ...@@ -302,6 +302,7 @@ class JsonDataClass(JsonSerializable): ...@@ -302,6 +302,7 @@ class JsonDataClass(JsonSerializable):
    args = {} args = {}
    for id, field in cls.__all_json_fields__.items(): for id, field in cls.__all_json_fields__.items():
    if id in unused_keys:
    unused_keys.remove(id) unused_keys.remove(id)
    val = field.from_json(json, id) val = field.from_json(json, id)
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment