mojo.extensions

getExtensionDefault(key, fallback=None)

Get an default value for a key, with a fallback if the key is not present in the defaults.

setExtensionDefault(key, value)

Set a default value for a key.

getExtensionDefaultColor(key, fallback=None)

Get a color object for a key. with a fallback if the key is not present in the defaults. (the fallback must be a color object)

setExtensionDefaultColor(key, value)

Set a default color for a key.

registerExtensionDefaults(defaults)

Register a default dictionary. This will not overwrite existing defaults.

removeExtensionDefault(key)

Remove an key from the extensions defaults.

class ExtensionBundle()

Extension Bundle object to read, write and install extensions.

Bundle spec:

```text .roboFontExt

    lib                                 folder
    html                                folder         (not required, unless html is True in the info.plist)
    resources                           folder         (not required)
    info.plist                          plist xml
        {
        name                            str
        developer                       str
        developerURL                    str
        html                            bool           (not required, if True html folder is required)
        launchAtStartUp                 bool
        mainScript                      str
        uninstallScript                 str            (not required, v2)
        addToMenu                       list of dicts
            [
                * {
                path                    str
                preferredName           str
                shortKey                str or tuple
                nestInSubmenus          bool           (not required, v2)
                }
            ]
        timeStamp                       float
        version                         str
        requiresVersionMajor            str            (not required)
        requiresVersionMinor            str            (not required)
        }
    license                             txt / html     (not required)
    requirements.txt                    txt            (not required) ``

addToMenu

Get and set the script to add to a menu.

developer

Get and set the developer.

developerURL

Get and set the developer URL.

fileExtension

html

Get and set if the extension has html help.

icon

Get and set the extension icon.

infoDictionary

Return the info.plist as a dictionary.

launchAtStartUp

Get and set a script to launch at RoboFont start up.

license

Get and set the license for the extension.

mainScript

Get and set the main script.

requirements

Get and set the requirements for the bundle.

requiresVersionMajor

Get and set the minor required RoboFont version

requiresVersionMinor

Get and set the major required RoboFont version.

resourcesNamesMap

Get a resources mapping resources file names to paths.

timeStamp

Get and set the extension time stamp

uninstallScript

Get and set the uninstall script.

version

Get and set the extension version.

HTMLIndexPath()

Get the HTML index.html path.

HTMLPath()

Get the HTML path.

addScriptToMenu(path, preferredName, shortKey='')

Add a path to a python file with preferredName menu name and shortKey.

bundleExists()

Return True when extension exists.

bundlePath()

Get the bundle path.

deinstall(update=True)

Deinstall an extension.

fileName()

Get the file name.

getDeveloperNSURL()

Get the developer URL as an NSURL object.

getInfo(key, fallback=None)

Get info with a key

Optionally a fallback value can be provided.

getResourceFilePath(name, ext='*')

Get a resources file path by name.

Optionally an ext can be provided.

getResourceImage(imageName, ext='*')

Get a resources image by imageName.

Optionally an ext can be provided.

hasHTML()

Return if the extension has HTML help.

infoDictionaryPath()

Get info.plist path.

install(showMessages=True)

Install an extension.

Optionally showMessages can be disabled.

iterParseRequirements(requirements)

libPath()

Get the lib path.

licensePath()

Get the license path.

loadRequirements(done)

mainScriptPath()

Get the main script path.

menuScriptPaths()

Return the script that are set in the extension menu.

openHelp()

Open a help window for the extension.

requirementsPath()

Get the requirements path.

resolveRequirements()

resourcesPath()

Get the resourcers path.

setInfo(key, value)

Set info with a key and value.

uninstallScriptPath()

Get the path to the script that uninstalls the extension.

validate()

Validate the extension.

According the spec see extension file specification

validateHTML()

Validate the HTML, if present.

validateInfo()

Validate the info.plist.

validateLib()

Validate the lib where all python files are stored.

validateLicense()

Validate license text/html.

validateRequirements()

Validate requirements text.

validateResources()

Validate all resources.

validationErrors()

Get the validation errors as a string.

allExtensions()

Get all installed extensions.

buildExtensionMenu(menu)

Build the extension menu.

loadAllExtensions()

Loads all installed extensions. This is used by RoboFont during startup.

setAllExtensions(value)

Set all extensions. This does nothing use install.

updatePreferenceWindow()

Update the preferences window.

updateScriptingMenu()

Update the scripting menu.

Last edited on 08/12/2018