Skip to content

Commit

Permalink
rescue CI
Browse files Browse the repository at this point in the history
  • Loading branch information
oliche committed Nov 30, 2023
1 parent 9b21f4d commit 7cce169
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions iblrig/gui/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ def get_task_extra_parser(self, task_name=None):
spec.loader.exec_module(task)
return task.Session.extra_parser()

def connect(self, username=None, one=None):
def connect(self, username=None, one=None, gui=False):
"""
:param username:
:param one:
:param gui: bool: whether or not a Qt Application is running to throw an error message
:return:
"""
if one is None:
username = username or self.iblrig_settings['ALYX_USER']
self.one = ONE(base_url=self.iblrig_settings['ALYX_URL'], username=username, mode='local')
Expand All @@ -158,7 +164,7 @@ def connect(self, username=None, one=None):
self.all_projects = sorted(set(projects + self.all_projects))
# since we are connecting to Alyx, validate some parameters to ensure a smooth extraction
result = iblrig.hardware_validation.ValidateAlyxLabLocation().run(self.one)
if result.status == 'FAIL':
if result.status == 'FAIL' and gui:
QtWidgets.QMessageBox().critical(None, 'Error', f"{result.message}\n\n{result.solution}")

def get_subject_details(self, subject):
Expand Down Expand Up @@ -583,7 +589,7 @@ def _set_task_arg(self, key, value):
self.task_arguments[key] = value

def alyx_connect(self):
self.model.connect()
self.model.connect(gui=True)
self.model2view()

def _filter_subjects(self):
Expand Down

0 comments on commit 7cce169

Please sign in to comment.