def __init__(self):
        super().__init__()

        self.router = Router()
        self.controller = self.router
        self.config = Config()
        self._session_repository = SessionRepository()

        login_controller = LoginController()
        login_controller.bind_routes("login", self.router)

        role_controller = RoleController()
        role_controller.bind_routes("role", self.router)

        account_form_controller = AccountFormController()
        account_form_controller.bind_routes("account", self.router)
        account_list_controller = AccountListController()
        account_list_controller.bind_routes("account", self.router)

        company_form_controller = CompanyFormController()
        company_form_controller.bind_routes("company", self.router)
        company_list_controller = CompanyListController()
        company_list_controller.bind_routes("company", self.router)

        def redirect_to_index(state):
            (request, response, session) = state.unfold()
            response.setRedirect("/index.html")
            return state

        self.router.addMapping(r"^/$", redirect_to_index)

        self.router.addStaticMapping(r"^/static/", "../client/dist")
        self.router.addStaticMapping(r"^/", "../client/dist")
Esempio n. 2
0
    def __init__(self, ui):
        self.ui = ui

        # Read in config information
        configdir = os.path.abspath(os.path.expanduser('~/.freeseer/'))
        self.config = Config(configdir)
        self.logger = Logger(configdir)

        # Start Freeseer Recording Backend
        self.freeseer = Freeseer_gstreamer(self)
        resolution = self.config.resolution.split('x')
        self.change_output_resolution(resolution[0], resolution[1])

        self.spaces = False
        self.logger.log.info(u"Core initialized")