Skip to content

Commit 2aa6353

Browse files
committed
GUI: Remove monkeypatching
1 parent 71bc4fc commit 2aa6353

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

npbackup/gui/config.py

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,37 +41,13 @@
4141
from npbackup.task import create_scheduled_task
4242
from npbackup.gui.helpers import quick_close_simplegui_window
4343
from npbackup.gui.constants import combo_boxes, byte_units
44+
45+
# import npbackup.gui.freesimplegui_extensions
4446
import sv_ttk
4547

4648
logger = getLogger()
4749

4850

49-
# Monkeypatching SimpleGUI
50-
# @SimpleGUI: Why is there no delete method for TreeData ?
51-
def delete(self, key):
52-
if key == "":
53-
return False
54-
try:
55-
node = self.tree_dict[key]
56-
key_list = [
57-
key,
58-
]
59-
parent_node = self.tree_dict[node.parent]
60-
parent_node.children.remove(node)
61-
while key_list != []:
62-
temp = []
63-
for item in key_list:
64-
temp += self.tree_dict[item].children
65-
del self.tree_dict[item]
66-
key_list = temp
67-
return True
68-
except KeyError:
69-
return False
70-
71-
72-
sg.TreeData.delete = delete
73-
74-
7551
ENCRYPTED_DATA_PLACEHOLDER = "<{}>".format(_t("config_gui.encrypted_data"))
7652

7753

0 commit comments

Comments
 (0)