Skip to content

UBA Startup Plugins

Eliran Wong edited this page Mar 9, 2021 · 17 revisions

UBA Startup Plugins

UBA startup plugins are plugins files executed when UBA starts.

With UBA startup plugins, you can automate a feature, a command or a batch of commands when UBA starts.

A valid plugin file should be written in python file extension ".py".

File Location

All UBA context plugins are placed in folder "plugins/startup/" inside UniqueBible home directory.

Enable Plugins

You need to have "enablePlugins" checked on "Set Config Flags" window.

Automate a Menu Plugin on Startup

You can automate an UBA menu plugin on startup

e.g. https://github.com/eliranwong/UniqueBible/wiki/Notes-Backup-with-Google-Drive#automate-restoration-on-startup

Write you own startup plugins

You may make use of the following variables below to write your own plugins.

Remarks: The more startup plugins you use, the longer the time UBA starts.

config.mainWindow

config.mainWindow points to the mainWindow of UBA. This gives you an access point of UBA built-in functions.

e.g. use config.mainWindow.runTextCommand() to run a UBA command.

config.bibleWindowContentTransformers

config.bibleWindowContentTransformers points to a list of functions, which are used to transform content to be displayed on Bible Window.

config.studyWindowContentTransformers

config.studyWindowContentTransformers points to a list of functions, which are used to transform content to be displayed on Study Window.

An Example

A startup plugin could be as simple as below.

import config

config.mainWindow.runTextCommand("SPEAK:::Hello!")

Examples on Transforming Text

https://github.com/eliranwong/UniqueBible/tree/master/plugins/startup

Clone this wiki locally