Thonny Plugin Development

136 views
Skip to first unread message

John Giftakis

unread,
Dec 24, 2022, 5:35:24 AM12/24/22
to thonny
Hi, I am trying to make a Thonny plugin that will fetch remote .py files and will load them in editor.
I started by downloading Black Formatter plugin that is available in https://thonny.org/#plugins

I changed the __init__.py content to the simple example:

from thonny import get_workbench
from tkinter.messagebox import showinfo

def hello():
    showinfo("Hello!", "Thonny rules!")

def load_plugin():
    get_workbench().add_command(command_id="hello",
                                menu_name="tools",
                                command_label="Hello!",
                                handler=hello)


But I get error when I am trying Tools > Manage Plugins > Import Local Zip

Something that setup.py or pyproject.toml is not found, although they are present.

Any ideas or a simple (detailed) to follow guide on how to make a Plugin from scratch?

___
Br, John

John Giftakis

unread,
Dec 24, 2022, 8:23:55 AM12/24/22
to thonny
I found the error. I should have issued
python3 -m build
in the thonny-myplugin-v0.0.1 directory first 
and then I should upload the compressed file within Thonny.
Reply all
Reply to author
Forward
0 new messages