当前位置: 首页>>代码示例>>Python>>正文


Python source.Source类代码示例

本文整理汇总了Python中buildbot.steps.source.Source的典型用法代码示例。如果您正苦于以下问题:Python Source类的具体用法?Python Source怎么用?Python Source使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Source类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, repourl=None, baseURL=None, mode='incremental',
                 method=None, defaultBranch=None, **kwargs):
        
        self.repourl = repourl
        self.baseURL = baseURL
        self.branch = defaultBranch
        self.mode = mode
        self.method = method
        Source.__init__(self, **kwargs)
        self.addFactoryArguments(repourl=repourl,
                                 mode=mode,
                                 method=method,
                                 baseURL=baseURL,
                                 defaultBranch=defaultBranch,
                                 )
        if repourl and baseURL:
            raise ValueError("you must provide exactly one of repourl and"
                             " baseURL")

        if repourl is None and baseURL is None:
            raise ValueError("you must privide at least one of repourl and"
                             " baseURL")

        if self.repourl is None:
            self.repourl = self.baseURL + defaultBranch

        assert self.mode in ['incremental', 'full']

        if self.mode == 'full':
            assert self.method in ['clean', 'fresh', 'clobber', 'copy', None]
开发者ID:Fieldbyte,项目名称:buildbot,代码行数:30,代码来源:bzr.py

示例2: __init__

    def __init__(self, mode='incremental',
                 method=None, p4base=None, p4branch=None,
                 p4port=None, p4user=None,
                 p4passwd=None, p4extra_views=(), p4line_end='local',
                 p4viewspec=None, p4viewspec_suffix='...',
                 p4client=Interpolate(
                     'buildbot_%(prop:workername)s_%(prop:buildername)s'),
                 p4client_spec_options='allwrite rmdir',
                 p4extra_args=None,
                 p4bin='p4',
                 use_tickets=False,
                 **kwargs):
        self.method = method
        self.mode = mode
        self.p4branch = p4branch
        self.p4bin = p4bin
        self.p4base = p4base
        self.p4port = p4port
        self.p4user = p4user
        self.p4passwd = p4passwd
        self.p4extra_views = p4extra_views
        self.p4viewspec = p4viewspec
        self.p4viewspec_suffix = p4viewspec_suffix
        self.p4line_end = p4line_end
        self.p4client = p4client
        self.p4client_spec_options = p4client_spec_options
        self.p4extra_args = p4extra_args
        self.use_tickets = use_tickets

        Source.__init__(self, **kwargs)

        if self.mode not in self.possible_modes and not interfaces.IRenderable.providedBy(self.mode):
            config.error("mode %s is not an IRenderable, or one of %s" % (
                self.mode, self.possible_modes))

        if not p4viewspec and p4base is None:
            config.error("You must provide p4base or p4viewspec")

        if p4viewspec and (p4base or p4branch or p4extra_views):
            config.error(
                "Either provide p4viewspec or p4base and p4branch (and optionally p4extra_views")

        if p4viewspec and isinstance(p4viewspec, string_types):
            config.error(
                "p4viewspec must not be a string, and should be a sequence of 2 element sequences")

        if not interfaces.IRenderable.providedBy(p4base) and p4base and p4base.endswith('/'):
            config.error(
                'p4base should not end with a trailing / [p4base = %s]' % p4base)

        if not interfaces.IRenderable.providedBy(p4branch) and p4branch and p4branch.endswith('/'):
            config.error(
                'p4branch should not end with a trailing / [p4branch = %s]' % p4branch)

        if (p4branch or p4extra_views) and not p4base:
            config.error(
                'If you specify either p4branch or p4extra_views you must also specify p4base')

        if self.p4client_spec_options is None:
            self.p4client_spec_options = ''
开发者ID:Cray,项目名称:buildbot,代码行数:60,代码来源:p4.py

示例3: __init__

    def __init__(self, baseURL, branch, forceSharedRepo=True, **kwargs):
        Source.__init__(self, **kwargs)
        self.branch = branch
        self.baseURL = baseURL
        self.forceSharedRepo = forceSharedRepo

        self.addFactoryArguments(branch=branch,
                                 baseURL=baseURL,
                                 forceSharedRepo=forceSharedRepo)
开发者ID:B-Rich,项目名称:twisted-buildbot-configuration,代码行数:9,代码来源:bzrsvn.py

示例4: __init__

 def __init__(self, repourl, branch='trunk', **kwargs):
     self.repourl = repourl
     self.branch = branch
     kwargs['env'] = {
             'GIT_AUTHOR_EMAIL': '[email protected]m',
             'GIT_AUTHOR_NAME': 'Twisted Buildbot',
             'GIT_COMMITTER_EMAIL': '[email protected]',
             'GIT_COMMITTER_NAME': 'Twisted Buildbot',
             }
     Source.__init__(self, **kwargs)
     self.addFactoryArguments(repourl=repourl, branch=branch)
