Code Duplication    Length = 21-22 lines in 2 locations

dtb/gui.py 2 locations

@@ 145-166 (lines=22) @@
142
            ttk.Button(frame, text="Download Selected", command=self.do_download).grid(row=1, column=2, sticky=tk.SE, ipadx=5, **kw_gp)
143
            return frame
144
145
        def frame_outgoing(master):
146
            """Frame for outgoing songs."""
147
            frame = ttk.Frame(master, **kw_f)
148
149
            # Configure grid
150
            frame.rowconfigure(0, weight=1)
151
            frame.rowconfigure(1, weight=0)
152
            frame.columnconfigure(0, weight=0)
153
            frame.columnconfigure(1, weight=1)
154
            frame.columnconfigure(2, weight=1)
155
156
            # Place widgets
157
            self.listbox_outgoing = tk.Listbox(frame, selectmode=tk.EXTENDED if mac else tk.MULTIPLE)
158
            self.listbox_outgoing.grid(row=0, column=0, columnspan=3, **kw_gsp)
159
            scroll_outgoing = ttk.Scrollbar(frame, orient=tk.VERTICAL, command=self.listbox_outgoing.yview)
160
            self.listbox_outgoing.configure(yscrollcommand=scroll_outgoing.set)
161
            scroll_outgoing.grid(row=0, column=2, sticky=(tk.N, tk.E, tk.S))
162
            ttk.Button(frame, text="\u21BB", width=0, command=self.update).grid(row=1, column=0, sticky=tk.SW, ipadx=5, **kw_gp)
163
            ttk.Button(frame, text="Remove Selected", command=self.do_remove).grid(row=1, column=1, sticky=tk.SW, ipadx=5, **kw_gp)
164
            ttk.Button(frame, text="Share Songs...", command=self.do_share).grid(row=1, column=2, sticky=tk.SE, ipadx=5, **kw_gp)
165
166
            return frame
167
168
        def separator(master):
169
            """Widget to separate frames."""
@@ 123-143 (lines=21) @@
120
121
            return frame
122
123
        def frame_incoming(master):
124
            """Frame for incoming songs."""
125
            frame = ttk.Frame(master, **kw_f)
126
127
            # Configure grid
128
            frame.rowconfigure(0, weight=1)
129
            frame.rowconfigure(1, weight=0)
130
            frame.columnconfigure(0, weight=0)
131
            frame.columnconfigure(1, weight=1)
132
            frame.columnconfigure(2, weight=1)
133
134
            # Place widgets
135
            self.listbox_incoming = tk.Listbox(frame, selectmode=tk.EXTENDED if mac else tk.MULTIPLE)
136
            self.listbox_incoming.grid(row=0, column=0, columnspan=3, **kw_gsp)
137
            scroll_incoming = ttk.Scrollbar(frame, orient=tk.VERTICAL, command=self.listbox_incoming.yview)
138
            self.listbox_incoming.configure(yscrollcommand=scroll_incoming.set)
139
            scroll_incoming.grid(row=0, column=2, sticky=(tk.N, tk.E, tk.S))
140
            ttk.Button(frame, text="\u21BB", width=0, command=self.update).grid(row=1, column=0, sticky=tk.SW, ipadx=5, **kw_gp)
141
            ttk.Button(frame, text="Ignore Selected", command=self.do_ignore).grid(row=1, column=1, sticky=tk.SW, ipadx=5, **kw_gp)
142
            ttk.Button(frame, text="Download Selected", command=self.do_download).grid(row=1, column=2, sticky=tk.SE, ipadx=5, **kw_gp)
143
            return frame
144
145
        def frame_outgoing(master):
146
            """Frame for outgoing songs."""