#NEWLINE# def register( ext_id , name , display_admin = False , superuser = False , version = None ) : #NEWLINE# #INDENT# '\n    Register a new extension on the system.\n\n    Parameters\n    ----------\n    ext_id : str\n        Unique identifier for the extension.\n    name : str\n        Human readable name of the extension.\n    display_admin : bool\n        Indicates if the extension provides pages for the admin interface.\n    superuser : bool\n        Indicates if the extentsion is available for superusers only.\n    version : str\n        Version of the extension (optional).\n\n    Raises\n    ------\n    ExtensionExists\n        When another extension with the same `ext_id` has already been\n        registered.\n    ' #NEWLINE# if ( ext_id in extensions . keys ( ) ) : #NEWLINE# #INDENT# raise ExtensionExists ( ( 'An extension with ID %s has already been registered.' % ext_id ) ) #NEWLINE# #UNINDENT# extensions [ ext_id ] = { #NEWLINE# #INDENT# 'ext_id' : ext_id , #NEWLINE# 'name' : name , #NEWLINE# 'version' : version , #NEWLINE# 'display_admin' : display_admin , #NEWLINE# 'superuser' : superuser , #NEWLINE# 'index_url' : ( ext_id + ':index' ) , #NEWLINE# #UNINDENT# }