Skip to content

Commit 3b45dcc

Browse files
authored
SHOT-4375: Allow tk-alias to use the framework when runnign headless. (#56)
* Expose method to allow tk-alias to init the framework when running headless * Ensure there is a logger object
1 parent 399e644 commit 3b45dcc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

python/tk_framework_alias/server/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def get_alias_api_module():
114114
alias_bin_path = os.environ.get("ALIAS_PLUGIN_CLIENT_ALIAS_EXECPATH")
115115
if not alias_bin_path:
116116
raise AliasPythonApiImportError(
117-
"Couldn't get Alias bin path: set the environment variable ALIAS_PLUGIN_CLINET_ALIAS_EXECPATH."
117+
"Couldn't get Alias bin path: set the environment variable ALIAS_PLUGIN_CLIENT_ALIAS_EXECPATH."
118118
)
119119
alias_dll_path = os.path.dirname(alias_bin_path)
120120
with os.add_dll_directory(alias_dll_path):

python/tk_framework_alias_utils/startup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def get_plugin_lst(alias_version, python_major_version, python_minor_version, lo
433433
return lst_file
434434

435435

436-
def __ensure_python_c_extension_packages_installed(python_version=None, logger=None):
436+
def ensure_python_c_extension_packages_installed(python_version=None, logger=None):
437437
"""
438438
Ensure python C extension packages are unzipped and installed for user.
439439
@@ -447,6 +447,10 @@ def __ensure_python_c_extension_packages_installed(python_version=None, logger=N
447447
:rtype: bool
448448
"""
449449

450+
if logger is None:
451+
logger = logging.getLogger(__file__)
452+
logger.setLevel(logging.DEBUG)
453+
450454
python_versions = environment_utils.get_framework_supported_python_versions()
451455
if python_version:
452456
if python_version not in python_versions:
@@ -766,7 +770,7 @@ def ensure_plugin_ready(
766770
# Ensure C extension packages installed for user. Install for all supported Python
767771
# versions, just in case the python version the framework runs with is different that
768772
# the current running version.
769-
__ensure_python_c_extension_packages_installed(logger=logger)
773+
ensure_python_c_extension_packages_installed(logger=logger)
770774

771775
# Get the file path to the .lst file that contains the file path to the Alias Plugin to
772776
# load at startup with Alias.

0 commit comments

Comments
 (0)