Export the report in PDF format. Specify a path for which
        to save the file, including the trailing filename.
        
        :param str filename: path including filename
        :return: None
341227
def export_pdf(self, filename):
        
        self.make_request(
            raw_result=True,
            resource='export',
            filename=filename, 
            headers = {'accept': 'application/pdf'})
1154855
def file_upload_to(self, instance, filename):
        
        ext = filename.split(".")[-1]
        filename = "{}.{}".format(uuid.uuid4(), ext)
        return os.path.join("document", filename)
804569
def export(self, filename, exporter=None):
        
        filename = nativestring(filename)
        if exporter is None:
            ext = os.path.splitext(filename)[1]
            exporter = self.exporter(ext)
        
        if exporter:
            return exporter.exportTree(self, filename)
        else:
            return False
228000
def OnExportPDF(self, event):
        """"""

        wildcards = get_filetypes2wildcards(["pdf"]).values()

        if not wildcards:
            return

        wildcard = "|".join(wildcards)

        # Get filepath from user
        message = _("Choose file path for PDF export.")

        style = wx.SAVE
        filepath, filterindex = \
            self.interfaces.get_filepath_findex_from_user(wildcard, message,
                                                          style)

        if filepath is None:
            return

        self.main_window.actions.export_cairo(filepath, "pdf")

        event.Skip()
741683
def pdfdump(self, filename=None, **kargs):
        
        from scapy.config import conf
        from scapy.utils import get_temp_file, ContextManagerSubprocess
        canvas = self.canvas_dump(**kargs)
        if filename is None:
            fname = get_temp_file(autoext=kargs.get("suffix", ".pdf"))
            canvas.writePDFfile(fname)
            if WINDOWS and conf.prog.pdfreader is None:
                os.startfile(fname)
            else:
                with ContextManagerSubprocess("pdfdump()",
                                              conf.prog.pdfreader):
                    subprocess.Popen([conf.prog.pdfreader, fname])
        else:
            canvas.writePDFfile(filename)
        print()
1204319
def to_files(self, folderpath=None):
        
        if len(self.reports) == 0:
            self.warning(
                "No charts to save. Use stack to add charts for saving")
            return
        if folderpath is None:
            if self.report_path is None and "seaborn" \
                    not in self.report_engines:
                self.err("No folder path set for reports: please provide "
                         "one as argument or set ds.report_path")
                return
            folderpath = self.report_path
        else:
            if folderpath.startswith('/') or folderpath.startswith("."):
                pass
            else:
                folderpath = self.report_path + "/" + folderpath
        try:
            for report in self.reports:
                if "html" not in report:
                    self.err("No html for report " + report)
                    self.reports = self.report_engines = []
                    return
                if "seaborn_chart" in report:
                    if folderpath is None and self.static_path is None:
                        self.err("Please provide a folder path or set the "
                                 "static_path property")
                        return
                    self._save_seaborn_chart(report, self.static_path)
                else:
                    html = report["html"]
                    self._write_file(report["slug"], folderpath, html)
            self.reports = []
            self.report_engines = []
        except Exception as e:
            self.err(e, self.to_files, "Can not save reports to files")
            return
        self.ok("Data writen to files")
851282
def export(self, file_path=None, export_format=None):
        
        with io.open(file_path, mode='w', encoding="utf-8") as export_file:
            if export_format == 'yaml':
                import yaml
                yaml.safe_dump(self.to_dict(), export_file, default_flow_style=False)
            elif export_format == 'json':
                export_file.write(text_type(json.dumps(self.to_dict(), ensure_ascii=False)))
            return True
586268
def savecsv(self, filename):
        ''''''
        f = open(filename, mode='w')
        headers = ["Seq", "Frame", "Cmd", "P1", "P2", "P3", "P4", "X", "Y", "Z"]
        print(self.csv_line(headers))
        f.write(self.csv_line(headers) + "\n")
        for w in self.wploader.wpoints:
            if getattr(w, 'comment', None):
#                f.write("# %s\n" % w.comment)
                pass
            out_list = [ w.seq,
                         self.pretty_enum_value('MAV_FRAME', w.frame),
                         self.pretty_enum_value('MAV_CMD', w.command),
                         self.pretty_parameter_value(w.param1),
                         self.pretty_parameter_value(w.param2),
                         self.pretty_parameter_value(w.param3),
                         self.pretty_parameter_value(w.param4),
                         self.pretty_parameter_value(w.x),
                         self.pretty_parameter_value(w.y),
                         self.pretty_parameter_value(w.z),
                         ]
            print(self.csv_line(out_list))
            f.write(self.csv_line(out_list) + "\n")
        f.close()
120318
def save_hdf(self,filename,path=''):
        
        self.orbpop_long.save_hdf(filename,'{}/long'.format(path))
        self.orbpop_short.save_hdf(filename,'{}/short'.format(path))
607068
def export_path(self, relname, export_dir=None):
        
        # removing inner slashed to avoid creating intermediate directories
        name, ext = relname.replace('/', '-').rsplit('.', 1)
        newname = '%s_%s.%s' % (name, self.calc_id, ext)
        if export_dir is None:
            export_dir = self.export_dir
        return os.path.join(export_dir, newname)
832713
def save_file(self, filename, content):
        
        with open(filename, 'wb') as f:
            for chunk in content.iter_content(chunk_size=1024):
                if chunk:
                    f.write(chunk)
838863
def dump(self, filename):
        
        with open(filename, "w") as f:
            for name in sorted(self._fields):
                self._fields[name].dump(f, name)
84359
def dump(self, filename):
        
        f = open(filename, 'w')
        cPickle.dump(self, f)
286093
def save(self, filename):
        
        clibrebound.reb_output_binary(byref(self), c_char_p(filename.encode("ascii")))
1129974
def save(self, filename):
        ''' 
        '''
        with open(filename, 'w') as outfile:
            json.dump(self.to_json(), outfile)
425505
def export_file(file_path):
    """"""

    if not os.path.isfile(file_path):
        return error("Referenced file does not exist: '{}'.".format(file_path))

    return "export {}".format(file_path)
43434
def to_file(self, output_filename):
        ''''''
        temp_file = NamedTemporaryFile(mode="w", suffix=".md", delete=False)
        temp_file.write(self._content)
        temp_file.close()

        subprocess_arguments = [PANDOC_PATH, temp_file.name, '-o %s' % output_filename]
        subprocess_arguments.extend(self.arguments)
        cmd = " ".join(subprocess_arguments)

        fin = os.popen(cmd)
        msg = fin.read()
        fin.close()
        if msg:
            print("Pandoc message: {}",format(msg))

        os.remove(temp_file.name)

        if exists(output_filename):
            return output_filename
        else:
            raise IOError("Failed creating file: %s" % output_filename)