class_docstr: A setting that displays a filesystem path name
      
class_docstr_tok: ["A","setting","that","displays","a","filesystem","path","name"]
docstr: Figure out how to set up dir_choice and custom path given a path
docstr_tok: ["Figure","out","how","to","set","up","dir_choice","and","custom","path","given","a","path"]
code: def get_parts_from_path(self, path):
      """Figure out how to set up dir_choice and custom path given a path"""
      path = os.path.abspath(path)
      custom_path = self.custom_path
      img_dir = get_default_image_directory()
      out_dir = get_default_output_directory()
      if sys.platform.startswith("win"):
          # set to lower-case for comparisons
          cmp_path = path.lower()
          img_dir = img_dir.lower()
          out_dir = out_dir.lower()
      else:
          cmp_path = path
      seps = [os.path.sep]
      if hasattr(os, "altsep"):
          seps += [os.altsep]
      if cmp_path == img_dir:
          dir_choice = DEFAULT_INPUT_FOLDER_NAME
      elif cmp_path == out_dir:
          dir_choice = DEFAULT_OUTPUT_FOLDER_NAME
      elif (
          cmp_path.startswith(img_dir)
          and cmp_path[len(img_dir)] in seps
      ):
          dir_choice = DEFAULT_INPUT_SUBFOLDER_NAME
          custom_path = path[len(img_dir) + 1 :]
      elif (
          cmp_path.startswith(out_dir)
          and cmp_path[len(out_dir)] in seps
      ):
          dir_choice = DEFAULT_OUTPUT_SUBFOLDER_NAME
          custom_path = path[len(out_dir) + 1 :]
      else:
          dir_choice = ABSOLUTE_FOLDER_NAME
          custom_path = path
      return dir_choice, custom_path
  
imports: import os
  import sys
  from ._text import Text
  from .._validation_error import ValidationError
  from ...preferences import ABSOLUTE_FOLDER_NAME
  from ...preferences import DEFAULT_INPUT_FOLDER_NAME
  from ...preferences import DEFAULT_INPUT_SUBFOLDER_NAME
  from ...preferences import DEFAULT_OUTPUT_FOLDER_NAME
  from ...preferences import DEFAULT_OUTPUT_SUBFOLDER_NAME
  from ...preferences import NO_FOLDER_NAME
  from ...preferences import URL_FOLDER_NAME
  from ...preferences import get_default_image_directory
  from ...preferences import get_default_output_directory
  from ...preferences import standardize_default_folder_names
label_desc: Use image node_id 15 for calling the Directory obj's underlying member method code with example usage: obj.get_parts_from_path(path) and returns: dir_choice,  custom_path