Remove function definition_type from NFDocs class

Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
Thomas A. Christensen II 2022-01-10 16:14:42 -06:00
parent ccdb61ac27
commit f555cd9c20
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -5,14 +5,7 @@ from docutils import nodes
from docutils.parsers.rst import Directive from docutils.parsers.rst import Directive
from docutils.parsers.rst import directives from docutils.parsers.rst import directives
class NFDocs(Directive): def definition_type(signature):
# Class default overrides
required_arguments = 1
# Declare the docstring starting characters
DOC_STARTER = "/// "
def definition_type(self, signature):
# Returns "name", workflow|process|function # Returns "name", workflow|process|function
def_type = "unknown" def_type = "unknown"
if "workflow" in signature: if "workflow" in signature:
@ -32,6 +25,13 @@ class NFDocs(Directive):
# Return the results # Return the results
return def_name, def_type return def_name, def_type
class NFDocs(Directive):
# Class default overrides
required_arguments = 1
# Declare the docstring starting characters
DOC_STARTER = "/// "
def params_to_list(self, params): def params_to_list(self, params):
if "tuple" in params.keys(): if "tuple" in params.keys():
tuple_item = nodes.list_item() tuple_item = nodes.list_item()
@ -100,7 +100,7 @@ class NFDocs(Directive):
# Parse out the docstrings and put them in the appropriate dictionary # Parse out the docstrings and put them in the appropriate dictionary
for pos in docstring_positions: for pos in docstring_positions:
proc_name, proc_type = self.definition_type(nextflow_lines[pos[-1]+1]) proc_name, proc_type = definition_type(nextflow_lines[pos[-1]+1])
doc_yaml = "" doc_yaml = ""
for i in pos: for i in pos:
doc_yaml = doc_yaml + nextflow_lines[i].replace(self.DOC_STARTER, "") doc_yaml = doc_yaml + nextflow_lines[i].replace(self.DOC_STARTER, "")