예제 #1
0
 def preprocess_body(self, body: EntityDefinition) -> EntityDefinition:
     body = super().preprocess_body(body)
     if "requirements" in body.keys():
         body["requirements_file"] = body.pop("requirements")
     for nullable in remote_nullables + self.collection_nullable:
         if body.get(nullable) == "":
             body[nullable] = None
     return body
예제 #2
0
 def preprocess_body(self, body: EntityDefinition) -> EntityDefinition:
     body = super().preprocess_body(body)
     fields = self.APT_ONLY.intersection(body.keys())
     if fields:
         raise click.ClickException(
             _("{} can't be used when creating VerbatimPublications").format(fields)
         )
     version = body.pop("version", None)
     if version is not None:
         repository_href = body.pop("repository")
         body["repository_version"] = f"{repository_href}versions/{version}/"
     return body
예제 #3
0
 def preprocess_body(self, body: EntityDefinition) -> EntityDefinition:
     body = super().preprocess_body(body)
     if "requirements" in body.keys():
         body["requirements_file"] = body.pop("requirements")
     return body