summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs/sphinx/yaml.py
diff options
context:
space:
mode:
Diffstat (limited to 'jenkins_jobs/sphinx/yaml.py')
-rw-r--r--jenkins_jobs/sphinx/yaml.py40
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)