From 07383e9c54945dce5e805d5e062963d8eae19548 Mon Sep 17 00:00:00 2001 From: louisnw Date: Sun, 28 Apr 2024 23:47:49 +0100 Subject: [PATCH 1/4] update .gitignore --- .gitignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index e35662d..f35cd0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,16 @@ docs/build/** +venv/ +.ipynb_checkpoints/ +__pycache__/ +build/ +dist/ +*.egg-info/ + +node_modules/ + +.DS_Store +*.sublime-* +.idea/ +pyrightconfig.json + +working/ From acdccc428c3f8db146f6b2d4de374195ef0a2823 Mon Sep 17 00:00:00 2001 From: louisnw Date: Mon, 6 May 2024 11:47:19 +0100 Subject: [PATCH 2/4] catch JavaScriptException (and ignore if pywebview version < 5) --- lightweight_charts/chart.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lightweight_charts/chart.py b/lightweight_charts/chart.py index 19eb805..855ada2 100644 --- a/lightweight_charts/chart.py +++ b/lightweight_charts/chart.py @@ -2,6 +2,12 @@ import asyncio import multiprocessing as mp import webview +# temporary until we fix to pywebview v5 +try: + from webview.errors import JavascriptException +except ModuleNotFoundError: + JavascriptException = Exception + from lightweight_charts import abstract from .util import parse_event_message, FLOAT @@ -61,8 +67,12 @@ class PyWV: self.return_queue.put(self.windows[i].evaluate_js(arg[14:])) else: self.windows[i].evaluate_js(arg) - except KeyError: + except KeyError as e: return + except JavascriptException as e: + pass + # msg = eval(str(e)) + # raise JavascriptException(f"\n\nscript -> '{arg}',\nerror -> {msg['name']}[{msg['line']}:{msg['column']}]\n{msg['message']}") class Chart(abstract.AbstractChart): From d34acfb4a21c48fb6105aa27e99d740f4e787794 Mon Sep 17 00:00:00 2001 From: louisnw Date: Sun, 19 May 2024 17:38:15 +0100 Subject: [PATCH 3/4] fix pywebview version till 2.0 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 13df00e..9942580 100644 --- a/setup.py +++ b/setup.py @@ -5,12 +5,12 @@ with open('README.md', 'r', encoding='utf-8') as f: setup( name='lightweight_charts', - version='1.0.20', + version='1.0.21', packages=find_packages(), python_requires='>=3.8', install_requires=[ 'pandas', - 'pywebview>=4.3', + 'pywebview==4.4.1', ], package_data={ 'lightweight_charts': ['js/*.js'], From ad2daeb95ea761c1dfc15eb3ccf16a71c4075db8 Mon Sep 17 00:00:00 2001 From: louisnw Date: Sun, 19 May 2024 18:12:29 +0100 Subject: [PATCH 4/4] update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9942580..b871027 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r', encoding='utf-8') as f: setup( name='lightweight_charts', - version='1.0.21', + version='1.0.22', packages=find_packages(), python_requires='>=3.8', install_requires=[