Removed fullPathGiven and instead check if path is a file when getting gem json data
Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
@@ -688,13 +688,13 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
}
|
||||
|
||||
GemInfo PythonBindings::GemInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath, bool fullPathGiven)
|
||||
GemInfo PythonBindings::GemInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath)
|
||||
{
|
||||
GemInfo gemInfo;
|
||||
gemInfo.m_path = Py_To_String(path);
|
||||
gemInfo.m_directoryLink = gemInfo.m_path;
|
||||
|
||||
auto data = m_manifest.attr("get_gem_json_data")(pybind11::none(), path, pyProjectPath, fullPathGiven);
|
||||
auto data = m_manifest.attr("get_gem_json_data")(pybind11::none(), path, pyProjectPath);
|
||||
if (pybind11::isinstance<pybind11::dict>(data))
|
||||
{
|
||||
try
|
||||
@@ -728,10 +728,6 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
gemInfo.m_downloadStatus = GemInfo::DownloadStatus::Downloaded;
|
||||
}
|
||||
if (fullPathGiven)
|
||||
{
|
||||
gemInfo.m_downloadStatus = GemInfo::DownloadStatus::NotDownloaded;
|
||||
}
|
||||
|
||||
if (data.contains("user_tags"))
|
||||
{
|
||||
@@ -1178,7 +1174,9 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
for (auto path : gemPaths)
|
||||
{
|
||||
gemInfos.push_back(GemInfoFromPath(path, pybind11::none(), true));
|
||||
GemInfo gemInfo = GemInfoFromPath(path, pybind11::none());
|
||||
gemInfo.m_downloadStatus = GemInfo::DownloadStatus::NotDownloaded;
|
||||
gemInfos.push_back(gemInfo);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
AZ::Outcome<void, AZStd::string> ExecuteWithLockErrorHandling(AZStd::function<void()> executionCallback);
|
||||
bool ExecuteWithLock(AZStd::function<void()> executionCallback);
|
||||
GemInfo GemInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath, bool fullPathGiven = false);
|
||||
GemInfo GemInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath);
|
||||
GemRepoInfo GetGemRepoInfo(pybind11::handle repoUri);
|
||||
ProjectInfo ProjectInfoFromPath(pybind11::handle path);
|
||||
ProjectTemplateInfo ProjectTemplateInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath);
|
||||
|
||||
@@ -494,7 +494,7 @@ def get_project_json_data(project_name: str = None,
|
||||
|
||||
|
||||
def get_gem_json_data(gem_name: str = None, gem_path: str or pathlib.Path = None,
|
||||
project_path: pathlib.Path = None, full_path_given: bool = False) -> dict or None:
|
||||
project_path: pathlib.Path = None) -> dict or None:
|
||||
if not gem_name and not gem_path:
|
||||
logger.error('Must specify either a Gem name or Gem Path.')
|
||||
return None
|
||||
@@ -502,10 +502,10 @@ def get_gem_json_data(gem_name: str = None, gem_path: str or pathlib.Path = None
|
||||
if gem_name and not gem_path:
|
||||
gem_path = get_registered(gem_name=gem_name, project_path=project_path)
|
||||
|
||||
if not full_path_given:
|
||||
return get_json_data('gem', gem_path, validation.valid_o3de_gem_json)
|
||||
else:
|
||||
if isinstance(gem_path, pathlib.Path) and gem_path.is_file():
|
||||
return get_json_data_file(gem_path, 'gem', validation.valid_o3de_gem_json)
|
||||
else:
|
||||
return get_json_data('gem', gem_path, validation.valid_o3de_gem_json)
|
||||
|
||||
|
||||
def get_template_json_data(template_name: str = None, template_path: str or pathlib.Path = None,
|
||||
|
||||
Reference in New Issue
Block a user