开发者ID:rodrigc,项目名称:braid,代码行数:11,代码来源:git.py

示例5: __init__

    def __init__(
        self,
        svnurl=None,
        baseURL=None,
        mode="incremental",
        method=None,
        defaultBranch=None,
        username=None,
        password=None,
        extra_args=None,
        keep_on_purge=None,
        depth=None,
        **kwargs
    ):

        self.svnurl = svnurl
        self.baseURL = baseURL
        self.branch = defaultBranch
        self.username = username
        self.password = password
        self.extra_args = extra_args
        self.keep_on_purge = keep_on_purge or []
        self.depth = depth
        self.method = method
        self.mode = mode
        Source.__init__(self, **kwargs)
        self.addFactoryArguments(
            svnurl=svnurl,
            baseURL=baseURL,
            mode=mode,
            method=method,
            defaultBranch=defaultBranch,
            password=password,
            username=username,
            extra_args=extra_args,
            keep_on_purge=keep_on_purge,
            depth=depth,
        )

        assert self.mode in ["incremental", "full"]
        assert self.method in ["clean", "fresh", "clobber", "copy", "export", None]

        if svnurl and baseURL:
            raise ValueError("you must provide exactly one of svnurl and" " baseURL")

        if svnurl is None and baseURL is None:
            raise ValueError("you must privide at least one of svnurl and" " baseURL")
开发者ID:solarmist,项目名称:buildbot,代码行数:47,代码来源:svn.py

示例6: __init__

    def __init__(self, mode='incremental',
                 method=None, p4base=None, p4branch=None,
                 p4port=None, p4user=None,
                 p4passwd=None, p4extra_views=(), p4line_end='local',
                 p4viewspec=None,
                 p4client=Interpolate('buildbot_%(prop:slavename)s_%(prop:buildername)s'),
                 p4bin='p4',
                 **kwargs):
        self.method = method
        self.mode = mode
        self.p4branch = p4branch
        self.p4bin = p4bin
        self.p4base = p4base
        self.p4port = p4port
        self.p4user = p4user
        self.p4passwd = p4passwd
        self.p4extra_views = p4extra_views
        self.p4viewspec = p4viewspec
        self.p4line_end = p4line_end
        self.p4client = p4client

        Source.__init__(self, **kwargs)

        errors = []
        if self.mode not in self.possible_modes:
            errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes))

        if not p4viewspec and p4base is None:
            errors.append("You must provide p4base or p4viewspec")

        if p4viewspec and (p4base or p4branch or p4extra_views):
            errors.append("Either provide p4viewspec or p4base and p4branch (and optionally p4extra_views")

        if p4viewspec and type(p4viewspec) is StringType:
            errors.append("p4viewspec must not be a string, and should be a sequence of 2 element sequences")

        if not interfaces.IRenderable.providedBy(p4base) and p4base and p4base.endswith('/'):
            errors.append('p4base should not end with a trailing / [p4base = %s]' % p4base)

        if not interfaces.IRenderable.providedBy(p4branch) and p4branch and p4branch.endswith('/'):
            errors.append('p4branch should not end with a trailing / [p4branch = %s]' % p4branch)

        if (p4branch or p4extra_views) and not p4base:
            errors.append('If you specify either p4branch or p4extra_views you must also specify p4base')

        if errors:
            raise ConfigErrors(errors)
开发者ID:1stvamp,项目名称:buildbot,代码行数:47,代码来源:p4.py

示例7: __init__

    def __init__(self, repourl=None, baseURL=None, mode='incremental',
                 method=None, defaultBranch=None, username=None,
                 password=None, extra_args=None, keep_on_purge=None,
                 depth=None, **kwargs):

        self.repourl = repourl
        self.baseURL = baseURL
        self.branch = defaultBranch
        self.username = username
        self.password = password
        self.extra_args = extra_args
        self.keep_on_purge = keep_on_purge or []
        self.depth = depth
        self.method=method
        self.mode = mode
        Source.__init__(self, **kwargs)
        self.addFactoryArguments(repourl=repourl,
                                 baseURL=baseURL,
                                 mode=mode,
                                 method=method,
                                 defaultBranch=defaultBranch,
                                 password=password,
                                 username=username,
                                 extra_args=extra_args,
                                 keep_on_purge=keep_on_purge,
                                 depth=depth,
                                 )
        errors = []
        if self.mode not in self.possible_modes:
            errors.append("mode %s is not one of %s" % (self.mode, self.possible_modes))
        if self.method not in self.possible_methods:
            errors.append("method %s is not one of %s" % (self.method, self.possible_methods))

        if repourl and baseURL:
            errors.append("you must provide exactly one of repourl and baseURL")

        if repourl is None and baseURL is None:
            errors.append("you must privide at least one of repourl and baseURL")
        if errors:
            raise ConfigErrors(errors)
