jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/835642 )

Change subject: [cleanup] remove userinterfaces.gui.ListBoxWindow
......................................................................

[cleanup] remove userinterfaces.gui.ListBoxWindow

remove ListBoxWindow which was introduced in compat 2004 but was neither
used anywhere in the framework nor is it documented how to use it.
After creating the listbox window the only choices is to close the window
by clicking ok. There is no method tho get an element of the numbered list.

Change-Id: Ief1a3172bdacbb4c45a66d834ce31247d3a64a82
---
M pywikibot/userinterfaces/gui.py
1 file changed, 0 insertions(+), 54 deletions(-)

Approvals:
  JJMC89: Looks good to me, but someone else must approve
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/userinterfaces/gui.py b/pywikibot/userinterfaces/gui.py
index 1e29c12..0f37515 100644
--- a/pywikibot/userinterfaces/gui.py
+++ b/pywikibot/userinterfaces/gui.py
@@ -429,60 +429,6 @@
         return 'break'


-# the following class isn't used anywhere in the framework: ####
-class ListBoxWindow:
-
-    """List box window."""
-
-    # called when user pushes the OK button.
-    # closes the window.
-    def pressedOK(self) -> None:
-        """
-        Perform OK operation.
-
-        Closes listbox.
-        """
-        self.parent.destroy()
-
-    def __init__(self, parent=None) -> None:
-        """Initializer."""
-        if parent is None:
-            # create a new window
-            parent = tkinter.Tk()
-        self.parent = parent
-
-        # selectable: only one item
-        self.listbox = tkinter.Listbox(parent, selectmode=tkinter.SINGLE)
-        # put list into main frame, using all available space
-        self.listbox.pack(anchor=tkinter.CENTER, fill=tkinter.BOTH)
-
-        # lower subframe which will contain one button
-        self.bottom_frame = tkinter.Frame(parent)
-        self.bottom_frame.pack(side=tkinter.BOTTOM)
-
-        buttonOK = tkinter.Button(self.bottom_frame, text='OK',
-                                  command=self.pressedOK)
-        buttonOK.pack(side=tkinter.LEFT, fill=tkinter.X)
-        # idea: set title to cur_disambiguation
-
-    def list(self, list):
-        """Put list of alternatives into listbox."""
-        self.list = list
-        # find required area
-        laenge = len(list)
-        maxbreite = 0
-        for i in range(laenge):
-            # cycle through all listitems to find maxlength
-            if len(list[i]) + len(str(i)) > maxbreite:
-                maxbreite = len(list[i]) + len(str(i))
-            # show list as formerly in DOS-window
-            self.listbox.insert(tkinter.END, str(i) + ' - ' + list[i])
-        # set optimized height & width
-        self.listbox.config(height=laenge, width=maxbreite + 2)
-        # wait for user to push a button which will destroy (close) the window
-        return self.list
-
-
 class Tkdialog:

     """The dialog window for image info."""

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/835642
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ief1a3172bdacbb4c45a66d834ce31247d3a64a82
Gerrit-Change-Number: 835642
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: JJMC89 <jjmc89.wikime...@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.w...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org
To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org

Reply via email to