Address PR comments

Signed-off-by: John <jonawals@amazon.com>
This commit is contained in:
John
2021-06-23 16:47:40 +01:00
parent 1cf1301a07
commit fd1bb483c0
9 changed files with 24 additions and 133 deletions
@@ -1,46 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
namespace AzToolsFramework
{
//! Provides a bus to notify when Python scripts are about to run.
class EditorPythonRunnerNotification
: public AZ::EBusTraits
{
public:
//////////////////////////////////////////////////////////////////////////
// EBusTraits overrides
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
//////////////////////////////////////////////////////////////////////////
//! Notifies the execution of a Python script using a string.
virtual void ExecuteByString([[maybe_unused]] AZStd::string_view script) {}
//! Notifies the execution of a Python script using a filename.
virtual void ExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {}
//! Notifies the execution of a Python script using a filename and args.
virtual void ExecuteByFilenameWithArgs(
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
//! Notifies the execution of a Python script as a test.
virtual void ExecuteByFilenameAsTest(
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
};
using EditorPythonRunnerNotificationBus = AZ::EBus<EditorPythonRunnerNotification>;
} // namespace AzToolsFramework
@@ -27,18 +27,18 @@ namespace AzToolsFramework
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
//////////////////////////////////////////////////////////////////////////
//! Notifies the execution of a Python script using a string.
virtual void OnExecuteByString([[maybe_unused]] AZStd::string_view script) {}
//! Notifies the start of execution of a Python script using a string.
virtual void OnStartExecuteByString([[maybe_unused]] AZStd::string_view script) {}
//! Notifies the execution of a Python script using a filename.
virtual void OnExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {}
//! Notifies the start of execution of a Python script using a filename.
virtual void OnStartExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {}
//! Notifies the execution of a Python script using a filename and args.
virtual void OnExecuteByFilenameWithArgs(
//! Notifies the start of execution of a Python script using a filename and args.
virtual void OnStartExecuteByFilenameWithArgs(
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
//! Notifies the execution of a Python script as a test.
virtual void OnExecuteByFilenameAsTest(
//! Notifies the start of execution of a Python script as a test.
virtual void OnStartExecuteByFilenameAsTest(
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] AZStd::string_view testCase, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
};
using EditorPythonScriptNotificationsBus = AZ::EBus<EditorPythonScriptNotifications>;