'''
Boot menu module. Generates automatically a boot menu for each computer
according to the operative systems installed.
'''

from ..pluginbase import PluginBase
from clientjob.model import Job
import config
import views
import web

class Plugin(PluginBase):
    def enable(self):
        # Adding bootmenu to public paths making it accesible by not
        # authenticated clients
        public_path = r".*bootmenu/view.*"
        if not public_path in config.PUBLIC_PATHS:
            config.PUBLIC_PATHS = config.PUBLIC_PATHS + (public_path,)

        self.actions_for_url = ('/navigator/computer/(.*)/', 'view_menu')
        self.urls = (
            'view/([0-9.]+)?/?', views.ShowBootMenu,
            self.get_action_url('view_menu'), views.ShowBootMenuAction
        )
