style: fix a few style issues by hand
This commit is contained in:
@@ -256,7 +256,7 @@ class JFJochWrapper:
|
||||
|
||||
def detector(self) -> jfjoch_client.models.DetectorListElement:
|
||||
try:
|
||||
l = self.__api.config_select_detector_get()
|
||||
detector_list = self.__api.config_select_detector_get()
|
||||
except Exception as e:
|
||||
self._raise_jfjoch_error(
|
||||
f"JFJoch detector configuration retrieval failed: {e}",
|
||||
@@ -265,7 +265,7 @@ class JFJochWrapper:
|
||||
endpoint="config_select_detector_get",
|
||||
)
|
||||
|
||||
if len(l.detectors) == 0:
|
||||
if len(detector_list.detectors) == 0:
|
||||
raise JFJochCommunicationError(
|
||||
"JFJoch returned no configured detectors",
|
||||
operation="GET",
|
||||
@@ -275,7 +275,7 @@ class JFJochWrapper:
|
||||
)
|
||||
|
||||
try:
|
||||
return l.detectors[l.current_id]
|
||||
return detector_list.detectors[detector_list.current_id]
|
||||
except Exception as e:
|
||||
self._raise_jfjoch_error(
|
||||
"JFJoch returned an invalid selected detector entry",
|
||||
|
||||
+11
-14
@@ -19,24 +19,24 @@ logger = setup_logger(LOGGER_NAME)
|
||||
|
||||
def main():
|
||||
"""Wrapped gui as main function to make tests easier"""
|
||||
splash = None
|
||||
try:
|
||||
basedir = os.path.dirname(__file__)
|
||||
icon_path = os.path.join(basedir, "graphics/aaregui_logo.svg")
|
||||
banner_path = os.path.join(basedir, "graphics/aare_banner.png")
|
||||
splash_pix = QtGui.QPixmap(banner_path)
|
||||
splash = LoadingSplashScreen(splash_pix)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to load resources for splash screen: {e}")
|
||||
sys.exit(1)
|
||||
try:
|
||||
# define application
|
||||
app = QApplication(sys.argv)
|
||||
app.setWindowIcon(QtGui.QIcon(icon_path))
|
||||
app.setApplicationName("AareGUI")
|
||||
app.setApplicationVersion("0.3.1")
|
||||
app.setOrganizationName("PSI")
|
||||
app.setOrganizationDomain("psi.ch")
|
||||
|
||||
# set icon
|
||||
basedir = os.path.dirname(__file__)
|
||||
icon_path = os.path.join(basedir, "graphics/aaregui_logo.svg")
|
||||
app.setWindowIcon(QtGui.QIcon(icon_path))
|
||||
|
||||
# show splash screen
|
||||
banner_path = os.path.join(basedir, "graphics/aare_banner.png")
|
||||
splash_pix = QtGui.QPixmap(banner_path)
|
||||
splash = LoadingSplashScreen(splash_pix)
|
||||
splash.show()
|
||||
splash.set_progress(10, "Initializing Application...")
|
||||
|
||||
@@ -199,16 +199,13 @@ def main():
|
||||
logger.error(f"Error starting GUI: {e}")
|
||||
logger.error(f"Traceback: {traceback.format_exc()}")
|
||||
|
||||
try:
|
||||
QMessageBox.critical(
|
||||
QMessageBox.critical(
|
||||
None,
|
||||
"Fatal Error",
|
||||
f"An error occurred during startup. See console for details."
|
||||
f"\nPlease check the server is running and your network connection."
|
||||
f"\n\n{str(e)}\n\n",
|
||||
)
|
||||
except:
|
||||
pass
|
||||
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@@ -90,9 +90,9 @@ class SampleQueueSpreadsheet(QAbstractTableModel):
|
||||
row = parent.row()
|
||||
|
||||
try:
|
||||
l = SampleShortInfoList.model_validate_json(data.text())
|
||||
sample_data = SampleShortInfoList.model_validate_json(data.text())
|
||||
self.beginResetModel()
|
||||
for sample in l.s:
|
||||
for sample in sample_data.s:
|
||||
updated_row = row
|
||||
updated_samples = []
|
||||
for i in range(len(self.samples)):
|
||||
|
||||
@@ -180,12 +180,12 @@ class UserSampleSpreadsheet(QAbstractTableModel):
|
||||
def mimeData(self, indexes):
|
||||
mime_data = QMimeData()
|
||||
|
||||
l = SampleShortInfoList(s=[])
|
||||
sample_data = SampleShortInfoList(s=[])
|
||||
|
||||
for i in sorted(set(index.row() for index in indexes)):
|
||||
l.s.append(self.__sorted_samples[i])
|
||||
sample_data.s.append(self.__sorted_samples[i])
|
||||
|
||||
mime_data.setText(l.model_dump_json())
|
||||
mime_data.setText(sample_data.model_dump_json())
|
||||
return mime_data
|
||||
|
||||
def get_id(self, row: int) -> SampleShortInfo:
|
||||
|
||||
@@ -554,13 +554,13 @@ class TutorialManager(QObject):
|
||||
|
||||
return None
|
||||
|
||||
def _run_setup_actions(self, step: TutorialStep) -> None:
|
||||
def _run_setup_actions(self, step: TutorialStepDefinition) -> None:
|
||||
if self.context is None:
|
||||
return
|
||||
for action in step.setup_actions:
|
||||
self.action_executor.execute_action(action, self.context)
|
||||
|
||||
def _run_cleanup_actions(self, step: TutorialStep) -> None:
|
||||
def _run_cleanup_actions(self, step: TutorialStepDefinition) -> None:
|
||||
if self.context is None:
|
||||
return
|
||||
for action in step.cleanup_actions:
|
||||
|
||||
@@ -14,6 +14,7 @@ from aare.gui.tutorials.tutorial_models import (
|
||||
TutorialContext,
|
||||
TutorialEvent,
|
||||
TutorialScenario,
|
||||
TutorialStepDefinition,
|
||||
TutorialTarget,
|
||||
TutorialTextRef,
|
||||
)
|
||||
@@ -188,7 +189,7 @@ class CompletionEvaluator:
|
||||
self._event_bus = event_bus
|
||||
|
||||
def is_step_complete(
|
||||
self, step: TutorialStep, context: TutorialContext, *, target_clicked: bool = False
|
||||
self, step: TutorialStepDefinition, context: TutorialContext, *, target_clicked: bool = False
|
||||
) -> bool:
|
||||
if step.completion is None:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user