From 27fc41a5271ea160567aa12d5d8d7e005f346abb Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Thu, 19 Oct 2023 14:08:20 +0200 Subject: [PATCH] fixes to disable JS9 by default --- Dockerfile | 4 ++-- bin/setup-radiopadre-virtualenv | 2 +- radiopadre/fitsfile.py | 1 + radiopadre_kernel/js9/__init__.py | 5 ++--- setup.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99b33b7..285c0a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN docker-apt-install --no-install-recommends \ libxss1 \ libxtst6 \ thunderbird \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives + && apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives # crazy list starting with npm needed for chromium within puppeteer. Don't ask me why. @@ -62,7 +62,7 @@ ADD . /radiopadre ## override due to problems with 1.4 in containers #ARG RADIOPADRE_CARTA_VERSION=1.3.1 -ARG CLIENT_BRANCH=b1.2.1 +ARG CLIENT_BRANCH=b1.2.2 RUN git clone -b $CLIENT_BRANCH https://github.com/ratt-ru/radiopadre-client.git RUN pip3 install --no-cache-dir -e /radiopadre-client diff --git a/bin/setup-radiopadre-virtualenv b/bin/setup-radiopadre-virtualenv index 5a5c542..cac54ec 100755 --- a/bin/setup-radiopadre-virtualenv +++ b/bin/setup-radiopadre-virtualenv @@ -322,7 +322,7 @@ if PUPPETEER_VERSION: # "'") # install JS9 -js9_status_file = "{PADRE_VENV}/js9status" +js9_status_file = f"{PADRE_VENV}/js9status" if options.no_js9: if os.path.exists(js9_status_file): diff --git a/radiopadre/fitsfile.py b/radiopadre/fitsfile.py index 0ae35ac..e3ed931 100644 --- a/radiopadre/fitsfile.py +++ b/radiopadre/fitsfile.py @@ -648,6 +648,7 @@ def _action_buttons_(self, context, defaults=None, **kw): subs = globals().copy() subs.update(display_id=context.div_id, **locals()) + code = "" if not js9.JS9_ERROR: FITSFile._insert_js9_postscript(context.postscript, subs, defaults=defaults) diff --git a/radiopadre_kernel/js9/__init__.py b/radiopadre_kernel/js9/__init__.py index b84ca9b..c5f0d1c 100644 --- a/radiopadre_kernel/js9/__init__.py +++ b/radiopadre_kernel/js9/__init__.py @@ -24,7 +24,7 @@ def preinit_js9(): import iglesia - global JS9_HELPER_PORT, JS9_DIR + global JS9_ERROR, JS9_HELPER_PORT, JS9_DIR JS9_DIR = iglesia.JS9_DIR JS9_HELPER_PORT = iglesia.JS9HELPER_PORT @@ -33,9 +33,8 @@ def preinit_js9(): return try: - global JS9_ERROR if not os.path.exists(JS9_DIR): - raise JS9Error(f"{JS9_DIR} does not exist") + raise JS9Error(f"JS9 directory '{JS9_DIR}' does not exist") message(f"Using JS9 install in {JS9_DIR}") diff --git a/setup.py b/setup.py index 10a751b..afb2cd1 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools.command.develop import develop from wheel.bdist_wheel import bdist_wheel -__version__ = "1.2.1" +__version__ = "1.2.2" build_root = os.path.dirname(__file__)