lint: blackify

pull/61/head
mingrammer 6 years ago
parent ca1e7ec02a
commit a088225998

@ -75,15 +75,15 @@ class Diagram:
# TODO: Label position option # TODO: Label position option
# TODO: Save directory option (filename + directory?) # TODO: Save directory option (filename + directory?)
def __init__( def __init__(
self, self,
name: str = "", name: str = "",
filename: str = "", filename: str = "",
direction: str = "LR", direction: str = "LR",
outformat: str = "png", outformat: str = "png",
show: bool = True, show: bool = True,
graph_attr: dict = {}, graph_attr: dict = {},
node_attr: dict = {}, node_attr: dict = {},
edge_attr: dict = {}, edge_attr: dict = {},
): ):
"""Diagram represents a global diagrams context. """Diagram represents a global diagrams context.
@ -143,7 +143,7 @@ class Diagram:
setdiagram(None) setdiagram(None)
def _repr_png_(self): def _repr_png_(self):
return self.dot.pipe(format='png') return self.dot.pipe(format="png")
def _validate_direction(self, direction: str) -> bool: def _validate_direction(self, direction: str) -> bool:
direction = direction.upper() direction = direction.upper()
@ -403,18 +403,19 @@ class Edge:
"fontsize": "13", "fontsize": "13",
} }
def __init__(self, def __init__(
node: "Node" = None, self,
forward: bool = False, node: "Node" = None,
reverse: bool = False, forward: bool = False,
xlabel: str = "", reverse: bool = False,
label: str = "", xlabel: str = "",
color: str = "", label: str = "",
style: str = "", color: str = "",
fontcolor: str = "", style: str = "",
fontname: str = "", fontcolor: str = "",
fontsize: str = "", fontname: str = "",
): fontsize: str = "",
):
"""Edge represents an edge between two nodes. """Edge represents an edge between two nodes.
:param node: Parent node. :param node: Parent node.
@ -504,15 +505,14 @@ class Edge:
@property @property
def attrs(self) -> Dict: def attrs(self) -> Dict:
if self.forward and self.reverse: if self.forward and self.reverse:
direction = 'both' direction = "both"
elif self.forward: elif self.forward:
direction = 'forward' direction = "forward"
elif self.reverse: elif self.reverse:
direction = 'back' direction = "back"
else: else:
direction = 'none' direction = "none"
return {**self._attrs, "dir": direction}
return {**self._attrs, 'dir': direction}
Group = Cluster Group = Cluster

Loading…
Cancel
Save