Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def event(self, event):
if event.type() == QtCore.QEvent.FileOpen:
record_usage(fileopenevent=True)
# Create new window for this RPZ
window = ReprounzipUi(unpack=dict(package=event.file()))
window.setVisible(True)
self.windows.add(window)
# Close first window if it exists
if self.first_window and self.first_window.replaceable():
self.first_window.close()
self.first_window.deleteLater()
self.first_window = None
return True
return QtWidgets.QApplication.event(self, event)
def __init__(self, unpack={}, run={}, tab=None, **kwargs):
super(ReprounzipUi, self).__init__(**kwargs)
self.tabs = QtWidgets.QTabWidget()
self.tabs.addTab(UnpackTab(**unpack), "Open package")
self.tabs.addTab(RunTab(**run), "Run unpacked experiment")
self.tabs.widget(0).unpacked.connect(self._unpacked)
if tab is not None:
self.tabs.setCurrentIndex(tab)
self.setCentralWidget(self.tabs)