本文整理汇总了Python中buildbot.steps.source.Source.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Source.__init__方法的具体用法?Python Source.__init__怎么用?Python Source.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildbot.steps.source.Source
的用法示例。
在下文中一共展示了Source.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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]
示例2: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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 = ''
示例3: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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)
示例4: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
def __init__(self, repourl, branch='trunk', **kwargs):
self.repourl = repourl
self.branch = branch
kwargs['env'] = {
'GIT_AUTHOR_EMAIL': '[email protected]',
'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)
示例5: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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")
示例6: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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)
示例7: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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)
示例8: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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,
)
示例9: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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)
示例10: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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")
示例11: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
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)
示例12: __init__
# 需要导入模块: from buildbot.steps.source import Source [as 别名]
# 或者: from buildbot.steps.source.Source import __init__ [as 别名]
def __init__(self, rooturl, archives, **kwargs):
self.branch = None
Source.__init__(self, **kwargs)
self.rooturl = rooturl
self.archives = archives
self.working = False