Ejemplo n.º 1
0
class NewCodeImportForm(Interface):
    """The fields presented on the form for editing a code import."""

    use_template(IBranch, ['owner'])
    use_template(ICodeImport, ['rcs_type', 'cvs_root', 'cvs_module'])

    svn_branch_url = URIField(
        title=_("Branch URL"), required=False,
        description=_(
            "The URL of a Subversion branch, starting with svn:// or "
            "http(s)://.   You can include a username and password as part "
            "of the url, but this will be displayed on the branch page."),
        allowed_schemes=["http", "https", "svn"],
        allow_userinfo=True,
        allow_port=True,
        allow_query=False,
        allow_fragment=False,
        trailing_slash=False)

    git_repo_url = URIField(
        title=_("Repo URL"), required=False,
        description=_(
            "The URL of the git repository.  The HEAD branch will be "
            "imported."),
        allowed_schemes=["git", "http", "https"],
        allow_userinfo=True,
        allow_port=True,
        allow_query=False,
        allow_fragment=False,
        trailing_slash=False)

    bzr_branch_url = URIField(
        title=_("Branch URL"), required=False,
        description=_("The URL of the Bazaar branch."),
        allowed_schemes=["http", "https", "bzr", "ftp"],
        allow_userinfo=True,
        allow_port=True,
        allow_query=False,     # Query makes no sense in Bazaar
        allow_fragment=False,  # Fragment makes no sense in Bazaar
        trailing_slash=False)

    branch_name = copy_field(
        IBranch['name'],
        __name__='branch_name',
        title=_('Branch Name'),
        description=_(
            "This will be used in the branch URL to identify the "
            "imported branch.  Examples: main, trunk."),
        )

    product = Choice(
        title=_('Project'),
        description=_("The Project to associate the code import with."),
        vocabulary="Product",
        )
Ejemplo n.º 2
0
class SetBranchForm(Interface):
    """The fields presented on the form for setting a branch."""

    use_template(ICodeImport, ['cvs_module'])

    rcs_type = Choice(title=_("Type of RCS"),
        required=False, vocabulary=RevisionControlSystems,
        description=_(
            "The version control system to import from. "))

    repo_url = URIField(
        title=_("Branch URL"), required=True,
        description=_("The URL of the branch."),
        allowed_schemes=["http", "https"],
        allow_userinfo=False, allow_port=True, allow_query=False,
        allow_fragment=False, trailing_slash=False)

    branch_location = copy_field(
        IProductSeries['branch'], __name__='branch_location',
        title=_('Branch'),
        description=_(
            "The Bazaar branch for this series in Launchpad, "
            "if one exists."))

    branch_type = Choice(
        title=_('Import type'), vocabulary=BRANCH_TYPE_VOCABULARY,
        description=_("The type of import"), required=True)

    branch_name = copy_field(
        IBranch['name'], __name__='branch_name', title=_('Branch name'),
        description=_(''), required=True)

    branch_owner = copy_field(
        IBranch['owner'], __name__='branch_owner', title=_('Branch owner'),
        description=_(''), required=True)
Ejemplo n.º 3
0
class ISnapEditSchema(Interface):
    """Schema for adding or editing a snap package."""

    use_template(ISnap, include=[
        'owner',
        'name',
        'private',
        'require_virtualized',
        'allow_internet',
        'build_source_tarball',
        'auto_build',
        'auto_build_channels',
        'store_upload',
        ])
    store_distro_series = Choice(
        vocabulary='BuildableSnappyDistroSeries', required=True,
        title=u'Series')
    vcs = Choice(vocabulary=VCSType, required=True, title=u'VCS')

    # Each of these is only required if vcs has an appropriate value.  Later
    # validation takes care of adjusting the required attribute.
    branch = copy_field(ISnap['branch'], required=True)
    git_ref = copy_field(ISnap['git_ref'], required=True)

    # These are only required if auto_build is True.  Later validation takes
    # care of adjusting the required attribute.
    auto_build_archive = copy_field(ISnap['auto_build_archive'], required=True)
    auto_build_pocket = copy_field(ISnap['auto_build_pocket'], required=True)

    # This is only required if store_upload is True.  Later validation takes
    # care of adjusting the required attribute.
    store_name = copy_field(ISnap['store_name'], required=True)
    store_channels = copy_field(ISnap['store_channels'], required=True)
Ejemplo n.º 4
0
class ISourcePackageEditSchema(Interface):
    """Schema for adding or editing a recipe."""

    use_template(ISourcePackageRecipe,
                 include=[
                     'name',
                     'description',
                     'owner',
                     'build_daily',
                     'distroseries',
                 ])
    daily_build_archive = Choice(
        vocabulary='TargetPPAs',
        title=u'Daily build archive',
        description=(u'If built daily, this is the archive where the package '
                     u'will be uploaded.'))
    recipe_text = has_structured_doc(
        Text(title=u'Recipe text',
             required=True,
             description=u"""The text of the recipe.
                <a href="/+help-code/recipe-syntax.html" target="help"
                  >Syntax help&nbsp;
                  <span class="sprite maybe action-icon">
                    Help
                  </span></a>
               """))
Ejemplo n.º 5
0
        class BranchEditSchema(Interface):
            """Defines the fields for the edit form.

            This is necessary so as to make an editable field for the
            branch privacy.  Normally the field is not editable through
            the interface in order to stop direct setting of the private
            attribute, but in this case we actually want the user to be
            able to edit it.
            """
            use_template(IBranch, include=[
                'name',
                'url',
                'description',
                'lifecycle_status',
                'whiteboard',
                ])
            information_type = copy_field(
                IBranch['information_type'], readonly=False,
                vocabulary=InformationTypeVocabulary(types=info_types))
            reviewer = copy_field(IBranch['reviewer'], required=True)
            owner = copy_field(IBranch['owner'], readonly=False)
            target = Reference(
                title=_('Branch target'), required=True,
                schema=IBranchTarget,
                description=_('The project (if any) this branch pertains to. '
                    'If no project is specified, then it is a personal '
                    'branch'))
Ejemplo n.º 6
0
class ILiveFSEditSchema(Interface):
    """Schema for adding or editing a live filesystem."""

    use_template(ILiveFS,
                 include=[
                     'owner',
                     'name',
                     'require_virtualized',
                     'relative_build_score',
                 ])
    distro_series = Choice(vocabulary='BuildableDistroSeries',
                           title=u'Distribution series')
    metadata = Text(
        title=u'Live filesystem build metadata',
        description=(
            u'A JSON dictionary of data about the image.  Entries here will '
            'be passed to the builder slave.'))
Ejemplo n.º 7
0
class WebhookEditSchema(Interface):
    use_template(
        IWebhook, include=['delivery_url', 'event_types', 'active', 'secret'])