diff options
| author | 2025-03-15 16:35:39 +0800 | |
|---|---|---|
| committer | 2025-03-15 16:35:39 +0800 | |
| commit | 965771fb0d85ddb27dc6c5dd7df822d1fb318286 (patch) | |
| tree | f33a0d36e5716da13be0e3a4134cf7359ebe5223 /examples/custom_plugin.py | |
| parent | 818d84a7bf00c07b7ab252dda5bfa70a98b8be65 (diff) | |
| download | conventional_role_play-965771fb0d85ddb27dc6c5dd7df822d1fb318286.tar.gz conventional_role_play-965771fb0d85ddb27dc6c5dd7df822d1fb318286.zip | |
refactor: clean up code formatting and add new PluginManager class
Diffstat (limited to 'examples/custom_plugin.py')
| -rw-r--r-- | examples/custom_plugin.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/custom_plugin.py b/examples/custom_plugin.py index 5ae6581..ecb9e71 100644 --- a/examples/custom_plugin.py +++ b/examples/custom_plugin.py @@ -1,25 +1,28 @@ from conventionalrp.plugins.plugin_manager import PluginManager + class CustomPlugin: def __init__(self): self.name = "Custom Plugin" - + def process(self, data): # Custom processing logic processed_data = data.upper() # Example transformation return processed_data + def main(): plugin_manager = PluginManager() custom_plugin = CustomPlugin() - + plugin_manager.register_plugin(custom_plugin) - + # Example data to process data = "This is a sample TRPG log." result = custom_plugin.process(data) - + print(f"Processed Data: {result}") + if __name__ == "__main__": - main()
\ No newline at end of file + main() |
