Plugin Lifecycle & Entry Points

Start

Called when the plug-in is first loaded by the server. Used for one-time initialization.

def Start():
    HTTP.CacheTime = CACHE_1HOUR
    HTTP.Headers['User-Agent'] = 'Mozilla/5.0'

ValidatePrefs

Called when the user saves preferences. Return a MessageContainer to display feedback.

Preferences are accessed via the global Prefs object (Prefs['key']) and defined in Contents/DefaultPrefs.json. See Preferences for the full preference system documentation.

def ValidatePrefs():
    if Prefs['username'] is None:
        return MessageContainer("Error", "Username is required.")