Skip to content

Commit 047729c

Browse files
committed
Add the Vis to the Qt GUI as well
1 parent 3a07882 commit 047729c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

reprounzip-qt/reprounzip_qt/gui/unpack.py

+6
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ def __init__(self, package='', **kwargs):
259259

260260
buttons = QtGui.QHBoxLayout()
261261
buttons.addStretch(1)
262+
vis = QtGui.QPushButton("Show provenance")
263+
vis.clicked.connect(self._show_vis)
264+
buttons.addWidget(vis)
262265
self.unpack_widget = QtGui.QPushButton("Unpack experiment",
263266
enabled=False)
264267
self.unpack_widget.clicked.connect(self._unpack)
@@ -318,3 +321,6 @@ def _unpack(self):
318321
options.get('root'))
319322
else:
320323
error_msg(self, "No unpacker selected", 'warning')
324+
325+
def _show_vis(self):
326+
handle_error(self, reprounzip.show_vis(self.package_widget.text()))

reprounzip-qt/reprounzip_qt/reprounzip_interface.py

+11
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,17 @@ def download(directory, name, path, unpacker=None, root=None):
301301
return code == 0
302302

303303

304+
def show_vis(package):
305+
reprounzip = find_command('reprounzip')
306+
if reprounzip is None:
307+
return ("Couldn't find reprounzip command -- is reprounzip installed?",
308+
'critical')
309+
310+
run_in_builtin_terminal([reprounzip, 'vis', package], {},
311+
text="Running provenance visualization")
312+
return True
313+
314+
304315
def run_in_builtin_terminal_maybe(cmd, root, env={}, **kwargs):
305316
if root is None:
306317
code = run_in_builtin_terminal(cmd, env, **kwargs)

0 commit comments

Comments
 (0)