|
@@ -19,11 +19,31 @@ import shutil
|
|
import subprocess
|
|
import subprocess
|
|
|
|
|
|
from o3de import command_utils, manifest, utils
|
|
from o3de import command_utils, manifest, utils
|
|
|
|
+
|
|
|
|
+# Check if tkinter is installed or not
|
|
tkinter_installed = True
|
|
tkinter_installed = True
|
|
try:
|
|
try:
|
|
from o3de.ui import export_project as export_project_ui
|
|
from o3de.ui import export_project as export_project_ui
|
|
except:
|
|
except:
|
|
tkinter_installed = False
|
|
tkinter_installed = False
|
|
|
|
+
|
|
|
|
+# Check if tix is installed or not
|
|
|
|
+tkinter_tix_installed = True
|
|
|
|
+try:
|
|
|
|
+ # `tix` won't be detected with a simple import, it won't raise an exception until
|
|
|
|
+ # tk attempts to create an object
|
|
|
|
+ import tkinter.tix as tkp
|
|
|
|
+
|
|
|
|
+ class CheckTix(tkp.Tk):
|
|
|
|
+
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__()
|
|
|
|
+
|
|
|
|
+ CheckTix().destroy()
|
|
|
|
+
|
|
|
|
+except Exception as e:
|
|
|
|
+ tkinter_tix_installed = False
|
|
|
|
+
|
|
from typing import List
|
|
from typing import List
|
|
from enum import IntEnum
|
|
from enum import IntEnum
|
|
|
|
|
|
@@ -395,14 +415,17 @@ def _run_export_script(args: argparse, passthru_args: list) -> int:
|
|
export_script = args.export_script
|
|
export_script = args.export_script
|
|
|
|
|
|
if args.configure:
|
|
if args.configure:
|
|
- if tkinter_installed:
|
|
|
|
|
|
+ if tkinter_installed and tkinter_tix_installed:
|
|
export_config = get_export_project_config(args.project_path)
|
|
export_config = get_export_project_config(args.project_path)
|
|
project_info = manifest.get_project_json_data(project_path=args.project_path)
|
|
project_info = manifest.get_project_json_data(project_path=args.project_path)
|
|
is_o3de_sdk = project_info.get('engine') == 'o3de-sdk'
|
|
is_o3de_sdk = project_info.get('engine') == 'o3de-sdk'
|
|
export_project_ui.MainWindow(export_config, is_o3de_sdk).configure_settings()
|
|
export_project_ui.MainWindow(export_config, is_o3de_sdk).configure_settings()
|
|
return 0
|
|
return 0
|
|
else:
|
|
else:
|
|
- print("Unable to open configure window. Tk is not installed on this system")
|
|
|
|
|
|
+ if not tkinter_installed:
|
|
|
|
+ print("Unable to open the configure window. Required package 'tk' is not installed on this system.")
|
|
|
|
+ else:
|
|
|
|
+ print("Unable to open the configure window. Required package 'tix' is not installed on this system.")
|
|
return 1
|
|
return 1
|
|
|
|
|
|
return _export_script(export_script, args.project_path, passthru_args)
|
|
return _export_script(export_script, args.project_path, passthru_args)
|