Skip to content

Commit

Permalink
refactor: make cqgi.cqgi_parse public
Browse files Browse the repository at this point in the history
  • Loading branch information
sethfischer committed Jun 25, 2023
1 parent 30004bd commit 376399f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sphinxcontrib/cadquery/cq_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run(self) -> list[Any]:
script_source = "\n".join(self.content)

try:
result = self._cqgi_parse(script_source)
result = self.cqgi_parse(script_source)
except Exception as err:
message = f"CQGI error in {self.name} directive: {err}."
p = nodes.paragraph("", "", nodes.Text(message))
Expand Down Expand Up @@ -100,7 +100,7 @@ def run(self) -> list[Any]:
script_source = self._script_source()

try:
result = self._cqgi_parse(script_source)
result = self.cqgi_parse(script_source)
except Exception as err:
message = f"CQGI error in {self.name} directive: {err}."
p = nodes.paragraph("", "", nodes.Text(message))
Expand Down
2 changes: 1 addition & 1 deletion sphinxcontrib/cadquery/cqgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Cqgi:
"""Execute script source using CQGI."""

@staticmethod
def _cqgi_parse(script_source: str) -> BuildResult:
def cqgi_parse(script_source: str) -> BuildResult:
"""Execute script source using CQGI."""

result = cqgi_parse(script_source).build()
Expand Down
4 changes: 2 additions & 2 deletions sphinxcontrib/cadquery/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def export_svg(source: str, select: str) -> str:

try:
parser = Cqgi()
result = parser._cqgi_parse(source)
result = parser.cqgi_parse(source)
except Exception as err:
raise err

Expand Down Expand Up @@ -384,7 +384,7 @@ def vtk_container_node(self, source: str, height: str):
"""VTK.js model container."""

try:
result = self._cqgi_parse(source)
result = self.cqgi_parse(source)
except Exception as err:
error_text = f"CQGI error in {self.name} directive: "
detail_text = f"{err}."
Expand Down

0 comments on commit 376399f

Please sign in to comment.