From 9b393d16fe3fa85a62355a2baaa047cd45fb414a Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Wed, 10 Nov 2021 17:34:20 -0600 Subject: [PATCH] [lyn3736] adding init files to module paths (#5111) * fixing class names in PYI files Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com> --- .../Code/Source/PythonLogSymbolsComponent.cpp | 5 +++++ Gems/EditorPythonBindings/Code/Source/PythonProxyObject.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Gems/EditorPythonBindings/Code/Source/PythonLogSymbolsComponent.cpp b/Gems/EditorPythonBindings/Code/Source/PythonLogSymbolsComponent.cpp index d39ca83000..0be51909f4 100644 --- a/Gems/EditorPythonBindings/Code/Source/PythonLogSymbolsComponent.cpp +++ b/Gems/EditorPythonBindings/Code/Source/PythonLogSymbolsComponent.cpp @@ -739,6 +739,11 @@ namespace EditorPythonBindings moduleParts.pop_back(); AzFramework::StringFunc::Append(targetModule, ".pyi"); + // create an __init__.py file as the base module path + AZStd::string initModule; + AzFramework::StringFunc::Join(initModule, moduleParts.begin(), moduleParts.end(), '.'); + OpenInitFileAt(initModule); + AZStd::string modulePath; AzFramework::StringFunc::Append(modulePath, m_basePath.c_str()); AzFramework::StringFunc::Append(modulePath, AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING); diff --git a/Gems/EditorPythonBindings/Code/Source/PythonProxyObject.cpp b/Gems/EditorPythonBindings/Code/Source/PythonProxyObject.cpp index df246d230d..120e0de220 100644 --- a/Gems/EditorPythonBindings/Code/Source/PythonProxyObject.cpp +++ b/Gems/EditorPythonBindings/Code/Source/PythonProxyObject.cpp @@ -846,7 +846,7 @@ namespace EditorPythonBindings { return ConstructPythonProxyObjectByTypename(behaviorClassName, pythonArgs); }); - PythonSymbolEventBus::QueueBroadcast(&PythonSymbolEventBus::Events::LogClassWithName, subModuleName, behaviorClass, properSyntax); + PythonSymbolEventBus::QueueBroadcast(&PythonSymbolEventBus::Events::LogClassWithName, subModuleName, behaviorClass, syntaxName.value()); } else {