# Path: meld/ui/util.py
# def map_widgets_into_lists(widget, widgetnames):
#     """Put sequentially numbered widgets into lists.
# 
#     Given an object with widgets self.button0, self.button1, ...,
#     after a call to object.map_widgets_into_lists(["button"])
#     object.button == [self.button0, self.button1, ...]
#     """
#     for item in widgetnames:
#         i, lst = 0, []
#         while 1:
#             key = "%s%i" % (item, i)
#             try:
#                 val = getattr(widget, key)
#             except AttributeError:
#                 if i == 0:
#                     log.critical(
#                         f"Tried to map missing attribute {key}")
#                 break
#             lst.append(val)
#             i += 1
#         setattr(widget, item, lst)


import enum
from gi.repository import Gio, GLib, GObject, Gtk
from meld.conf import _
from meld.melddoc import LabeledObjectMixin, MeldDoc
from meld.recent import recent_comparisons
from meld.ui.util import map_widgets_into_lists

    __gtype_name__ = "NewDiffTab"

    __gsignals__ = {
        'diff-created': (GObject.SignalFlags.RUN_FIRST, None, (object,)),
    }

    close_signal = MeldDoc.close_signal
    label_changed_signal = LabeledObjectMixin.label_changed

    label_text = _("New comparison")

    button_compare = Gtk.Template.Child()
    button_new_blank = Gtk.Template.Child()
    button_type_dir = Gtk.Template.Child()
    button_type_file = Gtk.Template.Child()
    button_type_vc = Gtk.Template.Child()
    choosers_notebook = Gtk.Template.Child()
    dir_chooser0 = Gtk.Template.Child()
    dir_chooser1 = Gtk.Template.Child()
    dir_chooser2 = Gtk.Template.Child()
    dir_three_way_checkbutton = Gtk.Template.Child()
    file_chooser0 = Gtk.Template.Child()
    file_chooser1 = Gtk.Template.Child()
    file_chooser2 = Gtk.Template.Child()
    file_three_way_checkbutton = Gtk.Template.Child()
    vc_chooser0 = Gtk.Template.Child()

    def __init__(self, parentapp):
        super().__init__()

# Path: meld/ui/util.py
# def map_widgets_into_lists(widget, widgetnames):
#     """Put sequentially numbered widgets into lists.
# 
#     Given an object with widgets self.button0, self.button1, ...,
#     after a call to object.map_widgets_into_lists(["button"])
#     object.button == [self.button0, self.button1, ...]
#     """
#     for item in widgetnames:
#         i, lst = 0, []
#         while 1:
#             key = "%s%i" % (item, i)
#             try:
#                 val = getattr(widget, key)
#             except AttributeError:
#                 if i == 0:
#                     log.critical(
#                         f"Tried to map missing attribute {key}")
#                 break
#             lst.append(val)
#             i += 1
#         setattr(widget, item, lst)


# Path: meld/newdifftab.py
import enum
from gi.repository import Gio, GLib, GObject, Gtk
from meld.conf import _
from meld.melddoc import LabeledObjectMixin, MeldDoc
from meld.recent import recent_comparisons
from meld.ui.util import map_widgets_into_lists


    __gtype_name__ = "NewDiffTab"

    __gsignals__ = {
        'diff-created': (GObject.SignalFlags.RUN_FIRST, None, (object,)),
    }

    close_signal = MeldDoc.close_signal
    label_changed_signal = LabeledObjectMixin.label_changed

    label_text = _("New comparison")

    button_compare = Gtk.Template.Child()
    button_new_blank = Gtk.Template.Child()
    button_type_dir = Gtk.Template.Child()
    button_type_file = Gtk.Template.Child()
    button_type_vc = Gtk.Template.Child()
    choosers_notebook = Gtk.Template.Child()
    dir_chooser0 = Gtk.Template.Child()
    dir_chooser1 = Gtk.Template.Child()
    dir_chooser2 = Gtk.Template.Child()
    dir_three_way_checkbutton = Gtk.Template.Child()
    file_chooser0 = Gtk.Template.Child()
    file_chooser1 = Gtk.Template.Child()
    file_chooser2 = Gtk.Template.Child()
    file_three_way_checkbutton = Gtk.Template.Child()
    vc_chooser0 = Gtk.Template.Child()

    def __init__(self, parentapp):
        super().__init__()

        map_widgets_into_lists(