~ampernand/anonplus/i2p_branch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sys

class App:
    '''A class which privides overwritable methods to included apps.'''
    def setup(self):
        '''Called when the app is loaded.'''
        pass
    
def register(app):
    '''Registers the app as being loaded, and creates and stores the instance
    to send events to. Also calls the setup method on the app object once it
    is created from the provided class. `app` should be a class.
    '''
    instance = app()
    # TODO: register instance
    instance.setup()