Make code pass pep8 1.2 checks.
Change-Id: I5544ce07c7423a0e530860fa5637af26c73f6521 Reviewed-on: https://review.openstack.org/13162 Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
41b0d13ee6
commit
78c083f590
@ -27,6 +27,7 @@ import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class YamlParser(object):
|
||||
def __init__(self):
|
||||
self.registry = ModuleRegistry()
|
||||
|
@ -39,6 +39,7 @@ Example::
|
||||
import xml.etree.ElementTree as XML
|
||||
import jenkins_jobs.modules.base
|
||||
|
||||
|
||||
def shell(parser, xml_parent, data):
|
||||
"""yaml: shell
|
||||
Execute a shell command.
|
||||
@ -54,6 +55,7 @@ def shell(parser, xml_parent, data):
|
||||
shell = XML.SubElement(xml_parent, 'hudson.tasks.Shell')
|
||||
XML.SubElement(shell, 'command').text = data
|
||||
|
||||
|
||||
def trigger_builds(parser, xml_parent, data):
|
||||
"""yaml: trigger-builds
|
||||
Trigger builds of other jobs.
|
||||
@ -84,7 +86,7 @@ def trigger_builds(parser, xml_parent, data):
|
||||
properties = XML.SubElement(params, 'properties')
|
||||
properties.text = project_def['predefined-parameters']
|
||||
if(project_def.get('current-parameters')):
|
||||
XML.SubElement(tconfigs,
|
||||
XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.CurrentBuildParameters')
|
||||
if(len(list(tconfigs)) == 0):
|
||||
tconfigs.set('class', 'java.util.Collections$EmptyList')
|
||||
@ -99,11 +101,13 @@ def trigger_builds(parser, xml_parent, data):
|
||||
'buildAllNodesWithLabel')
|
||||
build_all_nodes_with_label.text = 'false'
|
||||
|
||||
|
||||
def builders_from(parser, xml_parent, data):
|
||||
pbs = XML.SubElement(xml_parent,
|
||||
pbs = XML.SubElement(xml_parent,
|
||||
'hudson.plugins.templateproject.ProxyBuilder')
|
||||
XML.SubElement(pbs, 'projectName').text = data
|
||||
|
||||
|
||||
class Builders(jenkins_jobs.modules.base.Base):
|
||||
sequence = 60
|
||||
|
||||
|
@ -58,7 +58,8 @@ def throttle(parser, xml_parent, data):
|
||||
"""yaml: throttle
|
||||
Throttles the number of builds for this job.
|
||||
Requires the Jenkins `Throttle Concurrent Builds Plugin.
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/Throttle+Concurrent+Builds+Plugin>`_
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/
|
||||
Throttle+Concurrent+Builds+Plugin>`_
|
||||
|
||||
:arg int max-per-node: max concurrent builds per node (default 0)
|
||||
:arg int max-total: max concurrent builds (default 0)
|
||||
|
@ -71,7 +71,8 @@ def trigger_parameterized_builds(parser, xml_parent, data):
|
||||
"""yaml: trigger-parameterized-builds
|
||||
Trigger parameterized builds of other jobs.
|
||||
Requires the Jenkins `Parameterized Trigger Plugin.
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin>`_
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/
|
||||
Parameterized+Trigger+Plugin>`_
|
||||
|
||||
:arg str project: name of the job to trigger
|
||||
:arg str predefined-parameters: parameters to pass to the other
|
||||
@ -386,11 +387,14 @@ def scp(parser, xml_parent, data):
|
||||
else:
|
||||
XML.SubElement(entry_e, 'copyAfterFailure').text = 'false'
|
||||
|
||||
|
||||
def pipeline(parser, xml_parent, data):
|
||||
pippub = XML.SubElement(xml_parent,
|
||||
'au.com.centrumsystems.hudson.plugin.buildpipeline.trigger.BuildPipelineTrigger')
|
||||
pippub = XML.SubElement(xml_parent,
|
||||
'au.com.centrumsystems.hudson.plugin.'
|
||||
'buildpipeline.trigger.BuildPipelineTrigger')
|
||||
XML.SubElement(pippub, 'downstreamProjectNames').text = data
|
||||
|
||||
|
||||
class Publishers(jenkins_jobs.modules.base.Base):
|
||||
sequence = 70
|
||||
|
||||
|
@ -18,6 +18,7 @@ The Zuul module adds triggers that configure jobs for use with Zuul_.
|
||||
.. _Zuul: http://ci.openstack.org/zuul/
|
||||
"""
|
||||
|
||||
|
||||
def zuul():
|
||||
"""yaml: zuul
|
||||
Configure this job to be triggered by Zuul.
|
||||
@ -28,6 +29,7 @@ def zuul():
|
||||
- zuul
|
||||
"""
|
||||
|
||||
|
||||
def zuul_post():
|
||||
"""yaml: zuul-post
|
||||
Configure this post-merge job to be triggered by Zuul.
|
||||
|
@ -27,6 +27,7 @@ from sphinx.locale import l_, _
|
||||
|
||||
yaml_sig_re = re.compile('yaml:\s*(.*)')
|
||||
|
||||
|
||||
class PyYAMLFunction(PyModulelevel):
|
||||
def handle_signature(self, sig, signode):
|
||||
"""Transform a Python signature into RST nodes.
|
||||
@ -47,7 +48,7 @@ class PyYAMLFunction(PyModulelevel):
|
||||
'module', self.env.temp_data.get('py:module'))
|
||||
classname = self.env.temp_data.get('py:class')
|
||||
|
||||
fullname=name
|
||||
fullname = name
|
||||
|
||||
signode['module'] = modname
|
||||
signode['class'] = classname
|
||||
@ -83,6 +84,7 @@ class PyYAMLFunction(PyModulelevel):
|
||||
def get_index_text(self, modname, name_cls):
|
||||
return _('%s (in module %s)') % (name_cls[0], modname)
|
||||
|
||||
|
||||
class YAMLFunctionDocumenter(FunctionDocumenter):
|
||||
priority = FunctionDocumenter.priority + 10
|
||||
objtype = 'yamlfunction'
|
||||
@ -132,6 +134,7 @@ class YAMLFunctionDocumenter(FunctionDocumenter):
|
||||
def format_name(self):
|
||||
return self._name
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.add_autodocumenter(YAMLFunctionDocumenter)
|
||||
app.add_directive_to_domain('py', 'yamlfunction', PyYAMLFunction)
|
||||
|
Loading…
Reference in New Issue
Block a user