<s> from flask . ext . plugins import connect_event <EOL> from flaskbb . plugins import FlaskBBPlugin <EOL> from flaskbb . utils . populate import ( create_settings_from_fixture , <EOL> delete_settings_from_fixture ) <EOL> from flaskbb . forum . models import Forum <EOL> from . views import portal , inject_portal_link <EOL> __version__ = "<STR_LIT>" <EOL> __plugin__ = "<STR_LIT>" <EOL> def available_forums ( ) : <EOL> forums = Forum . query . order_by ( Forum . id . asc ( ) ) . all ( ) <EOL> return [ ( forum . id , forum . title ) for forum in forums ] <EOL> fixture = ( <EOL> ( '<STR_LIT>' , { <EOL> '<STR_LIT:name>' : "<STR_LIT>" , <EOL> "<STR_LIT:description>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : ( <EOL> ( '<STR_LIT>' , { <EOL> '<STR_LIT:value>' : [ <NUM_LIT:1> ] , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT:name>' : "<STR_LIT>" , <EOL> '<STR_LIT:description>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : { "<STR_LIT>" : available_forums , "<STR_LIT>" : int } <EOL> } ) , <EOL> ( '<STR_LIT>' , { <EOL> '<STR_LIT:value>' : <NUM_LIT:10> , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT:name>' : "<STR_LIT>" , <EOL> '<STR_LIT:description>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : { "<STR_LIT>" : <NUM_LIT:1> } , <EOL> } ) , <EOL> ) , <EOL> } ) , <EOL> ) <EOL> class PortalPlugin ( FlaskBBPlugin ) : <EOL> name = "<STR_LIT>" <EOL> description = ( "<STR_LIT>" ) <EOL> author = "<STR_LIT>" <EOL> license = "<STR_LIT>" <EOL> version = __version__ <EOL> settings_key = '<STR_LIT>' <EOL> def setup ( self ) : <EOL> self . register_blueprint ( portal , url_prefix = "<STR_LIT>" ) <EOL> connect_event ( "<STR_LIT>" , inject_portal_link ) <EOL> def install ( self ) : <EOL> create_settings_from_fixture ( fixture ) <EOL> def uninstall ( self ) : <EOL> delete_settings_from_fixture ( fixture ) </s>