开发者ID:michaelhuang,项目名称:buildbot,代码行数:40,代码来源:svn.py

示例8: __init__

    def __init__(self, cvsroot=None, cvsmodule='', mode='incremental',
                 method=None, branch=None, global_options=[], extra_options=[],
                 login=None, **kwargs):

        self.cvsroot = cvsroot
        self.cvsmodule = cvsmodule
        self.branch = branch
        self.global_options = global_options
        self.extra_options = extra_options
        self.login = login
        self.mode = mode
        self.method = method
        self.srcdir = 'source'
        Source.__init__(self, **kwargs)
        self.addFactoryArguments(cvsroot=cvsroot,
                                 cvsmodule=cvsmodule,
                                 mode=mode,
                                 method=method,
                                 global_options=global_options,
                                 extra_options=extra_options,
                                 login=login,
                                 )
开发者ID:allannss,项目名称:buildbot,代码行数:22,代码来源:cvs.py

示例9: __init__

    def __init__(self, repourl=None, mode='incremental',
                 method=None, defaultBranch=None, branchType='dirname',
                 clobberOnBranchChange=True, **kwargs):

        """
        @type  repourl: string
        @param repourl: the URL which points at the Mercurial repository.
                        if 'dirname' branches are enabled, this is the base URL
                        to which a branch name will be appended. It should
                        probably end in a slash.

        @param defaultBranch: if branches are enabled, this is the branch
                              to use if the Build does not specify one
                              explicitly.
                              For 'dirname' branches, It will simply be
                              appended to C{repourl} and the result handed to
                              the 'hg update' command.
                              For 'inrepo' branches, this specifies the named
                              revision to which the tree will update after a
                              clone.

        @param branchType: either 'dirname' or 'inrepo' depending on whether
                           the branch name should be appended to the C{repourl}
                           or the branch is a mercurial named branch and can be
                           found within the C{repourl}

        @param clobberOnBranchChange: boolean, defaults to True. If set and
                                      using inrepos branches, clobber the tree
                                      at each branch change. Otherwise, just
                                      update to the branch.
        """
        
        self.repourl = repourl
        self.defaultBranch = self.branch = defaultBranch
        self.branchType = branchType
        self.method = method
        self.clobberOnBranchChange = clobberOnBranchChange
        self.mode = mode
        Source.__init__(self, **kwargs)
        self.addFactoryArguments(repourl=repourl,
                                 mode=mode,
                                 method=method,
                                 defaultBranch=defaultBranch,
                                 branchType=branchType,
                                 clobberOnBranchChange=
                                 clobberOnBranchChange,
                                 )

        errors = []
        if self.mode not in self.possible_modes:
            errors.append("mode %s is not one of %s" %
                            (self.mode, self.possible_modes))
        if self.method not in self.possible_methods:
            errors.append("method %s is not one of %s" %
                            (self.method, self.possible_methods))
        if self.branchType not in self.possible_branchTypes:
            errors.append("branchType %s is not one of %s" %
                            (self.branchType, self.possible_branchTypes))

        if repourl is None:
            errors.append("you must privide a repourl")
        
        if errors:
            raise ConfigErrors(errors)
开发者ID:michaelhuang,项目名称:buildbot,代码行数:64,代码来源:mercurial.py

示例10: finished

 def finished(self, results):
     if results == SUCCESS:
         self.step_status.setText(['merge', 'forward'])
     else:
         self.step_status.setText(['merge', 'forward', 'failed'])
     return Source.finished(self, results)
开发者ID:rodrigc,项目名称:braid,代码行数:6,代码来源:git.py

