-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added option to preserve dot file #182
base: master
Are you sure you want to change the base?
Conversation
@@ -487,7 +490,8 @@ def append(self, other: Union[List["Node"], List["Edge"]], forward=None, reverse | |||
self._attrs = o.attrs.copy() | |||
result.append(o) | |||
else: | |||
result.append(Edge(o, forward=forward, reverse=reverse, **self._attrs)) | |||
result.append( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this line changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto formatter must have done that. It doesn't improve readability much though, I will revert it.
@@ -83,6 +83,7 @@ def __init__( | |||
graph_attr: dict = {}, | |||
node_attr: dict = {}, | |||
edge_attr: dict = {}, | |||
preserve_graphviz_file: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about preserve_dot_file
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that better
@@ -138,7 +140,8 @@ def __enter__(self): | |||
def __exit__(self, exc_type, exc_value, traceback): | |||
self.render() | |||
# Remove the graphviz file leaving only the image. | |||
os.remove(self.filename) | |||
if (not self.preserve_graphviz_file): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parentheses are not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my javascript coming out... I'll put it back
Does |
No, but I can arrange for that. |
How about when |
IMO, |
Any changes this gets merged soonish? |
will preserve the dot file generated for later use.
I could also refactor this so that dot file is preserved when
outformat="dot"
This is a non-breaking change because
preserve_graphviz_file
is False by default.