How to use reprounzip-qt - 10 common examples

To help you get started, we’ve selected a few reprounzip-qt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / run.py View on Github external
if nb_raw:
            record_usage(docker_raw_options=nb_raw)

        ports = parse_ports(self.ports.text(), self)
        if ports is None:
            return None
        for host, container, proto in ports:
            options['args'].extend(
                ['--docker-option=-p',
                 '--docker-option=%s:%s/%s' % (host, container, proto)])
        record_usage(docker_run_port_fwd=bool(ports))

        return options


class VagrantOptions(RunOptions):
    def __init__(self):
        super(VagrantOptions, self).__init__()
        self.add_x11()

        self.ports = QtWidgets.QLineEdit(
            '',
            toolTip="Space-separated host:guest port mappings")
        self.add_row("Expose ports:", self.ports)

    def options(self):
        options = super(VagrantOptions, self).options()

        ports = parse_ports(self.ports.text(), self)
        if ports is None:
            return None
        for host, container, proto in parse_ports(self.ports.text(), self):
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / unpack.py View on Github external
if self.distribution.text():
            options['args'].extend(['--distribution',
                                    self.distribution.text()])
            record_usage(docker_distribution=True)

        if self.install_pkgs.isChecked():
            options['args'].append('--install-pkgs')

        record_usage(root=options['root'],
                     docker_install_pkgs=self.install_pkgs.isChecked())

        return options


class VagrantOptions(UnpackerOptions):
    def __init__(self):
        super(VagrantOptions, self).__init__()

        self.image = QtGui.QLineEdit(placeholderText='detect')
        self.add_row("Base box:", self.image)

        self.distribution = QtGui.QLineEdit(placeholderText='detect')
        self.add_row("Distribution:", self.distribution)

        self.memory = QtGui.QSpinBox(suffix="MB", minimum=99, maximum=64000,
                                     specialValueText="(default)", value=99)
        self.add_row("Memory:", self.memory)

        self.gui = QtGui.QCheckBox("Enable local GUI")
        self.add_row("GUI:", self.gui)
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / __init__.py View on Github external
def closeEvent(self, event):
        if self.tabs.widget(1).should_exit():
            Application.instance().windows.discard(self)
            event.accept()
        else:
            event.ignore()
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / run.py View on Github external
def _reset(self):
        selected = self.files_widget.selectedIndexes()[0].row()
        file_status = self.files_status[selected]
        record_usage(file_reset=True)
        handle_error(self, reprounzip.upload(
            self.directory, file_status.name, None,
            unpacker=self.unpacker, root=self.root))
        self._file_changed()


class RunTab(QtWidgets.QWidget):
    """The main window, that allows you to run/change an unpacked experiment.
    """
    UNPACKERS = [
        ('directory', DirectoryOptions),
        ('chroot', ChrootOptions),
        ('docker', DockerOptions),
        ('vagrant', VagrantOptions),
    ]

    directory = None
    unpacker = None

    def __init__(self, unpacked_directory='', **kwargs):
        super(RunTab, self).__init__(**kwargs)

        layout = QtWidgets.QGridLayout()
        layout.addWidget(QtWidgets.QLabel("Experiment directory:"), 0, 0)
        self.directory_widget = QtWidgets.QLineEdit(unpacked_directory)
        self.directory_widget.editingFinished.connect(self._directory_changed)
        layout.addWidget(self.directory_widget, 0, 1)
        browse = QtWidgets.QPushButton("Browse")
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / run.py View on Github external
def _reset(self):
        selected = self.files_widget.selectedIndexes()[0].row()
        file_status = self.files_status[selected]
        record_usage(file_reset=True)
        handle_error(self, reprounzip.upload(
            self.directory, file_status.name, None,
            unpacker=self.unpacker, root=self.root))
        self._file_changed()


class RunTab(QtWidgets.QWidget):
    """The main window, that allows you to run/change an unpacked experiment.
    """
    UNPACKERS = [
        ('directory', DirectoryOptions),
        ('chroot', ChrootOptions),
        ('docker', DockerOptions),
        ('vagrant', VagrantOptions),
    ]

    directory = None
    unpacker = None

    def __init__(self, unpacked_directory='', **kwargs):
        super(RunTab, self).__init__(**kwargs)

        layout = QtWidgets.QGridLayout()
        layout.addWidget(QtWidgets.QLabel("Experiment directory:"), 0, 0)
        self.directory_widget = QtWidgets.QLineEdit(unpacked_directory)
        self.directory_widget.editingFinished.connect(self._directory_changed)
        layout.addWidget(self.directory_widget, 0, 1)
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / run.py View on Github external
def options(self):
        options = super(DockerOptions, self).options()

        if self.tunneled_x11.isChecked():
            options['args'].append('--tunneled-x11')
            record_usage(docker_tunneled_x11=True)

        if self.detach.isChecked():
            options['args'].append('--detach')
            record_usage(docker_detach=True)

        nb_raw = 0
        for opt in self.raw_options.text().split():
            opt = opt.strip()
            if opt:
                nb_raw += 1
                options['args'].append('--docker-option=%s' % opt)
        if nb_raw:
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / run.py View on Github external
selected = self.files_widget.selectedIndexes()[0].row()
        file_status = self.files_status[selected]
        record_usage(file_reset=True)
        handle_error(self, reprounzip.upload(
            self.directory, file_status.name, None,
            unpacker=self.unpacker, root=self.root))
        self._file_changed()


