def __init__(self, name, version, metadata): self.__name__ = name self.release_files = OOBTree() self.version = version self.original_metadata = metadata schema = Metadata() self.metadata = schema.serialize(metadata) self.metadata = schema.deserialize(self.metadata)
def __init__(self, name, version, metadata, deserialize_metadata=True): self.__name__ = name self.release_files = OOBTree() self.version = version self.original_metadata = metadata if deserialize_metadata: schema = Metadata() self.metadata = schema.serialize(metadata) self.metadata = schema.deserialize(self.metadata)
def evolve(context): root = context['repository'] schema = Metadata(typ=NullableMapping(), default=None) for package in root: print(package.name) for release in package: original_metadata = release.original_metadata serialized_metadata = schema.serialize(original_metadata) release.metadata = schema.deserialize(serialized_metadata) context.evolved = 3
def evolve(context): root = context['repository'] schema = Metadata() for package_name in root: package = root[package_name] for release_name in package.releases: release = package[release_name] original_metadata = release.original_metadata serialized_metadata = schema.serialize(original_metadata) release.metadata = schema.deserialize(serialized_metadata) context.evolved = 2
def __init__(self, version, metadata={}, deserialize_metadata=True, package=None, **kwargs): self.release_files = MyOOBTree() self.version = version self.package = package self.original_metadata = metadata or {} if deserialize_metadata: schema = Metadata() self.metadata = schema.serialize(self.original_metadata) self.metadata = schema.deserialize(self.metadata) super().__init__( name=version, metadata=metadata, deserialize_metadata=True, package=package, **kwargs, )