Exemplo n.º 1
0
def _writeToFile(out_model_dict, model_directory, parent):

    fname = QFileDialog.getSaveFileName(parent, "Save to file", model_directory)[0]

    if len(fname) > 0:
        # enforce correct suffix.
        if not fname.endswith(".yaml"):
            fname += ".yaml"

        f = open(fname, "w")
        yaml.dump(out_model_dict, f, default_flow_style=False)
        f.close()
Exemplo n.º 2
0
def _writeToFile(out_model_dict, model_directory, parent):

    fname = QFileDialog.getSaveFileName(parent, 'Save to file', model_directory)[0]

    if len(fname) > 0:
        # enforce correct suffix.
        if not fname.endswith(".yaml"):
            fname += ".yaml"

        f = open(fname, "w")
        yaml.dump(out_model_dict, f,default_flow_style=False)
        f.close()
Exemplo n.º 3
0
def _writeToFile(expression_string, model_directory, parent, header):

    fname = QFileDialog.getSaveFileName(parent, 'Export to .py file', model_directory)[0]

    if len(fname) > 0:
        # enforce correct suffix.
        if not fname.endswith(".py"):
            fname += ".py"

        f = open(fname, 'w')

        f.write(header)
        f.write(expression_string)
        f.close()
Exemplo n.º 4
0
def _writeToFile(expression_string, model_directory, parent, header):

    fname = QFileDialog.getSaveFileName(parent, 'Export to .py file',
                                        model_directory)[0]

    if len(fname) > 0:
        # enforce correct suffix.
        if not fname.endswith(".py"):
            fname += ".py"

        f = open(fname, 'w')

        f.write(header)
        f.write(expression_string)
        f.close()