Skip to content

Commit

Permalink
lint: blackify
Browse files Browse the repository at this point in the history
  • Loading branch information
mingrammer committed Mar 9, 2020
1 parent ca1e7ec commit a088225
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions diagrams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ class Diagram:
# TODO: Label position option
# TODO: Save directory option (filename + directory?)
def __init__(
self,
name: str = "",
filename: str = "",
direction: str = "LR",
outformat: str = "png",
show: bool = True,
graph_attr: dict = {},
node_attr: dict = {},
edge_attr: dict = {},
self,
name: str = "",
filename: str = "",
direction: str = "LR",
outformat: str = "png",
show: bool = True,
graph_attr: dict = {},
node_attr: dict = {},
edge_attr: dict = {},
):
"""Diagram represents a global diagrams context.
Expand Down Expand Up @@ -143,7 +143,7 @@ def __exit__(self, exc_type, exc_value, traceback):
setdiagram(None)

def _repr_png_(self):
return self.dot.pipe(format='png')
return self.dot.pipe(format="png")

def _validate_direction(self, direction: str) -> bool:
direction = direction.upper()
Expand Down Expand Up @@ -403,18 +403,19 @@ class Edge:
"fontsize": "13",
}

def __init__(self,
node: "Node" = None,
forward: bool = False,
reverse: bool = False,
xlabel: str = "",
label: str = "",
color: str = "",
style: str = "",
fontcolor: str = "",
fontname: str = "",
fontsize: str = "",
):
def __init__(
self,
node: "Node" = None,
forward: bool = False,
reverse: bool = False,
xlabel: str = "",
label: str = "",
color: str = "",
style: str = "",
fontcolor: str = "",
fontname: str = "",
fontsize: str = "",
):
"""Edge represents an edge between two nodes.
:param node: Parent node.
Expand Down Expand Up @@ -504,15 +505,14 @@ def connect(self, other: Union["Node", "Edge", List["Node"]]):
@property
def attrs(self) -> Dict:
if self.forward and self.reverse:
direction = 'both'
direction = "both"
elif self.forward:
direction = 'forward'
direction = "forward"
elif self.reverse:
direction = 'back'
direction = "back"
else:
direction = 'none'

return {**self._attrs, 'dir': direction}
direction = "none"
return {**self._attrs, "dir": direction}


Group = Cluster

0 comments on commit a088225

Please sign in to comment.