Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
def __init__(self):
super(DockerOptions, self).__init__()
self.root = QtGui.QComboBox(editable=False)
self.root.addItems(ROOT.TEXT)
self.add_row("Elevate privileges:", self.root)
try:
cmd = ['docker-machine', 'ls', '-q']
query = subprocess.Popen(cmd, stdout=subprocess.PIPE)
out, _ = query.communicate()
if query.returncode != 0:
raise subprocess.CalledProcessError(query.returncode, cmd)
self.machine = QtGui.QComboBox(editable=False)
if 'DOCKER_HOST' in os.environ:
self.machine.addItem("Custom config from environment", None)
else:
self.machine.addItem("Default (no machine)", None)