Issue 25031: IDLE - file list improvements (original) (raw)

This is a placeholder for what will be a series of patches to the FileList to generalize and enhance it.

This is part of generalizing pieces of IDLE to be more flexible, including things like editors not necessarily being in toplevel windows, dialogs not being modal, etc.

The goal is to turn the FileList into an application "hub" that knows about the various pieces of the application, and can be used for communication between them. Some aspects of this will include:

  1. Ensuring other modules don't use internal implementation (e.g. dict/inversedict) so can change it later.

  2. Merging PyShellFileList into here (will keep things simpler).

  3. Having FileList launch/keep track of certain dialogs (e.g. config) or other non-editor components.

  4. Eventually take on some other responsibilities from editors, part of a general component/container refactoring.

This first patch is a straight refactoring so that other modules do not touch the FileList internals.

This is done in two steps. First, we remove references to inversedict etc. from outside FileList.

Second, we run all notifications through FileList. So for example when the config dialog wants to notify all editors of changes, it previously walked through the list of windows and called various editor methods directly. Now, the config dialog asks FileList to notify all editors. Each editor implements the callback to make the needed changes.

Same code, just moved to a more appropriate place. The config dialog no longer needs any knowledge of FileList or of EditorWindow. Later more of these sorts of callbacks will be added. Doing it this way provides a framework where different components might respond differently to these notifications.