From 78c083f590402dc2809545466a7dda1294384174 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 17 Sep 2012 14:39:00 -0700 Subject: [PATCH] Make code pass pep8 1.2 checks. Change-Id: I5544ce07c7423a0e530860fa5637af26c73f6521 Reviewed-on: https://review.openstack.org/13162 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins --- jenkins_jobs/builder.py | 1 + jenkins_jobs/modules/builders.py | 8 ++++++-- jenkins_jobs/modules/properties.py | 3 ++- jenkins_jobs/modules/publishers.py | 10 +++++++--- jenkins_jobs/modules/zuul.py | 2 ++ jenkins_jobs/sphinx/yaml.py | 5 ++++- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/jenkins_jobs/builder.py b/jenkins_jobs/builder.py index c5b68d7ce..303b4efd5 100644 --- a/jenkins_jobs/builder.py +++ b/jenkins_jobs/builder.py @@ -27,6 +27,7 @@ import logging logger = logging.getLogger(__name__) + class YamlParser(object): def __init__(self): self.registry = ModuleRegistry() diff --git a/jenkins_jobs/modules/builders.py b/jenkins_jobs/modules/builders.py index cd9d0473a..ab1f819ef 100644 --- a/jenkins_jobs/modules/builders.py +++ b/jenkins_jobs/modules/builders.py @@ -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 diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py index 83198c1d1..6ad401c6a 100644 --- a/jenkins_jobs/modules/properties.py +++ b/jenkins_jobs/modules/properties.py @@ -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. - `_ + `_ :arg int max-per-node: max concurrent builds per node (default 0) :arg int max-total: max concurrent builds (default 0) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 3bc4abd21..5274d7099 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -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. - `_ + `_ :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 diff --git a/jenkins_jobs/modules/zuul.py b/jenkins_jobs/modules/zuul.py index a7aa9f504..6daa7dc3a 100644 --- a/jenkins_jobs/modules/zuul.py +++ b/jenkins_jobs/modules/zuul.py @@ -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. diff --git a/jenkins_jobs/sphinx/yaml.py b/jenkins_jobs/sphinx/yaml.py index ec7767fb9..5de0f5513 100644 --- a/jenkins_jobs/sphinx/yaml.py +++ b/jenkins_jobs/sphinx/yaml.py @@ -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)