Package empro :: Package toolkit :: Module addon
[frames] | no frames]

Module addon

source code

Classes
  AddonDefinition
Functions
 
makeAction(title, onTriggered, icon=None)
Helper function to wrap a Python function into a gui.Action.
source code
 
makeContextAction(title, onTriggered, icon=None)
Helper function to wrap a Python function into a gui.Action for a context menu - title: string (which can contain ampersands for shortcuts) - onTriggered: Python function that does require one argument: the context selection.
source code
 
loadAdditionalAddons(searchDirs, forceEnabled=True)
Search additional add-ons in searchDirs, and load them.
source code
 
unwrapLines(docstring)
joins lines in a docstring where a newline appears to be in the middle of a sentence.
source code
Variables
  m = 'rb'
  suffix = '.pyc'
  t = 2
Function Details

makeAction(title, onTriggered, icon=None)

source code 

Helper function to wrap a Python function into a gui.Action.
- title: string (which can contain ampersands for shortcuts)
- onTriggered: Python function that does not require arguments
- icon: optional, either an gui.Icon, or a file path to an icon image.

makeContextAction(title, onTriggered, icon=None)

source code 

Helper function to wrap a Python function into a gui.Action for a context menu
- title: string (which can contain ampersands for shortcuts)
- onTriggered: Python function that does require one argument: the context selection.
- icon: optional, either an gui.Icon, or a file path to an icon image.

loadAdditionalAddons(searchDirs, forceEnabled=True)

source code 

Search additional add-ons in searchDirs, and load them. searchDirs can be a string or list of directories. When forceEnabled is True, the new-found add-ons will be enabled regardless of the user settings.

Add-ons loaded before calling loadAdditionalAddons can influence the behaviour of this call. If a add-on by the same name but different location is already loaded, the new one will be ignored.

unwrapLines(docstring)

source code 

joins lines in a docstring where a newline appears to be in the middle
of a sentence.

It's not perfect, and the following rules apply for two lines to be joined:
- neither should be empty or all whitespace
- there should be no indentation.
- the second line should start with a letter (capital or small)