class RunTab(QtWidgets.QWidget):
    """The main window, that allows you to run/change an unpacked experiment.
    """
    UNPACKERS = [
        ('directory', DirectoryOptions),
        ('chroot', ChrootOptions),
        ('docker', DockerOptions),
        ('vagrant', VagrantOptions),
    ]

    directory = None
    unpacker = None

    def __init__(self, unpacked_directory='', **kwargs):
        super(RunTab, self).__init__(**kwargs)

        layout = QtWidgets.QGridLayout()
        layout.addWidget(QtWidgets.QLabel("Experiment directory:"), 0, 0)
        self.directory_widget = QtWidgets.QLineEdit(unpacked_directory)
        self.directory_widget.editingFinished.connect(self._directory_changed)
        layout.addWidget(self.directory_widget, 0, 1)
        browse = QtWidgets.QPushButton("Browse")
        browse.clicked.connect(self._browse)
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / run.py View on Github external
def __init__(self, directory, unpacker=None, root=None, **kwargs):
        super(FilesManager, self).__init__(**kwargs)
        self.directory = directory
        self.unpacker = unpacker
        self.root = root

        layout = QtWidgets.QHBoxLayout()

        self.files_widget = QtWidgets.QListWidget(
            selectionMode=QtWidgets.QListWidget.SingleSelection)
        self.files_widget.itemSelectionChanged.connect(self._file_changed)
        layout.addWidget(self.files_widget)

        right_layout = QtWidgets.QGridLayout()
        right_layout.addWidget(QtWidgets.QLabel("name:"), 0, 0)
        self.f_name = QtWidgets.QLineEdit('', readOnly=True)
        right_layout.addWidget(self.f_name, 0, 1)
        right_layout.addWidget(QtWidgets.QLabel("Path:"), 1, 0)
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / run.py View on Github external
file_status = self.files_status[selected]
        record_usage(file_reset=True)
        handle_error(self, reprounzip.upload(
            self.directory, file_status.name, None,
            unpacker=self.unpacker, root=self.root))
        self._file_changed()


class RunTab(QtWidgets.QWidget):
    """The main window, that allows you to run/change an unpacked experiment.
    """
    UNPACKERS = [
        ('directory', DirectoryOptions),
        ('chroot', ChrootOptions),
        ('docker', DockerOptions),
        ('vagrant', VagrantOptions),
    ]

    directory = None
    unpacker = None

    def __init__(self, unpacked_directory='', **kwargs):
        super(RunTab, self).__init__(**kwargs)

        layout = QtWidgets.QGridLayout()
        layout.addWidget(QtWidgets.QLabel("Experiment directory:"), 0, 0)
        self.directory_widget = QtWidgets.QLineEdit(unpacked_directory)
        self.directory_widget.editingFinished.connect(self._directory_changed)
        layout.addWidget(self.directory_widget, 0, 1)
        browse = QtWidgets.QPushButton("Browse")
        browse.clicked.connect(self._browse)
        layout.addWidget(browse, 0, 2)
github VIDA-NYU / reprozip / reprounzip-qt / reprounzip_qt / gui / unpack.py View on Github external
options['args'].append('--dont-use-chroot')
            record_usage(vagrant_no_chroot=True)

        if not self.magic_dirs.isChecked():
            options['args'].append('--dont-bind-magic-dirs')
            record_usage(vagrant_magic_dirs=False)

        return options


class UnpackTab(QtGui.QWidget):
    """The unpack window, that sets up a .RPZ file in a directory.
    """
    UNPACKERS = [
        ('directory', DirectoryOptions),
        ('chroot', ChrootOptions),
        ('docker', DockerOptions),
        ('vagrant', VagrantOptions),
    ]

    unpacked = QtCore.pyqtSignal(str, object)

    def __init__(self, package='', **kwargs):
        super(UnpackTab, self).__init__(**kwargs)

        layout = QtGui.QGridLayout()
        layout.addWidget(QtGui.QLabel("RPZ package:"), 0, 0)
        self.package_widget = QtGui.QLineEdit(package, enabled=False)
        layout.addWidget(self.package_widget, 0, 1)
        browse_pkg = QtGui.QPushButton("Browse")
        browse_pkg.clicked.connect(self._browse_pkg)
        layout.addWidget(browse_pkg, 0, 2)