From bce3ee1d658a70bda5ea830c5f5e50df6c75fc54 Mon Sep 17 00:00:00 2001 From: beniroquai Date: Tue, 24 Sep 2024 21:33:50 +0200 Subject: [PATCH] fixing linting error --- docker/HIK/compose.yaml | 2 +- docker/HIK/dockerfile | 2 +- imswitch/imnotebook/view/ImScrMainView.py | 8 ++++---- imswitch/imnotebook/view/LaunchNotebookServer.py | 5 ++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docker/HIK/compose.yaml b/docker/HIK/compose.yaml index 8a188c75c..ce7f4e436 100644 --- a/docker/HIK/compose.yaml +++ b/docker/HIK/compose.yaml @@ -1,6 +1,6 @@ # docker-compose up -d # ducker pull ghcr.io/openuc2/imswitch-aiortc-react:latest -# docker pull ghcr.io/openuc2/imswitch-docker-arm64-noqt:latest +# docker pull ghcr.io/openuc2/imswitch-noqt-x64:latest # docker run -it ghcr.io/openuc2/imswitch-aiortc-react:latest # docker run -it --rm -p 8001:8001 -p 2222:22 -e HEADLESS=1 -e HTTP_PORT=8001 -e CONFIG_FILE=example_virtual_microscope.json -e UPDATE_GIT=1 -e UPDATE_CONFIG=0 ghcr.io/openuc2/imswitch-docker-arm64-noqt:latest version: '3.8' diff --git a/docker/HIK/dockerfile b/docker/HIK/dockerfile index 4d9504345..38b78dd4b 100644 --- a/docker/HIK/dockerfile +++ b/docker/HIK/dockerfile @@ -19,7 +19,7 @@ # sudo docker run -it --rm -p 8001:8001 -e HEADLESS=1 -e HTTP_PORT=8001 -e UPDATE_GIT=1 -e UPDATE_CONFIG=0 --privileged -e DATA_PATH=/dataset -v /media/uc2/SD2/:/dataset -e CONFIG_FILE=example_uc2_hik_flowstop.json ghcr.io/openuc2/imswitch-noqt-x64:latest # sudo docker run -it -e MODE=terminal ghcr.io/openuc2/imswitch-noqt-x64:latest # sudo docker run -it --rm -p 8001:8001 -p 2222:22 -e UPDATE_INSTALL_GIT=1 -e PIP_PACKAGES="arkitekt UC2-REST" -e CONFIG_PATH=/Users/bene/Downloads -e DATA_PATH=/Users/bene/Downloads -v ~/Documents/imswitch_docker/imswitch_git:/tmp/ImSwitch-changes -v ~/Documents/imswitch_docker/imswitch_pip:/persistent_pip_packages -v /media/uc2/SD2/:/dataset -v ~/Downloads:/config --privileged imswitch_hik - +# sudo docker pull docker pull ghcr.io/openuc2/imswitch-noqt-x64:latest # Witht he following configuration we can do the following: # 1. Update the ImSwitch repository and install the changes and make them persistent by mounting a volume to /tmp/ImSwitch-changes and /persistent_pip_packages respectively diff --git a/imswitch/imnotebook/view/ImScrMainView.py b/imswitch/imnotebook/view/ImScrMainView.py index ccbd8ce33..87a4cfa9a 100644 --- a/imswitch/imnotebook/view/ImScrMainView.py +++ b/imswitch/imnotebook/view/ImScrMainView.py @@ -1,5 +1,5 @@ from imswitch import IS_HEADLESS - +from .LaunchNotebookServer import LaunchNotebookServer if not IS_HEADLESS: from qtpy import QtCore, QtWidgets @@ -39,8 +39,8 @@ def __init__(self, *args, **kwargs): return # test and launch notebook server - notebookServer = LaunchNotebookServer() - webaddr = notebookServer.start() + self.notebookServer = LaunchNotebookServer() + webaddr = self.notebookServer.start() # setup webview self.view = MainWindow(None, None) @@ -76,7 +76,7 @@ def closeEvent(self, event): #self.sigClosing.emit() event.accept() # stop the notebook process - stopnotebook() + self.notebookServer.stopnotebook() diff --git a/imswitch/imnotebook/view/LaunchNotebookServer.py b/imswitch/imnotebook/view/LaunchNotebookServer.py index 1271655c5..b2aa08ad2 100644 --- a/imswitch/imnotebook/view/LaunchNotebookServer.py +++ b/imswitch/imnotebook/view/LaunchNotebookServer.py @@ -36,4 +36,7 @@ def startServer(self): # start the notebook process webaddr = startnotebook(execname, directory=directory) - return webaddr \ No newline at end of file + return webaddr + + def stopServer(self): + stopnotebook() \ No newline at end of file