From fd75498958d1e66e2b9ec2aa10bcf337fbb10867 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Wed, 31 May 2023 13:40:13 -0400 Subject: [PATCH] fix the script path --- pygeoweaver/server.py | 6 +++--- pygeoweaver/utils.py | 4 ++++ pyproject.toml | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pygeoweaver/server.py b/pygeoweaver/server.py index e846de7..3bd3706 100644 --- a/pygeoweaver/server.py +++ b/pygeoweaver/server.py @@ -2,7 +2,7 @@ import subprocess import webbrowser from pygeoweaver.constants import GEOWEAVER_DEFAULT_ENDPOINT_URL -from pygeoweaver.utils import checkIPython, checkOS, download_geoweaver_jar, get_logger, get_root_dir +from pygeoweaver.utils import checkIPython, checkOS, download_geoweaver_jar, get_logger, get_module_absolute_path, get_root_dir """ This module provides function to start and stop Geoweaver server. @@ -18,7 +18,7 @@ def start(force=False): if checkOS() == 3: raise RuntimeError("windows is not supported yet") else: - result = subprocess.run(['./start.sh'], cwd=f"{get_root_dir()}/") + result = subprocess.run([f'{get_module_absolute_path()}/start.sh'], cwd=f"{get_root_dir()}/") @@ -26,7 +26,7 @@ def stop(): if checkOS() == 3: raise RuntimeError("Windows is not supported yet") else: - result = subprocess.run(['./stop.sh'], cwd=f"{get_root_dir()}/", shell=True) + result = subprocess.run([f'{get_module_absolute_path()}/stop.sh'], cwd=f"{get_root_dir()}/", shell=True) def show(geoweaver_url = GEOWEAVER_DEFAULT_ENDPOINT_URL): diff --git a/pygeoweaver/utils.py b/pygeoweaver/utils.py index afc28ba..2ffb2d5 100644 --- a/pygeoweaver/utils.py +++ b/pygeoweaver/utils.py @@ -14,6 +14,10 @@ def get_root_dir(): head, tail = os.path.split(__file__) return head +def get_module_absolute_path(): + module_path = os.path.abspath(__file__) + return os.path.dirname(module_path) + def get_geoweaver_jar_path(): return f"{get_home_dir()}/geoweaver.jar" diff --git a/pyproject.toml b/pyproject.toml index d53bdc3..4358ca2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pygeoweaver" -version = "0.6.6" +version = "0.6.7" authors = [ { name="Geoweaver team", email="geoweaver.app@gmail.com" }, ] @@ -22,7 +22,7 @@ classifiers = [ [tool.poetry] name = "pygeoweaver" -version = "0.6.6" +version = "0.6.7" description = "This is a wrapper package of the Geoweaver app." authors = ["Geoweaver team "] readme = "README.md"