class_docstr: View / controller for the preferences that get displayed in the main window
  
      
class_docstr_tok: ["View","\/","controller","for","the","preferences","that","get","displayed","in","the","main","window"]
docstr: Return True if preferences are OK (e.g., directories exist)
code: def check_preferences(self):
      """Return True if preferences are OK (e.g., directories exist)"""
      path = self.__image_edit_box.GetValue()
      if not os.path.isdir(path):
          if (
              wx.MessageBox(
                  (
                      'The Default Input Folder is "%s", but '
                      "the directory does not exist. Do you want to "
                      "create it?"
                  )
                  % path,
                  "Warning, cannot run pipeline",
                  style=wx.YES_NO,
              )
              == wx.NO
          ):
              return False, "Image directory does not exist"
          os.makedirs(path)
          set_default_image_directory(path)
      path = self.__output_edit_box.GetValue()
      if not os.path.isdir(path):
          if (
              wx.MessageBox(
                  (
                      'The Default Output Folder is "%s", but '
                      "the directory does not exist. Do you want to "
                      "create it?"
                  )
                  % path,
                  "Warning, cannot run pipeline",
                  style=wx.YES_NO,
              )
              == wx.NO
          ):
              return False, "Output directory does not exist"
          os.makedirs(path)
          set_default_output_directory(path)
      return True, "OK"
  
imports: import os
  import wx
  from cellprofiler_core.analysis import use_analysis
  from cellprofiler_core.preferences import DEFAULT_IMAGE_DIRECTORY
  from cellprofiler_core.preferences import DEFAULT_IMAGE_FOLDER_HELP
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_DIRECTORY
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_FOLDER_HELP
  from cellprofiler_core.preferences import add_image_directory_listener
  from cellprofiler_core.preferences import add_output_directory_listener
  from cellprofiler_core.preferences import add_progress_callback
  from cellprofiler_core.preferences import fire_image_directory_changed_event
  from cellprofiler_core.preferences import get_default_image_directory
  from cellprofiler_core.preferences import get_default_output_directory
  from cellprofiler_core.preferences import get_recent_files
  from cellprofiler_core.preferences import remove_image_directory_listener
  from cellprofiler_core.preferences import remove_output_directory_listener
  from cellprofiler_core.preferences import set_default_image_directory
  from cellprofiler_core.preferences import set_default_output_directory
  from cellprofiler_core.preferences import set_pixel_size
  from ._progress_watcher import ProgressWatcher
  from ..constants.preferences_view import WELCOME_MESSAGE
  from ..html.utils import rst_to_html_fragment
  from ..htmldialog import HTMLDialog
  from ..utilities.preferences_view import secs_to_timestr
label_desc: Use image node_id 11 for calling the PreferencesView obj's underlying member method code with example usage: obj.check_preferences() and returns: True,  str, False,  str, False,  str