Skip to content

Application Creation

gvoysey edited this page Nov 6, 2014 · 1 revision

To add a new app named NewApp to the unlock framework, modify the following files in $REPOBASE/unlock:

  • unlock/conf.json

    • add a new field , NewApp
    • Add NewApp to the list of controllers specified in dashboard
  • In unlock/controller/resource

    • add a AppName-icon.jpg or AppName-icon.png file, 128 x 128 pixels, as the app icon.
  • unlock/__init.py__

    • add a new method named appName. The parameters that are specified in this method's signature must match the ones specified in the JSON (with optional additional parameters that must have default values specified in the signature). gridspeak is a good pattern to follow.
    • In particular:
      • create factory methods for any state models. Place the factory methods in \unlock\state\__init.py__, and implement the bodies in a separate appName_state.py file in \unlock\state.
      • create a factory method and associated implementation for the View in unlock\view\__init.py__ and in a separate appName_view.py file in \unlock\view.
    • return the bare icon filename as the icon= parameter of return self.controller_factory.create_controller_chain() at the end of the appname method in unlock\__init__.py

This is sufficient for a "bare-bones" app. To add more functionality requires touching more of the code base. For example, a new decoder would be implemented in unlock\bci\decode , etc...

Clone this wiki locally