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