-
Notifications
You must be signed in to change notification settings - Fork 532
No longer concatenating extensions #2381
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1314,18 +1314,19 @@ def export_graph(graph_in, | |
def format_dot(dotfilename, format='png'): | ||
"""Dump a directed graph (Linux only; install via `brew` on OSX)""" | ||
if format != 'dot': | ||
cmd = 'dot -T%s -O \'%s\'' % (format, dotfilename) | ||
dot_base = os.path.splitext(dotfilename)[0] | ||
formatted_dot = '{}.{}'.format(dot_base, format) | ||
cmd = 'dot -T{} -o"{}" "{}"'.format(format, formatted_dot, dotfilename) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Returning dot_base = os.path.splitext(dotfilename)[0]
orig_dot = dotfilename
dotfilename = '{}.{}'.format(dot_base, format)
cmd = 'dot -T{} -o"{}" "{}"'.format(format, dotfilename, orig_dot) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the advice, but I would recommend the current approach. Having If the filename for some reason can't be split, I'd much rather like the traceback to serve me up this line directly:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue is that you're returning a value from an unassigned name in the case where |
||
try: | ||
CommandLine(cmd, resource_monitor=False).run() | ||
except IOError as ioe: | ||
if "could not be found" in str(ioe): | ||
raise IOError( | ||
"Cannot draw directed graph; executable 'dot' is unavailable" | ||
) | ||
raise IOError("Cannot draw directed graph; executable 'dot' is unavailable") | ||
else: | ||
raise ioe | ||
dotfilename += '.%s' % format | ||
return dotfilename | ||
else: | ||
formatted_dot = dotfilename | ||
return formatted_dot | ||
|
||
|
||
def get_all_files(infile): | ||
|
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.
I think this needs to be uppercase O
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.
nope,
-ofile
is what we should be using.