Beispiel #1
0
 def export_as_template(self):
     self.gui_controller.ask_properties_advanced()
     path = self.gui_controller.ask_export_as_template_path()
     if path:
         self.exercise.set_template(True)
         save_exercise(self.exercise, path)
         self.exercise.set_template(False)
Beispiel #2
0
 def export_as_template(self):
     self.gui_controller.ask_properties_advanced()
     path = self.gui_controller.ask_export_as_template_path()
     if path:
         self.exercise.set_template(True)
         save_exercise(self.exercise, path)
         self.exercise.set_template(False)
Beispiel #3
0
    def save(self, saveAs=False):
        if not self.exercise:
            self.logger.error("Save called but no exercise load")
            return

        if saveAs or self.exercise.get_output_save_path() == None:
            outputSavePath = self.gui_controller.ask_save_path()
            if not outputSavePath:
                return
            self.exercise.set_output_save_path(outputSavePath + ".perroquet")

        save_exercise(self.exercise, self.exercise.get_output_save_path())

        self.config.set("lastopenfile", self.exercise.get_output_save_path())

        #lastopenfileS
        l = self.config.get("lastopenfiles")
        path = self.exercise.get_output_save_path()
        name = self.exercise.get_name() or path
        self.config.set("lastopenfiles", [[path, name]] + [p for p in l if p[0] != path][:10])

        self.set_can_save(False)
Beispiel #4
0
    def save(self, saveAs=False):
        if not self.exercise:
            self.logger.error("Save called but no exercise load")
            return

        if saveAs or self.exercise.get_output_save_path() == None:
            outputSavePath = self.gui_controller.ask_save_path()
            if not outputSavePath:
                return
            self.exercise.set_output_save_path(outputSavePath + ".perroquet")

        save_exercise(self.exercise, self.exercise.get_output_save_path())

        self.config.set("lastopenfile", self.exercise.get_output_save_path())

        #lastopenfileS
        l = self.config.get("lastopenfiles")
        path = self.exercise.get_output_save_path()
        name = self.exercise.get_name() or path
        self.config.set("lastopenfiles",
                        [[path, name]] + [p for p in l if p[0] != path][:10])

        self.set_can_save(False)