Ejemplo n.º 1
0
 def initialize(self, *, load_plug_ins=True, use_root_dir=True):
     super().initialize()
     # configure app data
     if load_plug_ins:
         logging.info("Launch time " + str(datetime.datetime.now()))
         logging.info("Python version " +
                      str(sys.version.replace('\n', '')))
         logging.info("User interface class " + type(self.ui).__name__ +
                      " / " + type(self.ui.proxy).__name__)
         logging.info("Qt version " + self.ui.get_qt_version())
         app_data_file_path = self.ui.get_configuration_location(
         ) / pathlib.Path("nionswift_appdata.json")
         ApplicationData.set_file_path(app_data_file_path)
         logging.info("Application data: " + str(app_data_file_path))
         PlugInManager.load_plug_ins(
             self,
             get_root_dir() if use_root_dir else None)
         color_maps_dir = self.ui.get_configuration_location(
         ) / pathlib.Path("Color Maps")
         if color_maps_dir.exists():
             logging.info("Loading color maps from " + str(color_maps_dir))
             ColorMaps.load_color_maps(color_maps_dir)
         else:
             logging.info("NOT Loading color maps from " +
                          str(color_maps_dir) + " (missing)")
Ejemplo n.º 2
0
 def initialize(self, *, load_plug_ins=True, use_root_dir=True):
     # configure the event loop object
     logger = logging.getLogger()
     old_level = logger.level
     logger.setLevel(logging.INFO)
     self.__event_loop = asyncio.new_event_loop()  # outputs a debugger message!
     logger.setLevel(old_level)
     # configure app data
     if load_plug_ins:
         logging.info("Python version " + str(sys.version.replace('\n', '')))
         logging.info("User interface class " + type(self.ui).__name__ + " / " + type(self.ui.proxy).__name__)
         app_data_file_path = self.ui.get_configuration_location() / pathlib.Path("nionswift_appdata.json")
         ApplicationData.set_file_path(app_data_file_path)
         logging.info("Application data: " + str(app_data_file_path))
         PlugInManager.load_plug_ins(self, get_root_dir() if use_root_dir else None)
         color_maps_dir = self.ui.get_configuration_location() / pathlib.Path("Color Maps")
         if color_maps_dir.exists():
             logging.info("Loading color maps from " + str(color_maps_dir))
             ColorMaps.load_color_maps(color_maps_dir)
         else:
             logging.info("NOT Loading color maps from " + str(color_maps_dir) + " (missing)")