示例11: __init__

    def __init__(self, repourl=None, baseURL=None, mode='incremental',
                 method=None, defaultBranch=None, branchType='dirname',
                 clobberOnBranchChange=True, **kwargs):

        """
        @type  repourl: string
        @param repourl: the URL which points at the Mercurial repository.
                        This uses the 'default' branch unless defaultBranch is
                        specified below and the C{branchType} is set to
                        'inrepo'.  It is an error to specify a branch without
                        setting the C{branchType} to 'inrepo'.

        @param baseURL: if 'dirname' branches are enabled, this is the base URL
                        to which a branch name will be appended. It should
                        probably end in a slash.  Use exactly one of C{repourl}
                        and C{baseURL}.

        @param defaultBranch: if branches are enabled, this is the branch
                              to use if the Build does not specify one
                              explicitly.
                              For 'dirname' branches, It will simply be
                              appended to C{baseURL} and the result handed to
                              the 'hg update' command.
                              For 'inrepo' branches, this specifies the named
                              revision to which the tree will update after a
                              clone.

        @param branchType: either 'dirname' or 'inrepo' depending on whether
                           the branch name should be appended to the C{baseURL}
                           or the branch is a mercurial named branch and can be
                           found within the C{repourl}

        @param clobberOnBranchChange: boolean, defaults to True. If set and
                                      using inrepos branches, clobber the tree
                                      at each branch change. Otherwise, just
                                      update to the branch.
        """
        
        self.repourl = repourl
        self.baseURL = baseURL
        self.defaultBranch = self.branch = defaultBranch
        self.branchType = branchType
        self.method = method
        self.clobberOnBranchChange = clobberOnBranchChange
        self.mode = mode
        Source.__init__(self, **kwargs)
        self.addFactoryArguments(repourl=repourl,
                                 baseURL=baseURL,
                                 mode=mode,
                                 method=method,
                                 defaultBranch=defaultBranch,
                                 branchType=branchType,
                                 clobberOnBranchChange=
                                 clobberOnBranchChange,
                                 )

        assert self.mode in ['incremental', 'full']

        if repourl and baseURL:
            raise ValueError("you must provide exactly one of repourl and"
                             " baseURL")

        if repourl is None and baseURL is None:
            raise ValueError("you must privide at least one of repourl and"
                             " baseURL")
开发者ID:sffjunkie,项目名称:buildbot,代码行数:65,代码来源:mercurial.py

示例12: __init__

    def __init__(self, repourl=None, branch='master', mode='incremental',
                 method=None, submodule=False, shallow=False, progress=False,
                 retryFetch=False, clobberOnFailure=False, **kwargs):
        """
        @type  repourl: string
        @param repourl: the URL which points at the git repository

        @type  branch: string
        @param branch: The branch or tag to check out by default. If
                       a build specifies a different branch, it will
                       be used instead of this.

        @type  submodules: boolean
        @param submodules: Whether or not to update (and initialize)
                       git submodules.

        @type  mode: string
        @param mode: Type of checkout. Described in docs.

        @type  method: string
        @param method: Full builds can be done is different ways. This parameter
                       specifies which method to use.

        @type  progress: boolean
        @param progress: Pass the --progress option when fetching. This
                         can solve long fetches getting killed due to
                         lack of output, but requires Git 1.7.2+.
        @type  shallow: boolean
        @param shallow: Use a shallow or clone, if possible

        @type  retryFetch: boolean
        @param retryFetch: Retry fetching before failing source checkout.
        """

        self.branch    = branch
        self.method    = method
        self.prog  = progress
        self.repourl   = repourl
        self.retryFetch = retryFetch
        self.submodule = submodule
        self.shallow   = shallow
        self.fetchcount = 0
        self.clobberOnFailure = clobberOnFailure
        Source.__init__(self, **kwargs)
        self.addFactoryArguments(branch=branch,
                                 mode=mode,
                                 method=method,
                                 progress=progress,
                                 repourl=repourl,
                                 submodule=submodule,
                                 shallow=shallow,
                                 retryFetch=retryFetch,
                                 clobberOnFailure=
                                 clobberOnFailure,
                                 )

        self.mode = mode
        assert self.mode in ['incremental', 'full']
        assert self.repourl is not None
        if self.mode == 'full':
            assert self.method in ['clean', 'fresh', 'clobber', 'copy', None]
        self.repourl = self.repourl and _ComputeRepositoryURL(self.repourl)
开发者ID:abompard,项目名称:buildbot,代码行数:62,代码来源:git.py

示例13: test_backward_compatibility_render

 def test_backward_compatibility_render(self):
     s = Source()
     s.build = Build()
     self.assertEquals(s.computeRepositoryURL(WithProperties("repourl%(foo)s")), "repourlbar")
开发者ID:aslater,项目名称:buildbot,代码行数:4,代码来源:test_steps_source_Source.py

示例14: test_callable

 def test_callable(self):
     s = Source()
     s.build = Build()
     func = lambda x: x[::-1]
     self.assertEquals(s.computeRepositoryURL(func), "tset")
开发者ID:Almad,项目名称:buildbot,代码行数:5,代码来源:test_source_repourl.py

示例15: test_dict

 def test_dict(self):
     s = Source()
     s.build = Build()
     dict = {}
     dict['test'] = "ssh://server/testrepository"
     self.assertEquals(s.computeRepositoryURL(dict), "ssh://server/testrepository")
开发者ID:Almad,项目名称:buildbot,代码行数:6,代码来源:test_source_repourl.py


注:本文中的buildbot.steps.source.Source类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。