Holds everything together.

Instantiated once per running application, it holds a reference to every high-level object whose reference needs to be held: Results, Directories, core.gui instances, etc..

It also hosts high level methods and acts as a coordinator for all those elements. This is why some of its methods seem a bit shallow, like for example mark_all() and remove_duplicates(). These methos are just proxies for a method in results, but they are also followed by a notification call which is very important if we want GUI elements to be correctly notified of a change in the data they’re presenting.


Instance of Directories. It holds the current folder selection.


Instance of core.results.Results. Holds the results of the latest scan.


List of currently selected dupes from our results. Whenever the user changes its selection at the UI level, result_table takes care of updating this attribute, so you can trust that it’s always up-to-date.


Instance of meta-gui table listing the results from results


Adds folder d to directories.

Shows an error message dialog if something bad happens.

Parameters:d (str) – path of folder to add

Adds selected_dupes to ignore_list.


Apply a filter filter to the results so that it shows only dupe groups that match it.

Parameters:filter (str) – filter to apply

Start an async move (or copy) job on marked duplicates.

Parameters:copy (bool) – If True, duplicates will be copied instead of moved

Start an async job to send marked duplicates to the trash.


Export current results to CSV.

The columns and their order in the resulting CSV file is determined in the same way as in export_to_xhtml().


Export current results to XHTML.

The configuration of the result_table (columns order and visibility) is used to determine how the data is presented in the export. In other words, the exported table in the resulting XHTML will look just like the results table.


Calls command in CustomCommand pref with %d and %r placeholders replaced.

Using the current selection, %d is replaced with the currently selected dupe and %r is replaced with that dupe’s ref file. If there’s no selection, the command is not invoked. If the dupe is a ref, %d and %r will be the same.


Load directory selection and ignore list from files in appdata.

This method is called during startup so that directory selection and ignore list, which is persistent data, is the same as when the last session was closed (when save() was called).


Start an async job to load results from filename.

Parameters:filename (str) – path of the XML file (created with save_as()) to load

Promote selected_dupes to reference position within their respective groups.

Each selected dupe will become the ref of its group. If there’s more than one dupe selected for the same group, only the first (in the order currently shown in result_table) dupe will be promoted.


Set all dupes in the results as marked.

mark_dupe(dupe, marked)

Change marked status of dupe.

  • dupe (File) – dupe to mark/unmark
  • marked (bool) – True = mark, False = unmark

Invert the marked state of all dupes in the results.


Set all dupes in the results as unmarked.


Open selected_dupes with their associated application.


Remove files that don’t exist from ignore_list.


Remove root directories at indexes from directories.

Parameters:indexes (list of int) – Indexes of the directories to remove.

Remove duplicates from results.

Calls remove_duplicates() and send appropriate notifications.

Parameters:duplicates (list of File) – duplicates to remove.

Removed marked duplicates from the results (without touching the files themselves).


Removed selected_dupes from the results (without touching the files themselves).


Renames the selected dupes’s file to newname.

If there’s more than one selected dupes, the first one is used.

Parameters:newname (str) – The filename to rename the dupe’s file to.

Sort dupes in each group (in results) according to sort_key.

Called by the re-prioritize dialog. Calls prioritize() and, once the sorting is done, show a message that confirms the action.

Parameters:sort_key (f(dupe)) – The key being sent to prioritize()

Save results in filename.

Parameters:filename (str) – path of the file to save results (as XML) to.

Starts an async job to scan for duplicates.

Scans folders selected in directories and put the results in results


Returns dupes with all reference elements removed.