def export_db():
    location = gui.filesavebox(msg=ms["choose_save_location"], title=ms["save"],
                               default=cf.get("home_dir") + os.sep + 'db' + EXTENSION, filetypes=["*" + EXTENSION])
    cf.set("home_dir", os.path.abspath(os.path.dirname(location)))
    if location is not None and not location.endswith(EXTENSION):
        location += EXTENSION
    patients = JsonLoader.get_all_patients()
    excel_builder = excel.ExcelBuilder(patients, file_name=location)
    excel_builder.write_patients()
 def toggle_visible_angles(self):
     self.workspace.show_chin_angles = self.show_chin_angles_ui.get()
     self.workspace.show_interocular_angles = self.show_interocular_angles_ui.get(
     )
     self.workspace.show_malar_angles = self.show_malar_angles_ui.get()
     self.workspace.toggle_chin_angles()
     self.workspace.toggle_interocular_angles()
     self.workspace.toggle_malar_angles()
     cf.set("show_chin_angles", self.workspace.show_chin_angles)
     cf.set("show_interocular_angles",
            self.workspace.show_interocular_angles)
     cf.set("show_malar_angles", self.workspace.show_malar_angles)
def saveImagePathAsHome(patient):
    file = os.path.abspath(patient.photo)
    cf.set("home_file", file)
    if not cf.isIn("home_dir") or not os.path.isdir(cf.get("home_dir")):
        directory = os.path.abspath(os.path.dirname(file)) + os.sep
        cf.set("home_dir", directory)