Update README.md

api 8 examples
This commit is contained in:
Roman Trapeznikov 2023-07-15 01:24:44 +03:00 committed by GitHub
parent 038e47a01c
commit 06763429e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,19 +80,19 @@ There are two different ways the plugin manager can be installed:
Let's say you wanna submit this new utility-type plugin named as `sample_plugin.py`: Let's say you wanna submit this new utility-type plugin named as `sample_plugin.py`:
```python ```python
# ba_meta require api 7 # ba_meta require api 8
import ba import babase
# ba_meta export plugin # ba_meta export babase.Plugin
class Main(ba.Plugin): class Main(babase.Plugin):
def on_app_running(self): def on_app_running(self):
ba.screenmessage("Hi! I am a sample plugin!") babase.screenmessage("Hi! I am a sample plugin!")
def has_settings_ui(self): def has_settings_ui(self):
return True return True
def show_settings_ui(self, source_widget): def show_settings_ui(self, source_widget):
ba.screenmessage("You tapped my settings!") babase.screenmessage("You tapped my settings!")
``` ```
You'll have to fork this repository and add your `sample_plugin.py` plugin file into the appropriate directory, which for You'll have to fork this repository and add your `sample_plugin.py` plugin file into the appropriate directory, which for