Changed how Java is detected (and reported) from the PATH.

master
Pacman Ghost 2 years ago
parent 7f17a634eb
commit fa5a99e87c
  1. 5
      vasl_templates/webapp/main.py
  2. 5
      vasl_templates/webapp/utils.py

@ -14,7 +14,7 @@ from flask import request, render_template, jsonify, send_file, redirect, url_fo
from vasl_templates.webapp import app, shutdown_event
from vasl_templates.webapp.vassal import VassalShim
from vasl_templates.webapp.utils import MsgStore, get_java_version, parse_int
from vasl_templates.webapp.utils import MsgStore, get_java_path, get_java_version, parse_int
import vasl_templates.webapp.config.constants
from vasl_templates.webapp.config.constants import BASE_DIR, DATA_DIR, IS_FROZEN
from vasl_templates.webapp import globvars
@ -185,8 +185,9 @@ def get_program_info():
params[ "VASL_VERSION" ] = globvars.vasl_mod.vasl_version
params[ "VASL_REAL_VERSION" ] = globvars.vasl_mod.vasl_real_version
for key in [ "VASSAL_DIR", "VASL_MOD", "VASL_EXTNS_DIR", "BOARDS_DIR",
"JAVA_PATH", "WEBDRIVER_PATH", "CHAPTER_H_NOTES_DIR", "USER_FILES_DIR" ]:
"WEBDRIVER_PATH", "CHAPTER_H_NOTES_DIR", "USER_FILES_DIR" ]:
params[ key ] = app.config.get( key )
params[ "JAVA_PATH" ] = get_java_path()
params[ "JAVA_VERSION" ] = get_java_version()
def parse_timestamp( val ):

@ -246,10 +246,9 @@ def get_java_path():
if os.path.isfile( fname ):
java_path = fname
# check if we've found a Java runtime
# check the PATH
if not java_path:
# nope - hope that there's one on the PATH
java_path = "java"
java_path = shutil.which( "java" )
return java_path

Loading…
Cancel
Save