Starting on a visibility handler

This commit is contained in:
Erik Thuning 2024-03-27 10:50:09 +01:00
parent bfe68b9250
commit 3d9075a5e0

@ -0,0 +1,32 @@
from .handler import Handler
from ..exceptions import ValidationException
@Handler.register
class VisibilityHandler(Handler):
"""
This class handles visibility settings for streams.
"""
@classmethod
def wants(cls, jobspec, existing_package):
"""
Return True if this handler wants to process this jobspec.
Raises an exception if the job is wanted but doesn't pass validation.
In order for a job to be wanted, the field 'sources' must exist and
at least one of the source items must contain a 'enabled' field.
"""
pass
@classmethod
def _validate(cls, jobspec, existing_package):
"""
Return True if the job is valid for this handler.
A job is valid as long as at least one of the package's source items
"""
pass
def _handle(self, jobspec, existing_package, tempdir):
pass