Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions magics/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,18 @@ def sppl_to_python(self, line):
def sppl_to_graph(self, line, local_ns):
tokens = line.strip().split(' ')
line = tokens[0]
filename = tokens[1] if len(tokens) == 2 else None
if 2 <= len(tokens):
filename = tokens[1].split('.')[0]
ext = tokens[1].split('.')[-1]
else:
(filename, ext) = (None, None)
if line in self.programs:
spe = self.sppl_get_spe(line)
elif line in local_ns:
spe = local_ns[line]
else:
assert False, 'unknown program %s' % (line,)
return render_graphviz(spe, filename=filename)
return render_graphviz(spe, filename=filename, ext=ext)

@line_magic
def sppl_get_namespace(self, line):
Expand Down
Loading