예제 #1
0
파일: doc_handler.py 프로젝트: chakas/bokeh
    def get(self, *args, **kwargs):
        session = yield self.get_session()

        websocket_url = self.application.websocket_url_for_request(self.request, self.bokeh_websocket_path)
        page = server_html_page_for_session(session.id, self.application.resources(self.request),
                                            title=session.document.title,
                                            websocket_url=websocket_url)

        self.set_header("Content-Type", 'text/html')
        self.write(page)
예제 #2
0
    def get(self, *args, **kwargs):
        session = yield self.get_session()

        page = server_html_page_for_session(session.id, self.application.resources(),
                                            title=session.document.title,
                                            template=session.document.template,
                                            template_variables=session.document.template_variables)

        self.set_header("Content-Type", 'text/html')
        self.write(page)
    def get(self, *args, **kwargs):
        session = yield self.get_session()

        websocket_url = self.application.websocket_url_for_request(self.request, self.bokeh_websocket_path)
        page = server_html_page_for_session(session.id, self.application.resources(self.request),
                                            title=session.document.title,
                                            template=session.document.template,
                                            websocket_url=websocket_url,
                                            template_variables=session.document.template_variables)

        self.set_header("Content-Type", 'text/html')
        self.write(page)
예제 #4
0
    def get(self, *args, **kwargs):
        session = yield self.get_session()

        page = server_html_page_for_session(
            session.id,
            self.application.resources(),
            title=session.document.title,
            template=session.document.template,
            template_variables=session.document.template_variables)

        self.set_header("Content-Type", 'text/html')
        self.write(page)
예제 #5
0
    def get(self, *args, **kwargs):
        session_id = self.get_argument("bokeh-session-id", default=None)
        if session_id is None:
            session_id = get_random_string()
        self.application_context.create_session_if_needed(session_id)

        websocket_url = self.application.websocket_url_for_request(self.request, self.bokeh_websocket_path)
        # TODO (havocp) we should add a "title" property to Document probably
        page = server_html_page_for_session(session_id, self.application.resources(self.request),
                                            "Bokeh App", websocket_url=websocket_url)

        self.set_header("Content-Type", 'text/html')
        self.write(page)
예제 #6
0
    def get(self, *args, **kwargs):
        session_id = self.get_argument("bokeh-session-id", default=None)
        if session_id is None:
            session_id = get_random_string()
        session = self.application_context.create_session_if_needed(session_id)

        websocket_url = self.application.websocket_url_for_request(self.request, self.bokeh_websocket_path)
        page = server_html_page_for_session(session_id, self.application.resources(self.request),
                                            title=session.document.title,
                                            websocket_url=websocket_url)

        self.set_header("Content-Type", 'text/html')
        self.write(page)
예제 #7
0
    def get(self, *args, **kwargs):
        session_id = self.get_argument("bokeh-session-id", default=None)
        if session_id is None:
            session_id = get_random_string()
        session = self.application_context.create_session_if_needed(session_id)

        websocket_url = self.application.websocket_url_for_request(
            self.request, self.bokeh_websocket_path)
        page = server_html_page_for_session(session_id,
                                            self.application.resources(
                                                self.request),
                                            title=session.document.title,
                                            websocket_url=websocket_url)

        self.set_header("Content-Type", 'text/html')
        self.write(page)
예제 #8
0
    def get(self, *args, **kwargs):
        session_id = self.get_argument("bokeh-session-id", default=None)
        if session_id is None:
            session_id = generate_session_id()
        elif not check_session_id_signature(session_id):
            log.error("Session id had invalid signature: %r", session_id)
            raise HTTPError(status_code=403, reason="Invalid session ID")

        session = self.application_context.create_session_if_needed(session_id)

        websocket_url = self.application.websocket_url_for_request(self.request, self.bokeh_websocket_path)
        page = server_html_page_for_session(
            session_id,
            self.application.resources(self.request),
            title=session.document.title,
            websocket_url=websocket_url,
        )

        self.set_header("Content-Type", "text/html")
        self.write(page)