def getPersistenceFilePath(self):
     if not IJ.isMacintosh() and not IJ.isLinux():
         # windows
         settings_path = os.path.join(os.getenv('APPDATA'),
                                      self.settings_file_name)
     else:
         settings_path = os.path.join(os.path.expanduser("~"), "Library",
                                      self.settings_file_name)
     return settings_path
Esempio n. 2
0
 def get_peristence_file_location(self):
     """get platform-dependent location in which to save persistence data"""
     try:
         if IJ.isWindows():
             # windows
             temp_path = os.path.join(os.getenv('APPDATA'),
                                      Parameters._persist_parameters_folder)
         elif IJ.isMacintosh():
             # mac
             temp_path = os.path.join(os.path.expanduser("~"), "Library",
                                      Parameters._persist_parameters_folder)
         else:
             print(
                 "currently only configured for Mac or Windows - this should be an easy fix for anyone running under Linux..."
             )
             raise NotImplementedError
         if not os.path.isdir(temp_path):
             os.mkdir(temp_path)
     except Exception as e:
         print("Error: " + e.message)
         return ""
     return temp_path