From 58988eece5c5ab160d3559922c86e84c74adbf7f Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Mon, 4 Jan 2021 18:20:46 +0100 Subject: [PATCH] update g-python requirements and initialization --- .../java/gearth/services/gpython/GPythonVersionUtils.java | 2 +- .../main/resources/gearth/services/gpython/init_script.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/G-Earth/src/main/java/gearth/services/gpython/GPythonVersionUtils.java b/G-Earth/src/main/java/gearth/services/gpython/GPythonVersionUtils.java index 9d2f3bf..dd7f7c9 100644 --- a/G-Earth/src/main/java/gearth/services/gpython/GPythonVersionUtils.java +++ b/G-Earth/src/main/java/gearth/services/gpython/GPythonVersionUtils.java @@ -10,7 +10,7 @@ import java.util.List; public class GPythonVersionUtils { - private static final String MIN_GPYTHON_VERSION = "0.1"; + private static final String MIN_GPYTHON_VERSION = "0.1.2"; private static final String MIN_PYTHON_VERSION = "3.2"; // returns null if python not installed diff --git a/G-Earth/src/main/resources/gearth/services/gpython/init_script.py b/G-Earth/src/main/resources/gearth/services/gpython/init_script.py index c0a750c..55a7933 100644 --- a/G-Earth/src/main/resources/gearth/services/gpython/init_script.py +++ b/G-Earth/src/main/resources/gearth/services/gpython/init_script.py @@ -3,8 +3,8 @@ from time import sleep from g_python.gextension import Extension from g_python.hmessage import Direction, HMessage from g_python.hpacket import HPacket -from g_python import hparsers -from g_python import htools +from g_python import hparsers, hunityparsers +from g_python import htools, hunitytools extension_info = {"title": "$G_PYTHON_SHELL_TITLE$", "description": "G-Python scripting console", "version": "1.0", "author": ""} @@ -24,7 +24,7 @@ def send_to_server(packet): return ext.send_to_server(packet) def on_event(event_name: str, func): return ext.on_event(event_name, func) -def intercept(direction: Direction, callback, id=-1): return ext.intercept(direction, callback, id) +def intercept(direction: Direction, callback, id=-1, mode='default'): return ext.intercept(direction, callback, id, mode) def start(): return ext.start()