-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#89 - Base class for a Pyttman plugin, with methods for plugin implem…
…entations to override.
- Loading branch information
1 parent
0ebb059
commit 4ef1007
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from pyttman.core.containers import MessageMixin | ||
|
||
|
||
class PyttmanPlugin: | ||
""" | ||
The PluginBase class offers an API for contributors to | ||
develop custom workflows which interact with different | ||
parts of a Pyttman application runtime. | ||
Implement methods as desired to interact with the | ||
various layers. | ||
The instance is long-lived throughout the application runtime. | ||
""" | ||
|
||
def before_app_start(self, app): | ||
""" | ||
Implement this method to have code execute before the app | ||
starts. | ||
""" | ||
pass | ||
|
||
def after_app_stops(self, app): | ||
""" | ||
Implement this method to have code execute when the | ||
app has exited | ||
""" | ||
|
||
def before_intent(self, message: MessageMixin): | ||
""" | ||
Implement this method to interact with the processing | ||
of a message, before it's processed by the matching Intent. | ||
""" | ||
pass | ||
|
||
def after_intent(self, reply: MessageMixin): | ||
""" | ||
Implement this method to interact with the Reply object | ||
from an Intent, before it's delivered to the Client for | ||
a platform response. | ||
""" | ||
pass |