Skip to content

Commit

Permalink
(Fixup pmgr) typing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Yngve S. Kristiansen committed Jun 17, 2024
1 parent 2218dca commit d15de48
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ert/shared/_doc_utils/ert_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(
category: str,
job_source: str,
description: str,
job_config_file: str,
job_config_file: Optional[str],
parser: Optional[Callable[[], ArgumentParser]],
examples: Optional[str] = "",
) -> None:
Expand All @@ -38,10 +38,12 @@ def _create_job_config_section(self) -> nodes.section:
section_id=self.name + "-job-config", title="Job configuration used by ERT"
)

with open(self.job_config_file, encoding="utf-8") as fh:
job_config_text = fh.read()
job_config_text_node = nodes.literal_block(text=job_config_text)
config_section_node.append(job_config_text_node)
if self.job_config_file:
with open(self.job_config_file, encoding="utf-8") as fh:
job_config_text = fh.read()
job_config_text_node = nodes.literal_block(text=job_config_text)
config_section_node.append(job_config_text_node)

return config_section_node

def _create_job_details(self) -> nodes.definition_list:
Expand Down

0 comments on commit d15de48

Please sign in to comment.