mojo.extensions

from mojo.extensions import *

Classes

  • ExtensionBundle(name=None, path=None, libName="lib", htmlName="html", indexHTMLName="index.html", resourcesName="Resources")
    An extension bundle objects allowing access to different parts of an extension.
     
    initiate an ExtensionBundle object
    name: name of an extension (either name or path is required)
    path: path to an extension (either name or path is required) 
     
    version
    returns the version of the extension
    name
    returns the name of the extension
    developer
    returns the developer of the extension
    developerURL
    returns the developer URL of the extension
    requiresVersionMajor
    returns the required major version number of RoboFont
    requiresVersionMinor
    returns the required minor version number of RoboFont
    addToMenu
    returns a bool if the bundle should be added to the extension menu
    launchAtStartUp
    returns a bool if the bundle should be launched at start up
    mainScript
    returns the filename of the main script

    timeStamp
    returns the time stamp, stamped when the extension is build
     
    get(name, ext='*')
    returns the file within the extension, if its is an image it will return the NSImage object around that image.
    install()
    installs the extension
    deinstall()
    de-installs the extension 
    openHelp()
    Opens the help HTML in an HTMLHelpWindow
    validate()
    validates the extension
    validateErrors()
    returns a string of validation errors
    bundlePath()
    returns the path of the extension bundle
    libPath()
    returns the path of the lib folder inside the bundle
    HTMLPath()
    returns the path of the HTML folder inside the bundle
    resourcesPath()
    returns the path of the Resources folder inside the bundle
    infoDictionaryPath()
    returns the path of the info.plist inside the bundle
    mainScriptPath()
    returns the path of the main script
    hasHTML()
    returns a bool if the extension has HTML help
    HTMLIndexPath()
    returns the path of the index.html file
    bundleExists()
    returns if a bool if the extension bundle exists on disk  

    allExtensions()
    a class method returns all installed extensions

Methods

  • getExtensionDefault(key, fallback=None)
    returns the value for key from the extension user defaults
    if the key isn't used it returns the fallback
  • setExtensionDefault(key, value)
    set the value for key in the extensions user defaults
  • getExtensionDefaultColor(key, fallback=None)
    returns an NSColor object for key from the extension user defaults
  • setExtensionDefaultColor(key, fallback=None)
    set an NSColor for key in the extensions user defaults
  • registerExtensionsDefaults(defaults)
    register a dict with keys and values as defaults in the extension user defaults