diff options
author | Thanh Ha <zxiiro@gmail.com> | 2019-08-23 09:14:39 -0400 |
---|---|---|
committer | Sorin Sbarnea <ssbarnea@redhat.com> | 2019-09-09 19:23:24 +0100 |
commit | 4d90c187a945c04b9949d5ee7738a049dd634897 (patch) | |
tree | 106bf6e05ad1f2260823e7cd68651b535b8ac3ef /jenkins_jobs/sphinx/yaml.py | |
parent | ead185134d8aa5d3d0974207356de6c4fdb2e6e8 (diff) | |
download | python-jenkins-job-builder-4d90c187a945c04b9949d5ee7738a049dd634897.tar.gz python-jenkins-job-builder-4d90c187a945c04b9949d5ee7738a049dd634897.tar.xz python-jenkins-job-builder-4d90c187a945c04b9949d5ee7738a049dd634897.zip |
Auto-generated output from python-black
Please review the following patch containing the code changes in
the repo. This patch is a transition patch and is the auto-generated
output of the python-black tool.
Change-Id: I2d2de71da8a105fb62b561899ae78441ddab4032
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Diffstat (limited to 'jenkins_jobs/sphinx/yaml.py')
-rw-r--r-- | jenkins_jobs/sphinx/yaml.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/jenkins_jobs/sphinx/yaml.py b/jenkins_jobs/sphinx/yaml.py index 2c7083f7..67ed8f9b 100644 --- a/jenkins_jobs/sphinx/yaml.py +++ b/jenkins_jobs/sphinx/yaml.py @@ -29,7 +29,7 @@ from sphinx.ext.autodoc import FunctionDocumenter from sphinx.locale import _ -yaml_sig_re = re.compile(r'yaml:\s*(.*)') +yaml_sig_re = re.compile(r"yaml:\s*(.*)") class PyYAMLFunction(PyModulelevel): @@ -48,15 +48,14 @@ class PyYAMLFunction(PyModulelevel): retann = None # determine module and class name (if applicable), as well as full name - modname = self.options.get( - 'module', self.env.temp_data.get('py:module')) - classname = self.env.temp_data.get('py:class') + modname = self.options.get("module", self.env.temp_data.get("py:module")) + classname = self.env.temp_data.get("py:class") fullname = name - signode['module'] = modname - signode['class'] = classname - signode['fullname'] = fullname + signode["module"] = modname + signode["class"] = classname + signode["fullname"] = fullname sig_prefix = self.get_signature_prefix(sig) if sig_prefix: @@ -65,7 +64,7 @@ class PyYAMLFunction(PyModulelevel): if name_prefix: signode += addnodes.desc_addname(name_prefix, name_prefix) - anno = self.options.get('annotation') + anno = self.options.get("annotation") signode += addnodes.desc_name(name, name) if not arglist: @@ -75,29 +74,30 @@ class PyYAMLFunction(PyModulelevel): if retann: signode += addnodes.desc_returns(retann, retann) if anno: - signode += addnodes.desc_annotation(' ' + anno, ' ' + anno) + signode += addnodes.desc_annotation(" " + anno, " " + anno) return fullname, name_prefix _pseudo_parse_arglist(signode, arglist) if retann: signode += addnodes.desc_returns(retann, retann) if anno: - signode += addnodes.desc_annotation(' ' + anno, ' ' + anno) + signode += addnodes.desc_annotation(" " + anno, " " + anno) return fullname, name_prefix 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): priority = FunctionDocumenter.priority + 10 - objtype = 'yamlfunction' - directivetype = 'yamlfunction' + objtype = "yamlfunction" + directivetype = "yamlfunction" @classmethod def can_document_member(cls, member, membername, isattr, parent): - if not FunctionDocumenter.can_document_member(member, membername, - isattr, parent): + if not FunctionDocumenter.can_document_member( + member, membername, isattr, parent + ): return False if member.__doc__ is not None and yaml_sig_re.match(member.__doc__): return True @@ -108,7 +108,7 @@ class YAMLFunctionDocumenter(FunctionDocumenter): if len(docstrings) != 1: return doclines = docstrings[0] - setattr(self, '__new_doclines', doclines) + setattr(self, "__new_doclines", doclines) if not doclines: return # match first line of docstring against signature RE @@ -121,11 +121,11 @@ class YAMLFunctionDocumenter(FunctionDocumenter): i = 1 while i < len(doclines) and not doclines[i].strip(): i += 1 - setattr(self, '__new_doclines', doclines[i:]) + setattr(self, "__new_doclines", doclines[i:]) return name def get_doc(self, encoding=None, ignore=1): - lines = getattr(self, '__new_doclines', None) + lines = getattr(self, "__new_doclines", None) if lines is not None: return [lines] return Documenter.get_doc(self, encoding, ignore) @@ -133,7 +133,7 @@ class YAMLFunctionDocumenter(FunctionDocumenter): def format_signature(self): result = self._find_signature() self._name = result - return '' + return "" def format_name(self): return self._name @@ -141,4 +141,4 @@ class YAMLFunctionDocumenter(FunctionDocumenter): def setup(app): app.add_autodocumenter(YAMLFunctionDocumenter) - app.add_directive_to_domain('py', 'yamlfunction', PyYAMLFunction) + app.add_directive_to_domain("py", "yamlfunction", PyYAMLFunction) |