Skip to content

Commit

Permalink
expose/document DotSyntaxWarning, standardize exception order
Browse files Browse the repository at this point in the history
  • Loading branch information
xflr6 committed Apr 16, 2022
1 parent fc75da8 commit 9a63a50
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
8 changes: 5 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ API Reference
graphviz.Source
graphviz.escape
graphviz.nohtml
graphviz.RequiredArgumentError
graphviz.ExecutableNotFound
graphviz.CalledProcessError
graphviz.RequiredArgumentError
graphviz.render
graphviz.pipe
graphviz.pipe_string
Expand Down Expand Up @@ -92,12 +92,12 @@ Quoting/escaping
Exceptions
----------

.. autoexception:: graphviz.RequiredArgumentError

.. autoexception:: graphviz.ExecutableNotFound

.. autoexception:: graphviz.CalledProcessError

.. autoexception:: graphviz.RequiredArgumentError

.. autoexception:: graphviz.FileExistsError


Expand All @@ -108,6 +108,8 @@ Warnings

.. autoexception:: graphviz.FormatSuffixMismatchWarning

.. autoexception:: graphviz.DotSyntaxWarning


Low-level functions
-------------------
Expand Down
21 changes: 12 additions & 9 deletions graphviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
from .backend import (DOT_BINARY, UNFLATTEN_BINARY,
render, pipe, pipe_string, pipe_lines, pipe_lines_string,
unflatten, version, view)
from .exceptions import (RequiredArgumentError, FileExistsError,
from .exceptions import (ExecutableNotFound, CalledProcessError,
RequiredArgumentError, FileExistsError,
UnknownSuffixWarning, FormatSuffixMismatchWarning,
DotSyntaxWarning,
ExecutableNotFound, CalledProcessError)
DotSyntaxWarning)
from .graphs import Graph, Digraph
from .jupyter_integration import SUPPORTED_JUPYTER_FORMATS
from .parameters import ENGINES, FORMATS, RENDERERS, FORMATTERS
Expand All @@ -49,10 +49,10 @@
'escape', 'nohtml',
'render', 'pipe', 'pipe_string', 'pipe_lines', 'pipe_lines_string',
'unflatten', 'version', 'view',
'ExecutableNotFound', 'CalledProcessError',
'RequiredArgumentError', 'FileExistsError',
'UnknownSuffixWarning', 'FormatSuffixMismatchWarning',
'DotSyntaxWarning',
'ExecutableNotFound', 'CalledProcessError',
'set_default_engine', 'set_default_format', 'set_jupyter_format']

__title__ = 'graphviz'
Expand Down Expand Up @@ -88,10 +88,16 @@
""":class:`pathlib.Path` of unflatten command (``Path('unflatten')``)."""


ExecutableNotFound = ExecutableNotFound


CalledProcessError = CalledProcessError


RequiredArgumentError = RequiredArgumentError


ExecutableNotFound = ExecutableNotFound
FileExistsError = FileExistsError


UnknownSuffixWarning = UnknownSuffixWarning
Expand All @@ -100,7 +106,4 @@
FormatSuffixMismatchWarning = FormatSuffixMismatchWarning


CalledProcessError = CalledProcessError


FileExistsError = FileExistsError
DotSyntaxWarning = DotSyntaxWarning
6 changes: 3 additions & 3 deletions graphviz/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from .backend.execute import ExecutableNotFound, CalledProcessError

__all__ = ['RequiredArgumentError', 'FileExistsError',
__all__ = ['ExecutableNotFound', 'CalledProcessError',
'RequiredArgumentError', 'FileExistsError',
'UnknownSuffixWarning', 'FormatSuffixMismatchWarning',
'DotSyntaxWarning',
'ExecutableNotFound', 'CalledProcessError']
'DotSyntaxWarning']


class RequiredArgumentError(TypeError):
Expand Down

0 comments on commit 9a63a50

Please sign in to comment.