This template have basic structure of TouchPortal plugin using TouchPortal-Python-API. It contains
- workflow to build your plugin when creating release using github action matrix.
TPPEntry.py
contains infomation to generate a newentry.tp
.main.py
that shows you how to setup callbacks and logger.build.py
that helps you to build your plugin into.tpp
file.start.sh
that allows user to run the executable on Mac and Linux system.
- In the top right corner of your screen, where Clone usually is, you have a Use this template button to click.
- Give the repository a name and a description.
- Click Create repository from template.
It is recommanded to use a dependency manager. In this case we will be using a virtual environment.
Create a virtual environment in the folder .venv
.
$ python -m venv .venv
It will change based on your operating system and shell.
# Linux, Bash
$ source .venv/bin/activate
# Linux, Fish
$ source .venv/bin/activate.fish
# Linux, Csh
$ source .venv/bin/activate.csh
# Linux, PowerShell Core
$ .venv/bin/Activate.ps1
# Windows, cmd.exe
> .venv\Scripts\activate.bat
# Windows, PowerShell
> .venv\Scripts\Activate.ps1
Once the environment is created and activated, you can install any libraries that's required for your project.
after you've installed the library you should create requirements.txt
using this command.
$ pip freeze > requirements.txt
When environment is activated, you can exit the environment by using this command.
$ deactivate
This template also include a github action scrip that when you publish a release it will automatically build Mac, Windows and Linux .tpp file and upload to the release. It basically go to each system and run the build.py that you've created. and publish the result.