Skip to content

Commit a1ebcef

Browse files
committed
No longer concatenating extensions
1 parent ce6f37c commit a1ebcef

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

nipype/pipeline/engine/utils.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1314,18 +1314,17 @@ def export_graph(graph_in,
13141314
def format_dot(dotfilename, format='png'):
13151315
"""Dump a directed graph (Linux only; install via `brew` on OSX)"""
13161316
if format != 'dot':
1317-
cmd = 'dot -T%s -O \'%s\'' % (format, dotfilename)
1317+
dot_base = os.path.splitext(dotfilename)[0]
1318+
formatted_dot = '{}.{}'.format(dot_base, format)
1319+
cmd = 'dot -T{} -o"{}" "{}"'.format(format, formatted_dot, dotfilename)
13181320
try:
13191321
CommandLine(cmd, resource_monitor=False).run()
13201322
except IOError as ioe:
13211323
if "could not be found" in str(ioe):
1322-
raise IOError(
1323-
"Cannot draw directed graph; executable 'dot' is unavailable"
1324-
)
1324+
raise IOError("Cannot draw directed graph; executable 'dot' is unavailable")
13251325
else:
13261326
raise ioe
1327-
dotfilename += '.%s' % format
1328-
return dotfilename
1327+
return formatted_dot
13291328

13301329

13311330
def get_all_files(infile):

tools/interfacedocgen.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ def _write_graph_section(self, fname, title):
227227

228228
fhandle.close()
229229
os.remove(fname)
230-
os.remove(fname + ".png")
230+
bitmap_fname = '{}.png'.format(os.path.splitext(dotfilename)[0])
231+
os.remove(bitmap_fname)
231232
return ad
232233

233234
def generate_api_doc(self, uri):

0 commit comments

Comments
 (0)