Exemplo n.º 1
0
    def make_export(self):
        """Generates an export file.
        """
        log.debug("running viewdata.make_export")

        params = request.params.copy()
        if not "figure-style" in params:
            params["figure-style"] = "viewdata"

        result = viewdataExport.make_export(
            params, request.application_url, self.configuration["AnimationOptions"], self._get_session_endpoint_data()
        )
        if result.success:
            return {"success": True, "url": request.application_url + "/viewdata/download?file=" + result.fileName}
        else:
            return {"success": False, "errorMessage": result.errorMessage}
Exemplo n.º 2
0
    def get_export(self):
        """Generates and returns an export file.
        """
        log.debug("running viewdata.get_export")

        params = request.params.copy()
        if not "figure-style" in params:
            params["figure-style"] = "viewdata"

        result = viewdataExport.make_export(
            params, request.application_url, status["AnimationOptions"], self._get_session_endpoint_data()
        )
        if result.success:
            redirect(url(controller="viewdata", action="download", file=result.fileName))
        else:
            response.content_type = "text/plain"
            return result.errorMessage + "\n"