mismatch between archinstall and archinstall_gui in the worker class

This commit is contained in:
Anton Hvornum 2019-11-18 23:42:04 +00:00
parent 03ceef69f1
commit 4f394d40ce
1 changed files with 30 additions and 9 deletions

View File

@ -370,17 +370,38 @@ class sys_command():#Thread):
worker_history[self.worker_id] = self.dump() worker_history[self.worker_id] = self.dump()
if 'dependency' in self.kwargs and self.exit_code == 0: if 'dependency' in self.kwargs:
## If this had a dependency waiting, pass # TODO: Not yet supported (steal it from archinstall_gui)
## Start it since there's no hook for this yet, the worker has to spawn it's waiting workers. """
module = self.kwargs['dependency']['module'] dependency = self.kwargs['dependency']
print(self.cmd[0],'fullfills a dependency:', module) if type(dependency) == str:
dependency_id = self.kwargs['dependency']['id'] # Dependency is a progress-string. Wait for it to show up.
dependencies[module][dependency_id]['fullfilled'] = True while main and main.isAlive() and dependency not in progress or progress[dependency] is None:
dependencies[module][dependency_id]['spawn'](*dependencies[module][dependency_id]['args'], **dependencies[module][dependency_id]['kwargs'], start_callback=_worker_started_notification) time.sleep(0.25)
dependency = progress[dependency]
if type(dependency) == str:
log(f"{self.func} waited for progress {dependency} which never showed up. Aborting.", level=2, origin='worker', function='run')
self.ended = time.time()
self.status = 'aborted'
return None
while main and main.isAlive() and dependency.ended is None:
time.sleep(0.25)
print(' *** Dependency released for:', self.func)
if dependency.data is None or not main or not main.isAlive():
log('Dependency:', dependency.func, 'did not exit clearly. There for,', self.func, 'can not execute.', level=2, origin='worker', function='run')
self.ended = time.time()
self.status = 'aborted'
return None
"""
if self.callback: if self.callback:
self.callback(self, *self.args, **self.kwargs) pass # TODO: Not yet supported (steal it from archinstall_gui)
#self.callback(self, *self.args, **self.kwargs)
def get_drive_from_uuid(uuid): def get_drive_from_uuid(uuid):
if len(harddrives) <= 0: raise ValueError("No hard drives to iterate in order to find: {}".format(uuid)) if len(harddrives) <= 0: raise ValueError("No hard drives to iterate in order to find: {}".format(uuid))