TNO Intern

Commit 1a2fa337 authored by Hen Brett's avatar Hen Brett 🐔
Browse files

renaming the jvm_start python code

parent 30837d3c
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -9,12 +9,14 @@ def get_jvm_path() -> str:
    """
    return str(files("pythermogis") / "resources" / "java" / "coretto-17" / "bin" / "server" / "jvm.dll")


def get_thermogis_jar_path() -> str:
    """
    From the resources directory, return the path to the ThermoGIS Jar
    """
    return str(files("pythermogis") / "resources" / "thermogis_jar" / "thermogis-1.7.0-shaded_newprops.jar")


def start_jvm():
    """
    To use the JPype package a java .jar file has to be instantiated with a java virtual machine (jvm)
@@ -24,6 +26,7 @@ def start_jvm():
    if not jpype.isJVMStarted():
        jpype.startJVM(get_jvm_path(), classpath=[get_thermogis_jar_path()])


def close_jvm():
    """
    To use the JPype package a java .jar file has to be instantiated with a java virtual machine (jvm)
@@ -32,7 +35,3 @@ def close_jvm():
    """
    if jpype.isJVMStarted():
        jpype.shutdownJVM()


if __name__ == "__main__":
    start_jvm()
 No newline at end of file