def dict_value(type: str, value: typing.Any) -> DictValue: if value is None: return None if type in (SET, ): return list(value) if type in (BOOLEAN, ): return bool(value) if type in (INT, ): return int(value) if type in (FLOAT, ): return float(value) if type in (TIMESTAMP, ): return Converter.DatetimeToStringConverter().convert(value) if type in (UUID, ): return Converter.UuidToStringConverter().convert(value) if type in (PATH, ): return Converter.PathToStringConverter().convert(value) return typing.cast(DictValue, value)
def build_value(type: str, value: typing.Any) -> typing.Any: if value is None: return None if type in (SET, ): return set(value) if type in (BOOLEAN, ): return bool(value) if type in (INT, ): return int(value) if type in (FLOAT, ): return float(value) if type in (TIMESTAMP, ): return Converter.DatetimeToStringConverter().convert_back(value) if type in (UUID, ): return Converter.UuidToStringConverter().convert_back(value) if type in (PATH, ): return Converter.PathToStringConverter().convert_back(value) return value
def dict_value(type: str, value): if value is None: return None if type in (SET, ): return list(value) if type in (BOOLEAN, ): return bool(value) if type in (INT, ): return int(value) if type in (FLOAT, ): return float(value) if type in (TIMESTAMP): return Converter.DatetimeToStringConverter().convert(value) if type in (UUID): return Converter.UuidToStringConverter().convert(value) if type in (PATH): return Converter.PathToStringConverter().convert(value) return value
def __init__(self) -> None: super().__init__(self.__class__.type) self.define_property("project_folder_path", converter=Converter.PathToStringConverter(), hidden=True)
def __init__(self): super().__init__(self.__class__.type) self.define_property("project_path", converter=Converter.PathToStringConverter())