Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.thread.exit(outcome)
self.setMaximum(1)
self.setValue(1)
signals.database_changed.emit(bw.config.biosphere)
signals.databases_changed.emit()
@Slot(int)
def update_progress(self, current: int):
self.setValue(current)
class UpdateBiosphereThread(QtCore.QThread):
PATCHES = (
add_ecoinvent_33_biosphere_flows,
add_ecoinvent_34_biosphere_flows,
add_ecoinvent_35_biosphere_flows,
add_ecoinvent_36_biosphere_flows,
)
progress = Signal(int)
def __init__(self, parent=None):
super().__init__(parent)
self.total_patches = len(self.PATCHES)
def run(self):
try:
for i, patch in enumerate(self.PATCHES):
self.progress.emit(i)
patch()
except ValidityError as e:
print("Could not patch biosphere: {}".format(str(e)))
self.exit(1)