From 128c0386e7f7b52f431dcb187c7021558b3416e0 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Wed, 21 Jun 2023 03:21:14 -0400 Subject: [PATCH] update the process editing output --- pygeoweaver/sc_sync.py | 14 +++++++++----- pyproject.toml | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pygeoweaver/sc_sync.py b/pygeoweaver/sc_sync.py index 178fc6f..905c67d 100644 --- a/pygeoweaver/sc_sync.py +++ b/pygeoweaver/sc_sync.py @@ -46,11 +46,15 @@ def sync(process_id: str, local_path: typing.Union[str, os.PathLike], direction: with open(local_path, "r") as f: f_content = f.read() process_prev_state["code"] = f_content - requests.post( - f"{GEOWEAVER_DEFAULT_ENDPOINT_URL}/web/edit/process", - data=json.dumps(process_prev_state), - headers={"Content-Type": "application/json"}, - ) + response = requests.post( + f"{GEOWEAVER_DEFAULT_ENDPOINT_URL}/web/edit/process", + data=json.dumps(process_prev_state), + headers={"Content-Type": "application/json"}, + ) + if response.status_code == 200: + print("Process update was successful") + else: + print("Update failed with status code:", response.status_code) else: raise Exception( "Please specify the direction to sync. Choices - [UPLOAD, DOWNLOAD]" diff --git a/pyproject.toml b/pyproject.toml index db692d6..50a4196 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pygeoweaver" -version = "0.7.3" +version = "0.7.4" authors = [ { name="Geoweaver team", email="geoweaver.app@gmail.com" }, ] @@ -22,7 +22,7 @@ classifiers = [ [tool.poetry] name = "pygeoweaver" -version = "0.7.3" +version = "0.7.4" description = "This is a wrapper package of the Geoweaver app." authors = ["Geoweaver team "] readme = "README.md"