          logger.debug("Initializing %s: (arguments: '%s'", self.__class__.__name__, arguments)
          super().__init__()
          self._config_tools = ConfigTools()
          self._lock = Lock()
  
          self._tk_vars: Dict[Literal["refresh", "busy"],
                              tk.BooleanVar] = dict(refresh=tk.BooleanVar(), busy=tk.BooleanVar())
          for val in self._tk_vars.values():
              val.set(False)
          self._display = FacesDisplay(256, 64, self._tk_vars)
  
          trigger_patch = Event()
          self._samples = Samples(arguments, 5, self._display, self._lock, trigger_patch)
          self._patch = Patch(arguments,
                              self._available_masks,
                              self._samples,
                              self._display,
                              self._lock,
                              trigger_patch,
                              self._config_tools,
                              self._tk_vars)
  
          self._initialize_tkinter()
          self._image_canvas: Optional[ImagesCanvas] = None
          self._opts_book: Optional[OptionsBook] = None
          self._cli_frame: Optional[ActionFrame] = None  # cli frame holds cli options
 
</s> remove     def _available_masks(self) -> List[str]:
        """ list: The mask names that are available for every face in the alignments file """
        retval = [key
                  for key, val in self._samples.alignments.mask_summary.items()
                  if val == self._samples.alignments.faces_count]
        return retval
 </s> add     def config_tools(self) -> "ConfigTools":
        """ :class:`ConfigTools`: The object responsible for parsing configuration options and
        updating to/from the GUI """
        return self._config_tools

    @property
    def dispatcher(self) -> "Dispatcher":
        """ :class:`Dispatcher`: The object responsible for triggering events and variables and
        handling global GUI state """
        return self._dispatcher

    @property
    def display(self) -> FacesDisplay:
        """ :class:`~tools.preview.viewer.FacesDisplay`: The object that holds the sample,
        converted and patched faces """
        return self._display

    @property
    def lock(self) -> Lock:
        """ :class:`threading.Lock`: The threading lock object for the Preview GUI """
        return self._lock

    @property
    def progress_bar(self) -> "BusyProgressBar":
        """ :class:`~tools.preview.control_panels.BusyProgressBar`: The progress bar that indicates
        a swap/patch thread is running """
        assert self._cli_frame is not None
        return self._cli_frame.busy_progress_bar

    def update_display(self):
        """ Update the images in the canvas and redraw """
        if not hasattr(self, "_image_canvas"):  # On first call object not yet created
            return
        assert self._image_canvas is not None
        self._image_canvas.reload() </s> remove     def __init__(self,
                 arguments: "Namespace",
                 available_masks: List[str],
                 samples: Samples,
                 display: "FacesDisplay",
                 lock: Lock,
                 trigger: Event,
                 config_tools: "ConfigTools",
                 tk_vars: Dict[Literal["refresh", "busy"], tk.BooleanVar]) -> None:
        logger.debug("Initializing %s: (arguments: '%s', available_masks: %s, samples: %s, "
                     "display: %s, lock: %s, trigger: %s, config_tools: %s, tk_vars %s)",
                     self.__class__.__name__, arguments, available_masks, samples, display, lock,
                     trigger, config_tools, tk_vars)
        self._samples = samples
 </s> add     def __init__(self, app: Preview, arguments: "Namespace") -> None:
        logger.debug("Initializing %s: (app: %s, arguments: '%s')",
                     self.__class__.__name__, app, arguments)
        self._app = app </s> remove         self._display = display
        self._lock = lock
        self._trigger_patch = trigger_patch
 </s> add         self._app = app </s> remove         self._display = display
        self._lock = lock
        self._trigger = trigger
        self.current_config = config_tools.config
 </s> add  </s> remove     def __init__(self,
                 arguments: "Namespace",
                 sample_size: int,
                 display: "FacesDisplay",
                 lock: Lock,
                 trigger_patch: Event) -> None:
        logger.debug("Initializing %s: (arguments: '%s', sample_size: %s, display: %s, lock: %s, "
                     "trigger_patch: %s)", self.__class__.__name__, arguments, sample_size,
                     display, lock, trigger_patch)
 </s> add     def __init__(self, app: Preview, arguments: "Namespace", sample_size: int) -> None:
        logger.debug("Initializing %s: (app: %s, arguments: '%s', sample_size: %s)",
                     self.__class__.__name__, app, arguments, sample_size)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
          logger.debug("Initializing %s: (arguments: '%s'", self.__class__.__name__, arguments)
          super().__init__()
          self._config_tools = ConfigTools()
          self._lock = Lock()
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
        self._dispatcher = Dispatcher(self)
        self._display = FacesDisplay(self, 256, 64)
        self._samples = Samples(self, arguments, 5)
        self._patch = Patch(self, arguments)
  
          self._initialize_tkinter()
          self._image_canvas: Optional[ImagesCanvas] = None
          self._opts_book: Optional[OptionsBook] = None
          self._cli_frame: Optional[ActionFrame] = None  # cli frame holds cli options
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 bugfix:
    - preview tool - Prevent tkinter variables from exiting main thread
refactor:
    - preview tool - Split module to smaller sub-modules + docs, locales
Typing:
    - tools.preview.cli
Unit test:
    - tools.preview.viewer 
tools/preview/preview.py