Skip to content

Commit

Permalink
Add the Vis to the Qt GUI as well
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Aug 25, 2017
1 parent c9adad7 commit ce39205
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions reprounzip-qt/reprounzip_qt/gui/unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ def __init__(self, package='', **kwargs):

buttons = QtGui.QHBoxLayout()
buttons.addStretch(1)
vis = QtGui.QPushButton("Show provenance")
vis.clicked.connect(self._show_vis)
buttons.addWidget(vis)
self.unpack_widget = QtGui.QPushButton("Unpack experiment",
enabled=False)
self.unpack_widget.clicked.connect(self._unpack)
Expand Down Expand Up @@ -318,3 +321,6 @@ def _unpack(self):
options.get('root'))
else:
error_msg(self, "No unpacker selected", 'warning')

def _show_vis(self):
handle_error(self, reprounzip.show_vis(self.package_widget.text()))
11 changes: 11 additions & 0 deletions reprounzip-qt/reprounzip_qt/reprounzip_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,17 @@ def download(directory, name, path, unpacker=None, root=None):
return code == 0


def show_vis(package):
reprounzip = find_command('reprounzip')
if reprounzip is None:
return ("Couldn't find reprounzip command -- is reprounzip installed?",
'critical')

run_in_builtin_terminal([reprounzip, 'vis', package], {},
text="Running provenance visualization")
return True


def run_in_builtin_terminal_maybe(cmd, root, env={}, **kwargs):
if root is None:
code = run_in_builtin_terminal(cmd, env, **kwargs)
Expand Down

0 comments on commit ce39205

Please sign in to comment.