NagisaNao commited on
Commit
0693ae0
·
verified ·
1 Parent(s): 10cbe5d

update "auto-cleaner" to V3.6

Browse files
files_cells/notebooks/en/auto-cleaner_en.ipynb CHANGED
@@ -17,13 +17,21 @@
17
  {
18
  "cell_type": "code",
19
  "source": [
20
- "##~ AutoCleaner V3.5 CODE | BY: ANXETY ~##\n",
 
 
 
 
 
 
 
 
21
  "\n",
22
  "import os\n",
23
  "import time\n",
24
  "import ipywidgets as widgets\n",
25
  "from ipywidgets import Label, Button, VBox, HBox\n",
26
- "from IPython.display import display, HTML\n",
27
  "\n",
28
  "\n",
29
  "# ================= DETECT ENV =================\n",
@@ -90,7 +98,7 @@
90
  " position: absolute;\n",
91
  " top: 5px;\n",
92
  " right: 10px;\n",
93
- " content: \"AutoCleanerV3.5\";\n",
94
  " font-weight: bold;\n",
95
  " font-size: 24px;\n",
96
  " color: rgba(0, 0, 0, 0.2);\n",
@@ -109,7 +117,7 @@
109
  ".custom-select-multiple_AC select {\n",
110
  " padding: 10px;\n",
111
  " font-family: cursive;\n",
112
- " border: 1px solid #262626;\n",
113
  " border-radius: 10px;\n",
114
  " color: white;\n",
115
  " background-color: #1c1c1c;\n",
@@ -254,25 +262,35 @@
254
  " deleted_files = 0\n",
255
  " for root, dirs, files in os.walk(directory):\n",
256
  " for file in files:\n",
257
- " if not file.endswith((\".txt\", \".yaml\")):\n",
258
- " file_path = os.path.join(root, file)\n",
259
- " os.remove(file_path)\n",
260
- " deleted_files += 1\n",
261
- "\n",
262
  " return deleted_files\n",
263
  "\n",
264
  "\n",
265
  "def get_word_variant(n, variants):\n",
266
  " unit = abs(n) % 10\n",
267
  " tens = abs(n) % 100\n",
268
- "\n",
269
  " if tens in range(11, 15):\n",
270
  " return variants[2]\n",
271
  " elif unit == 1:\n",
272
  " return variants[0]\n",
273
  " elif unit in range(2, 5):\n",
274
  " return variants[1]\n",
275
- " return variants[2]\n",
 
 
 
 
 
 
 
 
 
 
 
 
276
  "\n",
277
  "\n",
278
  "def on_execute_button_press(button):\n",
@@ -290,10 +308,12 @@
290
  " message_widget = HTML(f'<p class=\"output_message_AC\">{message}</p>')\n",
291
  " display(message_widget)\n",
292
  "\n",
 
 
293
  "\n",
294
  "def on_clear_button_press(button):\n",
295
  " container.add_class(\"hide\")\n",
296
- " time.sleep(0.3)\n",
297
  " widgets.Widget.close_all()\n",
298
  "\n",
299
  "\n",
@@ -307,22 +327,18 @@
307
  " \"ControlNet Models\": [\"ControlNet Model\", \"ControlNet Models\", \"ControlNet Models\"]\n",
308
  " }\n",
309
  " deleted_word_variants = [\"Deleted\", \"Deleted\", \"Deleted\"]\n",
310
- "\n",
311
  " for key, value in deleted_files_dict.items():\n",
312
  " word_variant = word_variants.get(key, [\"\", \"\", \"\"])\n",
313
  " deleted_word = get_word_variant(value, deleted_word_variants)\n",
314
  " object_word = get_word_variant(value, word_variant)\n",
315
- "\n",
316
  " messages.append(f\"{deleted_word} {value} {object_word}\")\n",
317
- "\n",
318
  " return messages\n",
319
  "# ================ AutoCleaner function ================\n",
320
  "\n",
321
  "\n",
322
  "# --- storage memory ---\n",
323
  "import psutil\n",
324
- "directory = os.getcwd()\n",
325
- "disk_space = psutil.disk_usage(directory)\n",
326
  "total = disk_space.total / (1024 ** 3)\n",
327
  "used = disk_space.used / (1024 ** 3)\n",
328
  "free = disk_space.free / (1024 ** 3)\n",
@@ -333,7 +349,7 @@
333
  "instruction_label = widgets.HTML('''\n",
334
  "<span class=\"instruction_AC\">Use <span style=\"color: #B2B2B2;\">ctrl</span> or <span style=\"color: #B2B2B2;\">shift</span> for multiple selections.</span>\n",
335
  "''')\n",
336
- "auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='100%')).add_class(\"custom-select-multiple_AC\")\n",
337
  "output = widgets.Output().add_class(\"output_AC\")\n",
338
  "# ---\n",
339
  "execute_button = Button(description='Execute Cleaning').add_class(\"button_execute_AC\").add_class(\"button_AC\")\n",
 
17
  {
18
  "cell_type": "code",
19
  "source": [
20
+ "##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##\n",
21
+ "\n",
22
+ "# --change log--\n",
23
+ "\"\"\"\n",
24
+ "V3.6 | 13.03.24\n",
25
+ "Fixed selection window\n",
26
+ "Dynamic update of memory display\n",
27
+ "\"\"\"\n",
28
+ "\n",
29
  "\n",
30
  "import os\n",
31
  "import time\n",
32
  "import ipywidgets as widgets\n",
33
  "from ipywidgets import Label, Button, VBox, HBox\n",
34
+ "from IPython.display import display, HTML, Javascript\n",
35
  "\n",
36
  "\n",
37
  "# ================= DETECT ENV =================\n",
 
98
  " position: absolute;\n",
99
  " top: 5px;\n",
100
  " right: 10px;\n",
101
+ " content: \"AutoCleanerV3.6\";\n",
102
  " font-weight: bold;\n",
103
  " font-size: 24px;\n",
104
  " color: rgba(0, 0, 0, 0.2);\n",
 
117
  ".custom-select-multiple_AC select {\n",
118
  " padding: 10px;\n",
119
  " font-family: cursive;\n",
120
+ " border: 1px solid #262626 !important;\n",
121
  " border-radius: 10px;\n",
122
  " color: white;\n",
123
  " background-color: #1c1c1c;\n",
 
262
  " deleted_files = 0\n",
263
  " for root, dirs, files in os.walk(directory):\n",
264
  " for file in files:\n",
265
+ " if file.endswith((\".txt\", \".yaml\")):\n",
266
+ " continue\n",
267
+ " os.remove(os.path.join(root, file))\n",
268
+ " deleted_files += 1\n",
 
269
  " return deleted_files\n",
270
  "\n",
271
  "\n",
272
  "def get_word_variant(n, variants):\n",
273
  " unit = abs(n) % 10\n",
274
  " tens = abs(n) % 100\n",
 
275
  " if tens in range(11, 15):\n",
276
  " return variants[2]\n",
277
  " elif unit == 1:\n",
278
  " return variants[0]\n",
279
  " elif unit in range(2, 5):\n",
280
  " return variants[1]\n",
281
+ " else:\n",
282
+ " return variants[2]\n",
283
+ "\n",
284
+ "\n",
285
+ "def update_memory_info():\n",
286
+ " disk_space = psutil.disk_usage(os.getcwd())\n",
287
+ " total = disk_space.total / (1024 ** 3)\n",
288
+ " used = disk_space.used / (1024 ** 3)\n",
289
+ " free = disk_space.free / (1024 ** 3)\n",
290
+ "\n",
291
+ " storage_info.value = f'''\n",
292
+ " <div class=\"storage_info_AC\">Total storage: {total:.2f} GB <span style=\"color: #555\">|</span> Used: {used:.2f} GB <span style=\"color: #555\">|</span> Free: {free:.2f} GB</div>\n",
293
+ " '''\n",
294
  "\n",
295
  "\n",
296
  "def on_execute_button_press(button):\n",
 
308
  " message_widget = HTML(f'<p class=\"output_message_AC\">{message}</p>')\n",
309
  " display(message_widget)\n",
310
  "\n",
311
+ " update_memory_info()\n",
312
+ "\n",
313
  "\n",
314
  "def on_clear_button_press(button):\n",
315
  " container.add_class(\"hide\")\n",
316
+ " time.sleep(0.5)\n",
317
  " widgets.Widget.close_all()\n",
318
  "\n",
319
  "\n",
 
327
  " \"ControlNet Models\": [\"ControlNet Model\", \"ControlNet Models\", \"ControlNet Models\"]\n",
328
  " }\n",
329
  " deleted_word_variants = [\"Deleted\", \"Deleted\", \"Deleted\"]\n",
 
330
  " for key, value in deleted_files_dict.items():\n",
331
  " word_variant = word_variants.get(key, [\"\", \"\", \"\"])\n",
332
  " deleted_word = get_word_variant(value, deleted_word_variants)\n",
333
  " object_word = get_word_variant(value, word_variant)\n",
 
334
  " messages.append(f\"{deleted_word} {value} {object_word}\")\n",
 
335
  " return messages\n",
336
  "# ================ AutoCleaner function ================\n",
337
  "\n",
338
  "\n",
339
  "# --- storage memory ---\n",
340
  "import psutil\n",
341
+ "disk_space = psutil.disk_usage(os.getcwd())\n",
 
342
  "total = disk_space.total / (1024 ** 3)\n",
343
  "used = disk_space.used / (1024 ** 3)\n",
344
  "free = disk_space.free / (1024 ** 3)\n",
 
349
  "instruction_label = widgets.HTML('''\n",
350
  "<span class=\"instruction_AC\">Use <span style=\"color: #B2B2B2;\">ctrl</span> or <span style=\"color: #B2B2B2;\">shift</span> for multiple selections.</span>\n",
351
  "''')\n",
352
+ "auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='auto')).add_class(\"custom-select-multiple_AC\")\n",
353
  "output = widgets.Output().add_class(\"output_AC\")\n",
354
  "# ---\n",
355
  "execute_button = Button(description='Execute Cleaning').add_class(\"button_execute_AC\").add_class(\"button_AC\")\n",
files_cells/notebooks/ru/auto-cleaner_ru.ipynb CHANGED
@@ -11,953 +11,21 @@
11
  },
12
  "language_info": {
13
  "name": "python"
14
- },
15
- "widgets": {
16
- "application/vnd.jupyter.widget-state+json": {
17
- "3fe18eeca02d47f79ec7d4df79d5376f": {
18
- "model_module": "@jupyter-widgets/controls",
19
- "model_name": "VBoxModel",
20
- "model_module_version": "1.5.0",
21
- "state": {
22
- "_dom_classes": [
23
- "container_AC",
24
- "hide"
25
- ],
26
- "_model_module": "@jupyter-widgets/controls",
27
- "_model_module_version": "1.5.0",
28
- "_model_name": "VBoxModel",
29
- "_view_count": null,
30
- "_view_module": "@jupyter-widgets/controls",
31
- "_view_module_version": "1.5.0",
32
- "_view_name": "VBoxView",
33
- "box_style": "",
34
- "children": [
35
- "IPY_MODEL_498f0eb487c44057bafb31c749ca2357",
36
- "IPY_MODEL_88f61add9fa34832969b18f6426b3740",
37
- "IPY_MODEL_5a6b81847e064bb295762602f40fdec1",
38
- "IPY_MODEL_d6698d020370418a92315ddf3e4d4afc",
39
- "IPY_MODEL_76caa0eaf2444c619458641f3b7f54e9",
40
- "IPY_MODEL_78b1a8a0baa5470d970aa2297fcdf0bc"
41
- ],
42
- "layout": "IPY_MODEL_505fccacb6b64da293aaca7bc2730aa7"
43
- }
44
- },
45
- "498f0eb487c44057bafb31c749ca2357": {
46
- "model_module": "@jupyter-widgets/controls",
47
- "model_name": "HTMLModel",
48
- "model_module_version": "1.5.0",
49
- "state": {
50
- "_dom_classes": [],
51
- "_model_module": "@jupyter-widgets/controls",
52
- "_model_module_version": "1.5.0",
53
- "_model_name": "HTMLModel",
54
- "_view_count": null,
55
- "_view_module": "@jupyter-widgets/controls",
56
- "_view_module_version": "1.5.0",
57
- "_view_name": "HTMLView",
58
- "description": "",
59
- "description_tooltip": null,
60
- "layout": "IPY_MODEL_faab2c4f672d4e8891f282e93c7de3bd",
61
- "placeholder": "​",
62
- "style": "IPY_MODEL_760cd50a5ec54f0fb203c2cbda8cd73a",
63
- "value": "\n<span class=\"instruction_AC\">Используйте <span style=\"color: #B2B2B2;\">ctrl</span> или <span style=\"color: #B2B2B2;\">shift</span> для множественного выбора.</span>\n"
64
- }
65
- },
66
- "88f61add9fa34832969b18f6426b3740": {
67
- "model_module": "@jupyter-widgets/controls",
68
- "model_name": "HTMLModel",
69
- "model_module_version": "1.5.0",
70
- "state": {
71
- "_dom_classes": [],
72
- "_model_module": "@jupyter-widgets/controls",
73
- "_model_module_version": "1.5.0",
74
- "_model_name": "HTMLModel",
75
- "_view_count": null,
76
- "_view_module": "@jupyter-widgets/controls",
77
- "_view_module_version": "1.5.0",
78
- "_view_name": "HTMLView",
79
- "description": "",
80
- "description_tooltip": null,
81
- "layout": "IPY_MODEL_8da3e41b39894ad887b4620e9e4d1f2a",
82
- "placeholder": "​",
83
- "style": "IPY_MODEL_ba3059acec1c48e79a0e59417afa8614",
84
- "value": "<hr>"
85
- }
86
- },
87
- "5a6b81847e064bb295762602f40fdec1": {
88
- "model_module": "@jupyter-widgets/controls",
89
- "model_name": "SelectMultipleModel",
90
- "model_module_version": "1.5.0",
91
- "state": {
92
- "_dom_classes": [
93
- "custom-select-multiple_AC"
94
- ],
95
- "_model_module": "@jupyter-widgets/controls",
96
- "_model_module_version": "1.5.0",
97
- "_model_name": "SelectMultipleModel",
98
- "_options_labels": [
99
- "Изображения",
100
- "Модели",
101
- "Vae",
102
- "LoRa",
103
- "ControlNet Модели"
104
- ],
105
- "_view_count": null,
106
- "_view_module": "@jupyter-widgets/controls",
107
- "_view_module_version": "1.5.0",
108
- "_view_name": "SelectMultipleView",
109
- "description": "",
110
- "description_tooltip": null,
111
- "disabled": false,
112
- "index": [],
113
- "layout": "IPY_MODEL_1fa702de844149959e294436f71e7ab1",
114
- "rows": 5,
115
- "style": "IPY_MODEL_f72e1b06881a468e808063b332791fb1"
116
- }
117
- },
118
- "d6698d020370418a92315ddf3e4d4afc": {
119
- "model_module": "@jupyter-widgets/output",
120
- "model_name": "OutputModel",
121
- "model_module_version": "1.0.0",
122
- "state": {
123
- "_dom_classes": [
124
- "output_AC"
125
- ],
126
- "_model_module": "@jupyter-widgets/output",
127
- "_model_module_version": "1.0.0",
128
- "_model_name": "OutputModel",
129
- "_view_count": null,
130
- "_view_module": "@jupyter-widgets/output",
131
- "_view_module_version": "1.0.0",
132
- "_view_name": "OutputView",
133
- "layout": "IPY_MODEL_0742600d3539458a955cb563f832fa76",
134
- "msg_id": "",
135
- "outputs": []
136
- }
137
- },
138
- "76caa0eaf2444c619458641f3b7f54e9": {
139
- "model_module": "@jupyter-widgets/controls",
140
- "model_name": "HTMLModel",
141
- "model_module_version": "1.5.0",
142
- "state": {
143
- "_dom_classes": [],
144
- "_model_module": "@jupyter-widgets/controls",
145
- "_model_module_version": "1.5.0",
146
- "_model_name": "HTMLModel",
147
- "_view_count": null,
148
- "_view_module": "@jupyter-widgets/controls",
149
- "_view_module_version": "1.5.0",
150
- "_view_name": "HTMLView",
151
- "description": "",
152
- "description_tooltip": null,
153
- "layout": "IPY_MODEL_29c64a7c86e942e2abda44c6313c905d",
154
- "placeholder": "​",
155
- "style": "IPY_MODEL_53e5d97467594404bc0a7e2de9ed04a1",
156
- "value": "<hr>"
157
- }
158
- },
159
- "78b1a8a0baa5470d970aa2297fcdf0bc": {
160
- "model_module": "@jupyter-widgets/controls",
161
- "model_name": "HBoxModel",
162
- "model_module_version": "1.5.0",
163
- "state": {
164
- "_dom_classes": [
165
- "lower_information_panel_AC"
166
- ],
167
- "_model_module": "@jupyter-widgets/controls",
168
- "_model_module_version": "1.5.0",
169
- "_model_name": "HBoxModel",
170
- "_view_count": null,
171
- "_view_module": "@jupyter-widgets/controls",
172
- "_view_module_version": "1.5.0",
173
- "_view_name": "HBoxView",
174
- "box_style": "",
175
- "children": [
176
- "IPY_MODEL_58153b5b5c4d4cceacbebdc644c2aeb8",
177
- "IPY_MODEL_478a8bb5d4424b3392cb724f28c91f08"
178
- ],
179
- "layout": "IPY_MODEL_c0b8eed93e964b7b8a2368838d35d16d"
180
- }
181
- },
182
- "505fccacb6b64da293aaca7bc2730aa7": {
183
- "model_module": "@jupyter-widgets/base",
184
- "model_name": "LayoutModel",
185
- "model_module_version": "1.2.0",
186
- "state": {
187
- "_model_module": "@jupyter-widgets/base",
188
- "_model_module_version": "1.2.0",
189
- "_model_name": "LayoutModel",
190
- "_view_count": null,
191
- "_view_module": "@jupyter-widgets/base",
192
- "_view_module_version": "1.2.0",
193
- "_view_name": "LayoutView",
194
- "align_content": null,
195
- "align_items": null,
196
- "align_self": null,
197
- "border": null,
198
- "bottom": null,
199
- "display": null,
200
- "flex": null,
201
- "flex_flow": null,
202
- "grid_area": null,
203
- "grid_auto_columns": null,
204
- "grid_auto_flow": null,
205
- "grid_auto_rows": null,
206
- "grid_column": null,
207
- "grid_gap": null,
208
- "grid_row": null,
209
- "grid_template_areas": null,
210
- "grid_template_columns": null,
211
- "grid_template_rows": null,
212
- "height": null,
213
- "justify_content": null,
214
- "justify_items": null,
215
- "left": null,
216
- "margin": null,
217
- "max_height": null,
218
- "max_width": null,
219
- "min_height": null,
220
- "min_width": null,
221
- "object_fit": null,
222
- "object_position": null,
223
- "order": null,
224
- "overflow": null,
225
- "overflow_x": null,
226
- "overflow_y": null,
227
- "padding": null,
228
- "right": null,
229
- "top": null,
230
- "visibility": null,
231
- "width": null
232
- }
233
- },
234
- "faab2c4f672d4e8891f282e93c7de3bd": {
235
- "model_module": "@jupyter-widgets/base",
236
- "model_name": "LayoutModel",
237
- "model_module_version": "1.2.0",
238
- "state": {
239
- "_model_module": "@jupyter-widgets/base",
240
- "_model_module_version": "1.2.0",
241
- "_model_name": "LayoutModel",
242
- "_view_count": null,
243
- "_view_module": "@jupyter-widgets/base",
244
- "_view_module_version": "1.2.0",
245
- "_view_name": "LayoutView",
246
- "align_content": null,
247
- "align_items": null,
248
- "align_self": null,
249
- "border": null,
250
- "bottom": null,
251
- "display": null,
252
- "flex": null,
253
- "flex_flow": null,
254
- "grid_area": null,
255
- "grid_auto_columns": null,
256
- "grid_auto_flow": null,
257
- "grid_auto_rows": null,
258
- "grid_column": null,
259
- "grid_gap": null,
260
- "grid_row": null,
261
- "grid_template_areas": null,
262
- "grid_template_columns": null,
263
- "grid_template_rows": null,
264
- "height": null,
265
- "justify_content": null,
266
- "justify_items": null,
267
- "left": null,
268
- "margin": null,
269
- "max_height": null,
270
- "max_width": null,
271
- "min_height": null,
272
- "min_width": null,
273
- "object_fit": null,
274
- "object_position": null,
275
- "order": null,
276
- "overflow": null,
277
- "overflow_x": null,
278
- "overflow_y": null,
279
- "padding": null,
280
- "right": null,
281
- "top": null,
282
- "visibility": null,
283
- "width": null
284
- }
285
- },
286
- "760cd50a5ec54f0fb203c2cbda8cd73a": {
287
- "model_module": "@jupyter-widgets/controls",
288
- "model_name": "DescriptionStyleModel",
289
- "model_module_version": "1.5.0",
290
- "state": {
291
- "_model_module": "@jupyter-widgets/controls",
292
- "_model_module_version": "1.5.0",
293
- "_model_name": "DescriptionStyleModel",
294
- "_view_count": null,
295
- "_view_module": "@jupyter-widgets/base",
296
- "_view_module_version": "1.2.0",
297
- "_view_name": "StyleView",
298
- "description_width": ""
299
- }
300
- },
301
- "8da3e41b39894ad887b4620e9e4d1f2a": {
302
- "model_module": "@jupyter-widgets/base",
303
- "model_name": "LayoutModel",
304
- "model_module_version": "1.2.0",
305
- "state": {
306
- "_model_module": "@jupyter-widgets/base",
307
- "_model_module_version": "1.2.0",
308
- "_model_name": "LayoutModel",
309
- "_view_count": null,
310
- "_view_module": "@jupyter-widgets/base",
311
- "_view_module_version": "1.2.0",
312
- "_view_name": "LayoutView",
313
- "align_content": null,
314
- "align_items": null,
315
- "align_self": null,
316
- "border": null,
317
- "bottom": null,
318
- "display": null,
319
- "flex": null,
320
- "flex_flow": null,
321
- "grid_area": null,
322
- "grid_auto_columns": null,
323
- "grid_auto_flow": null,
324
- "grid_auto_rows": null,
325
- "grid_column": null,
326
- "grid_gap": null,
327
- "grid_row": null,
328
- "grid_template_areas": null,
329
- "grid_template_columns": null,
330
- "grid_template_rows": null,
331
- "height": null,
332
- "justify_content": null,
333
- "justify_items": null,
334
- "left": null,
335
- "margin": null,
336
- "max_height": null,
337
- "max_width": null,
338
- "min_height": null,
339
- "min_width": null,
340
- "object_fit": null,
341
- "object_position": null,
342
- "order": null,
343
- "overflow": null,
344
- "overflow_x": null,
345
- "overflow_y": null,
346
- "padding": null,
347
- "right": null,
348
- "top": null,
349
- "visibility": null,
350
- "width": null
351
- }
352
- },
353
- "ba3059acec1c48e79a0e59417afa8614": {
354
- "model_module": "@jupyter-widgets/controls",
355
- "model_name": "DescriptionStyleModel",
356
- "model_module_version": "1.5.0",
357
- "state": {
358
- "_model_module": "@jupyter-widgets/controls",
359
- "_model_module_version": "1.5.0",
360
- "_model_name": "DescriptionStyleModel",
361
- "_view_count": null,
362
- "_view_module": "@jupyter-widgets/base",
363
- "_view_module_version": "1.2.0",
364
- "_view_name": "StyleView",
365
- "description_width": ""
366
- }
367
- },
368
- "1fa702de844149959e294436f71e7ab1": {
369
- "model_module": "@jupyter-widgets/base",
370
- "model_name": "LayoutModel",
371
- "model_module_version": "1.2.0",
372
- "state": {
373
- "_model_module": "@jupyter-widgets/base",
374
- "_model_module_version": "1.2.0",
375
- "_model_name": "LayoutModel",
376
- "_view_count": null,
377
- "_view_module": "@jupyter-widgets/base",
378
- "_view_module_version": "1.2.0",
379
- "_view_name": "LayoutView",
380
- "align_content": null,
381
- "align_items": null,
382
- "align_self": null,
383
- "border": null,
384
- "bottom": null,
385
- "display": null,
386
- "flex": null,
387
- "flex_flow": null,
388
- "grid_area": null,
389
- "grid_auto_columns": null,
390
- "grid_auto_flow": null,
391
- "grid_auto_rows": null,
392
- "grid_column": null,
393
- "grid_gap": null,
394
- "grid_row": null,
395
- "grid_template_areas": null,
396
- "grid_template_columns": null,
397
- "grid_template_rows": null,
398
- "height": null,
399
- "justify_content": null,
400
- "justify_items": null,
401
- "left": null,
402
- "margin": null,
403
- "max_height": null,
404
- "max_width": null,
405
- "min_height": null,
406
- "min_width": null,
407
- "object_fit": null,
408
- "object_position": null,
409
- "order": null,
410
- "overflow": null,
411
- "overflow_x": null,
412
- "overflow_y": null,
413
- "padding": null,
414
- "right": null,
415
- "top": null,
416
- "visibility": null,
417
- "width": "100%"
418
- }
419
- },
420
- "f72e1b06881a468e808063b332791fb1": {
421
- "model_module": "@jupyter-widgets/controls",
422
- "model_name": "DescriptionStyleModel",
423
- "model_module_version": "1.5.0",
424
- "state": {
425
- "_model_module": "@jupyter-widgets/controls",
426
- "_model_module_version": "1.5.0",
427
- "_model_name": "DescriptionStyleModel",
428
- "_view_count": null,
429
- "_view_module": "@jupyter-widgets/base",
430
- "_view_module_version": "1.2.0",
431
- "_view_name": "StyleView",
432
- "description_width": ""
433
- }
434
- },
435
- "29c64a7c86e942e2abda44c6313c905d": {
436
- "model_module": "@jupyter-widgets/base",
437
- "model_name": "LayoutModel",
438
- "model_module_version": "1.2.0",
439
- "state": {
440
- "_model_module": "@jupyter-widgets/base",
441
- "_model_module_version": "1.2.0",
442
- "_model_name": "LayoutModel",
443
- "_view_count": null,
444
- "_view_module": "@jupyter-widgets/base",
445
- "_view_module_version": "1.2.0",
446
- "_view_name": "LayoutView",
447
- "align_content": null,
448
- "align_items": null,
449
- "align_self": null,
450
- "border": null,
451
- "bottom": null,
452
- "display": null,
453
- "flex": null,
454
- "flex_flow": null,
455
- "grid_area": null,
456
- "grid_auto_columns": null,
457
- "grid_auto_flow": null,
458
- "grid_auto_rows": null,
459
- "grid_column": null,
460
- "grid_gap": null,
461
- "grid_row": null,
462
- "grid_template_areas": null,
463
- "grid_template_columns": null,
464
- "grid_template_rows": null,
465
- "height": null,
466
- "justify_content": null,
467
- "justify_items": null,
468
- "left": null,
469
- "margin": null,
470
- "max_height": null,
471
- "max_width": null,
472
- "min_height": null,
473
- "min_width": null,
474
- "object_fit": null,
475
- "object_position": null,
476
- "order": null,
477
- "overflow": null,
478
- "overflow_x": null,
479
- "overflow_y": null,
480
- "padding": null,
481
- "right": null,
482
- "top": null,
483
- "visibility": null,
484
- "width": null
485
- }
486
- },
487
- "53e5d97467594404bc0a7e2de9ed04a1": {
488
- "model_module": "@jupyter-widgets/controls",
489
- "model_name": "DescriptionStyleModel",
490
- "model_module_version": "1.5.0",
491
- "state": {
492
- "_model_module": "@jupyter-widgets/controls",
493
- "_model_module_version": "1.5.0",
494
- "_model_name": "DescriptionStyleModel",
495
- "_view_count": null,
496
- "_view_module": "@jupyter-widgets/base",
497
- "_view_module_version": "1.2.0",
498
- "_view_name": "StyleView",
499
- "description_width": ""
500
- }
501
- },
502
- "58153b5b5c4d4cceacbebdc644c2aeb8": {
503
- "model_module": "@jupyter-widgets/controls",
504
- "model_name": "HBoxModel",
505
- "model_module_version": "1.5.0",
506
- "state": {
507
- "_dom_classes": [],
508
- "_model_module": "@jupyter-widgets/controls",
509
- "_model_module_version": "1.5.0",
510
- "_model_name": "HBoxModel",
511
- "_view_count": null,
512
- "_view_module": "@jupyter-widgets/controls",
513
- "_view_module_version": "1.5.0",
514
- "_view_name": "HBoxView",
515
- "box_style": "",
516
- "children": [
517
- "IPY_MODEL_1ab673223b22490c8453559e329ac03a",
518
- "IPY_MODEL_efbaedfac37547da8328ca95a5e10eeb"
519
- ],
520
- "layout": "IPY_MODEL_d0c6ac1211b943af85aec33eb2e522c2"
521
- }
522
- },
523
- "478a8bb5d4424b3392cb724f28c91f08": {
524
- "model_module": "@jupyter-widgets/controls",
525
- "model_name": "HTMLModel",
526
- "model_module_version": "1.5.0",
527
- "state": {
528
- "_dom_classes": [],
529
- "_model_module": "@jupyter-widgets/controls",
530
- "_model_module_version": "1.5.0",
531
- "_model_name": "HTMLModel",
532
- "_view_count": null,
533
- "_view_module": "@jupyter-widgets/controls",
534
- "_view_module_version": "1.5.0",
535
- "_view_name": "HTMLView",
536
- "description": "",
537
- "description_tooltip": null,
538
- "layout": "IPY_MODEL_d0f61995fbf24c34a151eef26ed23610",
539
- "placeholder": "​",
540
- "style": "IPY_MODEL_b8e7260d500a454a96002d33e919af58",
541
- "value": "\n<div class=\"storage_info_AC\">Всего: 107.72 GB <span style=\"color: #555\">|</span> Используется: 26.31 GB <span style=\"color: #555\">|</span> Свободно: 81.39 GB</div>\n"
542
- }
543
- },
544
- "c0b8eed93e964b7b8a2368838d35d16d": {
545
- "model_module": "@jupyter-widgets/base",
546
- "model_name": "LayoutModel",
547
- "model_module_version": "1.2.0",
548
- "state": {
549
- "_model_module": "@jupyter-widgets/base",
550
- "_model_module_version": "1.2.0",
551
- "_model_name": "LayoutModel",
552
- "_view_count": null,
553
- "_view_module": "@jupyter-widgets/base",
554
- "_view_module_version": "1.2.0",
555
- "_view_name": "LayoutView",
556
- "align_content": null,
557
- "align_items": null,
558
- "align_self": null,
559
- "border": null,
560
- "bottom": null,
561
- "display": null,
562
- "flex": null,
563
- "flex_flow": null,
564
- "grid_area": null,
565
- "grid_auto_columns": null,
566
- "grid_auto_flow": null,
567
- "grid_auto_rows": null,
568
- "grid_column": null,
569
- "grid_gap": null,
570
- "grid_row": null,
571
- "grid_template_areas": null,
572
- "grid_template_columns": null,
573
- "grid_template_rows": null,
574
- "height": null,
575
- "justify_content": null,
576
- "justify_items": null,
577
- "left": null,
578
- "margin": null,
579
- "max_height": null,
580
- "max_width": null,
581
- "min_height": null,
582
- "min_width": null,
583
- "object_fit": null,
584
- "object_position": null,
585
- "order": null,
586
- "overflow": null,
587
- "overflow_x": null,
588
- "overflow_y": null,
589
- "padding": null,
590
- "right": null,
591
- "top": null,
592
- "visibility": null,
593
- "width": null
594
- }
595
- },
596
- "1ab673223b22490c8453559e329ac03a": {
597
- "model_module": "@jupyter-widgets/controls",
598
- "model_name": "ButtonModel",
599
- "model_module_version": "1.5.0",
600
- "state": {
601
- "_dom_classes": [
602
- "button_execute_AC",
603
- "button_AC"
604
- ],
605
- "_model_module": "@jupyter-widgets/controls",
606
- "_model_module_version": "1.5.0",
607
- "_model_name": "ButtonModel",
608
- "_view_count": null,
609
- "_view_module": "@jupyter-widgets/controls",
610
- "_view_module_version": "1.5.0",
611
- "_view_name": "ButtonView",
612
- "button_style": "",
613
- "description": "Выполнить Очистку",
614
- "disabled": false,
615
- "icon": "",
616
- "layout": "IPY_MODEL_88fbd55e845b47259b114e2ddaa4cf2e",
617
- "style": "IPY_MODEL_b1c15edf892042d2bd0f856ccad35761",
618
- "tooltip": ""
619
- }
620
- },
621
- "efbaedfac37547da8328ca95a5e10eeb": {
622
- "model_module": "@jupyter-widgets/controls",
623
- "model_name": "ButtonModel",
624
- "model_module_version": "1.5.0",
625
- "state": {
626
- "_dom_classes": [
627
- "button_clear_AC",
628
- "button_AC"
629
- ],
630
- "_model_module": "@jupyter-widgets/controls",
631
- "_model_module_version": "1.5.0",
632
- "_model_name": "ButtonModel",
633
- "_view_count": null,
634
- "_view_module": "@jupyter-widgets/controls",
635
- "_view_module_version": "1.5.0",
636
- "_view_name": "ButtonView",
637
- "button_style": "",
638
- "description": "Скрыть Виджет",
639
- "disabled": false,
640
- "icon": "",
641
- "layout": "IPY_MODEL_378ab655daf54fe6a38a5fe6f5e3153b",
642
- "style": "IPY_MODEL_84a1673702c141789a3a4d25d8af2ad4",
643
- "tooltip": ""
644
- }
645
- },
646
- "d0c6ac1211b943af85aec33eb2e522c2": {
647
- "model_module": "@jupyter-widgets/base",
648
- "model_name": "LayoutModel",
649
- "model_module_version": "1.2.0",
650
- "state": {
651
- "_model_module": "@jupyter-widgets/base",
652
- "_model_module_version": "1.2.0",
653
- "_model_name": "LayoutModel",
654
- "_view_count": null,
655
- "_view_module": "@jupyter-widgets/base",
656
- "_view_module_version": "1.2.0",
657
- "_view_name": "LayoutView",
658
- "align_content": null,
659
- "align_items": null,
660
- "align_self": null,
661
- "border": null,
662
- "bottom": null,
663
- "display": null,
664
- "flex": null,
665
- "flex_flow": null,
666
- "grid_area": null,
667
- "grid_auto_columns": null,
668
- "grid_auto_flow": null,
669
- "grid_auto_rows": null,
670
- "grid_column": null,
671
- "grid_gap": null,
672
- "grid_row": null,
673
- "grid_template_areas": null,
674
- "grid_template_columns": null,
675
- "grid_template_rows": null,
676
- "height": null,
677
- "justify_content": null,
678
- "justify_items": null,
679
- "left": null,
680
- "margin": null,
681
- "max_height": null,
682
- "max_width": null,
683
- "min_height": null,
684
- "min_width": null,
685
- "object_fit": null,
686
- "object_position": null,
687
- "order": null,
688
- "overflow": null,
689
- "overflow_x": null,
690
- "overflow_y": null,
691
- "padding": null,
692
- "right": null,
693
- "top": null,
694
- "visibility": null,
695
- "width": null
696
- }
697
- },
698
- "d0f61995fbf24c34a151eef26ed23610": {
699
- "model_module": "@jupyter-widgets/base",
700
- "model_name": "LayoutModel",
701
- "model_module_version": "1.2.0",
702
- "state": {
703
- "_model_module": "@jupyter-widgets/base",
704
- "_model_module_version": "1.2.0",
705
- "_model_name": "LayoutModel",
706
- "_view_count": null,
707
- "_view_module": "@jupyter-widgets/base",
708
- "_view_module_version": "1.2.0",
709
- "_view_name": "LayoutView",
710
- "align_content": null,
711
- "align_items": null,
712
- "align_self": null,
713
- "border": null,
714
- "bottom": null,
715
- "display": null,
716
- "flex": null,
717
- "flex_flow": null,
718
- "grid_area": null,
719
- "grid_auto_columns": null,
720
- "grid_auto_flow": null,
721
- "grid_auto_rows": null,
722
- "grid_column": null,
723
- "grid_gap": null,
724
- "grid_row": null,
725
- "grid_template_areas": null,
726
- "grid_template_columns": null,
727
- "grid_template_rows": null,
728
- "height": null,
729
- "justify_content": null,
730
- "justify_items": null,
731
- "left": null,
732
- "margin": null,
733
- "max_height": null,
734
- "max_width": null,
735
- "min_height": null,
736
- "min_width": null,
737
- "object_fit": null,
738
- "object_position": null,
739
- "order": null,
740
- "overflow": null,
741
- "overflow_x": null,
742
- "overflow_y": null,
743
- "padding": null,
744
- "right": null,
745
- "top": null,
746
- "visibility": null,
747
- "width": null
748
- }
749
- },
750
- "b8e7260d500a454a96002d33e919af58": {
751
- "model_module": "@jupyter-widgets/controls",
752
- "model_name": "DescriptionStyleModel",
753
- "model_module_version": "1.5.0",
754
- "state": {
755
- "_model_module": "@jupyter-widgets/controls",
756
- "_model_module_version": "1.5.0",
757
- "_model_name": "DescriptionStyleModel",
758
- "_view_count": null,
759
- "_view_module": "@jupyter-widgets/base",
760
- "_view_module_version": "1.2.0",
761
- "_view_name": "StyleView",
762
- "description_width": ""
763
- }
764
- },
765
- "88fbd55e845b47259b114e2ddaa4cf2e": {
766
- "model_module": "@jupyter-widgets/base",
767
- "model_name": "LayoutModel",
768
- "model_module_version": "1.2.0",
769
- "state": {
770
- "_model_module": "@jupyter-widgets/base",
771
- "_model_module_version": "1.2.0",
772
- "_model_name": "LayoutModel",
773
- "_view_count": null,
774
- "_view_module": "@jupyter-widgets/base",
775
- "_view_module_version": "1.2.0",
776
- "_view_name": "LayoutView",
777
- "align_content": null,
778
- "align_items": null,
779
- "align_self": null,
780
- "border": null,
781
- "bottom": null,
782
- "display": null,
783
- "flex": null,
784
- "flex_flow": null,
785
- "grid_area": null,
786
- "grid_auto_columns": null,
787
- "grid_auto_flow": null,
788
- "grid_auto_rows": null,
789
- "grid_column": null,
790
- "grid_gap": null,
791
- "grid_row": null,
792
- "grid_template_areas": null,
793
- "grid_template_columns": null,
794
- "grid_template_rows": null,
795
- "height": null,
796
- "justify_content": null,
797
- "justify_items": null,
798
- "left": null,
799
- "margin": null,
800
- "max_height": null,
801
- "max_width": null,
802
- "min_height": null,
803
- "min_width": null,
804
- "object_fit": null,
805
- "object_position": null,
806
- "order": null,
807
- "overflow": null,
808
- "overflow_x": null,
809
- "overflow_y": null,
810
- "padding": null,
811
- "right": null,
812
- "top": null,
813
- "visibility": null,
814
- "width": null
815
- }
816
- },
817
- "b1c15edf892042d2bd0f856ccad35761": {
818
- "model_module": "@jupyter-widgets/controls",
819
- "model_name": "ButtonStyleModel",
820
- "model_module_version": "1.5.0",
821
- "state": {
822
- "_model_module": "@jupyter-widgets/controls",
823
- "_model_module_version": "1.5.0",
824
- "_model_name": "ButtonStyleModel",
825
- "_view_count": null,
826
- "_view_module": "@jupyter-widgets/base",
827
- "_view_module_version": "1.2.0",
828
- "_view_name": "StyleView",
829
- "button_color": null,
830
- "font_weight": ""
831
- }
832
- },
833
- "378ab655daf54fe6a38a5fe6f5e3153b": {
834
- "model_module": "@jupyter-widgets/base",
835
- "model_name": "LayoutModel",
836
- "model_module_version": "1.2.0",
837
- "state": {
838
- "_model_module": "@jupyter-widgets/base",
839
- "_model_module_version": "1.2.0",
840
- "_model_name": "LayoutModel",
841
- "_view_count": null,
842
- "_view_module": "@jupyter-widgets/base",
843
- "_view_module_version": "1.2.0",
844
- "_view_name": "LayoutView",
845
- "align_content": null,
846
- "align_items": null,
847
- "align_self": null,
848
- "border": null,
849
- "bottom": null,
850
- "display": null,
851
- "flex": null,
852
- "flex_flow": null,
853
- "grid_area": null,
854
- "grid_auto_columns": null,
855
- "grid_auto_flow": null,
856
- "grid_auto_rows": null,
857
- "grid_column": null,
858
- "grid_gap": null,
859
- "grid_row": null,
860
- "grid_template_areas": null,
861
- "grid_template_columns": null,
862
- "grid_template_rows": null,
863
- "height": null,
864
- "justify_content": null,
865
- "justify_items": null,
866
- "left": null,
867
- "margin": null,
868
- "max_height": null,
869
- "max_width": null,
870
- "min_height": null,
871
- "min_width": null,
872
- "object_fit": null,
873
- "object_position": null,
874
- "order": null,
875
- "overflow": null,
876
- "overflow_x": null,
877
- "overflow_y": null,
878
- "padding": null,
879
- "right": null,
880
- "top": null,
881
- "visibility": null,
882
- "width": null
883
- }
884
- },
885
- "84a1673702c141789a3a4d25d8af2ad4": {
886
- "model_module": "@jupyter-widgets/controls",
887
- "model_name": "ButtonStyleModel",
888
- "model_module_version": "1.5.0",
889
- "state": {
890
- "_model_module": "@jupyter-widgets/controls",
891
- "_model_module_version": "1.5.0",
892
- "_model_name": "ButtonStyleModel",
893
- "_view_count": null,
894
- "_view_module": "@jupyter-widgets/base",
895
- "_view_module_version": "1.2.0",
896
- "_view_name": "StyleView",
897
- "button_color": null,
898
- "font_weight": ""
899
- }
900
- },
901
- "0742600d3539458a955cb563f832fa76": {
902
- "model_module": "@jupyter-widgets/base",
903
- "model_name": "LayoutModel",
904
- "model_module_version": "1.2.0",
905
- "state": {
906
- "_model_module": "@jupyter-widgets/base",
907
- "_model_module_version": "1.2.0",
908
- "_model_name": "LayoutModel",
909
- "_view_count": null,
910
- "_view_module": "@jupyter-widgets/base",
911
- "_view_module_version": "1.2.0",
912
- "_view_name": "LayoutView",
913
- "align_content": null,
914
- "align_items": null,
915
- "align_self": null,
916
- "border": null,
917
- "bottom": null,
918
- "display": null,
919
- "flex": null,
920
- "flex_flow": null,
921
- "grid_area": null,
922
- "grid_auto_columns": null,
923
- "grid_auto_flow": null,
924
- "grid_auto_rows": null,
925
- "grid_column": null,
926
- "grid_gap": null,
927
- "grid_row": null,
928
- "grid_template_areas": null,
929
- "grid_template_columns": null,
930
- "grid_template_rows": null,
931
- "height": null,
932
- "justify_content": null,
933
- "justify_items": null,
934
- "left": null,
935
- "margin": null,
936
- "max_height": null,
937
- "max_width": null,
938
- "min_height": null,
939
- "min_width": null,
940
- "object_fit": null,
941
- "object_position": null,
942
- "order": null,
943
- "overflow": null,
944
- "overflow_x": null,
945
- "overflow_y": null,
946
- "padding": null,
947
- "right": null,
948
- "top": null,
949
- "visibility": null,
950
- "width": null
951
- }
952
- }
953
- }
954
  }
955
  },
956
  "cells": [
957
  {
958
  "cell_type": "code",
959
  "source": [
960
- "##~ AutoCleaner V3.5 CODE | BY: ANXETY ~##\n",
 
 
 
 
 
 
 
 
961
  "\n",
962
  "import os\n",
963
  "import time\n",
@@ -993,7 +61,7 @@
993
  "\n",
994
  "\n",
995
  "# ==================== CSS ====================\n",
996
- "CSS = \"\"\"\n",
997
  "<style>\n",
998
  "/* General Styles */\n",
999
  "\n",
@@ -1030,7 +98,7 @@
1030
  " position: absolute;\n",
1031
  " top: 5px;\n",
1032
  " right: 10px;\n",
1033
- " content: \"AutoCleanerV3.5\";\n",
1034
  " font-weight: bold;\n",
1035
  " font-size: 24px;\n",
1036
  " color: rgba(0, 0, 0, 0.2);\n",
@@ -1049,7 +117,7 @@
1049
  ".custom-select-multiple_AC select {\n",
1050
  " padding: 10px;\n",
1051
  " font-family: cursive;\n",
1052
- " border: 1px solid #262626;\n",
1053
  " border-radius: 10px;\n",
1054
  " color: white;\n",
1055
  " background-color: #1c1c1c;\n",
@@ -1166,7 +234,7 @@
1166
  "/* Leaving */\n",
1167
  ".container_AC.hide {\n",
1168
  " animation-name: slideOutTopBlur;\n",
1169
- " animation-duration: 0.5s;\n",
1170
  " animation-fill-mode: forwards;\n",
1171
  "}\n",
1172
  "\n",
@@ -1185,7 +253,7 @@
1185
  "</style>\n",
1186
  "\"\"\"\n",
1187
  "\n",
1188
- "display(HTML(CSS))\n",
1189
  "# ==================== CSS ====================\n",
1190
  "\n",
1191
  "\n",
@@ -1194,25 +262,35 @@
1194
  " deleted_files = 0\n",
1195
  " for root, dirs, files in os.walk(directory):\n",
1196
  " for file in files:\n",
1197
- " if not file.endswith((\".txt\", \".yaml\")):\n",
1198
- " file_path = os.path.join(root, file)\n",
1199
- " os.remove(file_path)\n",
1200
- " deleted_files += 1\n",
1201
- "\n",
1202
  " return deleted_files\n",
1203
  "\n",
1204
  "\n",
1205
  "def get_word_variant(n, variants):\n",
1206
  " unit = abs(n) % 10\n",
1207
  " tens = abs(n) % 100\n",
1208
- "\n",
1209
  " if tens in range(11, 15):\n",
1210
  " return variants[2]\n",
1211
  " elif unit == 1:\n",
1212
  " return variants[0]\n",
1213
  " elif unit in range(2, 5):\n",
1214
  " return variants[1]\n",
1215
- " return variants[2]\n",
 
 
 
 
 
 
 
 
 
 
 
 
1216
  "\n",
1217
  "\n",
1218
  "def on_execute_button_press(button):\n",
@@ -1230,10 +308,12 @@
1230
  " message_widget = HTML(f'<p class=\"output_message_AC\">{message}</p>')\n",
1231
  " display(message_widget)\n",
1232
  "\n",
 
 
1233
  "\n",
1234
  "def on_clear_button_press(button):\n",
1235
  " container.add_class(\"hide\")\n",
1236
- " time.sleep(0.3)\n",
1237
  " widgets.Widget.close_all()\n",
1238
  "\n",
1239
  "\n",
@@ -1247,22 +327,18 @@
1247
  " \"ControlNet Модели\": [\"ControlNet Модель\", \"ControlNet Модели\", \"ControlNet Моделей\"]\n",
1248
  " }\n",
1249
  " deleted_word_variants = [\"Удалена\", \"Удалены\", \"Удалено\"]\n",
1250
- "\n",
1251
  " for key, value in deleted_files_dict.items():\n",
1252
  " word_variant = word_variants.get(key, [\"\", \"\", \"\"])\n",
1253
  " deleted_word = get_word_variant(value, deleted_word_variants)\n",
1254
  " object_word = get_word_variant(value, word_variant)\n",
1255
- "\n",
1256
  " messages.append(f\"{deleted_word} {value} {object_word}\")\n",
1257
- "\n",
1258
  " return messages\n",
1259
  "# ================ AutoCleaner function ================\n",
1260
  "\n",
1261
  "\n",
1262
  "# --- storage memory ---\n",
1263
  "import psutil\n",
1264
- "directory = os.getcwd()\n",
1265
- "disk_space = psutil.disk_usage(directory)\n",
1266
  "total = disk_space.total / (1024 ** 3)\n",
1267
  "used = disk_space.used / (1024 ** 3)\n",
1268
  "free = disk_space.free / (1024 ** 3)\n",
@@ -1273,7 +349,7 @@
1273
  "instruction_label = widgets.HTML('''\n",
1274
  "<span class=\"instruction_AC\">Используйте <span style=\"color: #B2B2B2;\">ctrl</span> или <span style=\"color: #B2B2B2;\">shift</span> для множественного выбора.</span>\n",
1275
  "''')\n",
1276
- "auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='100%')).add_class(\"custom-select-multiple_AC\")\n",
1277
  "output = widgets.Output().add_class(\"output_AC\")\n",
1278
  "# ---\n",
1279
  "execute_button = Button(description='Выполнить Очистку').add_class(\"button_execute_AC\").add_class(\"button_AC\")\n",
@@ -1293,262 +369,10 @@
1293
  "display(container)"
1294
  ],
1295
  "metadata": {
1296
- "id": "I22dFg7F2j3G",
1297
- "colab": {
1298
- "base_uri": "https://localhost:8080/",
1299
- "height": 17,
1300
- "referenced_widgets": [
1301
- "3fe18eeca02d47f79ec7d4df79d5376f",
1302
- "498f0eb487c44057bafb31c749ca2357",
1303
- "88f61add9fa34832969b18f6426b3740",
1304
- "5a6b81847e064bb295762602f40fdec1",
1305
- "d6698d020370418a92315ddf3e4d4afc",
1306
- "76caa0eaf2444c619458641f3b7f54e9",
1307
- "78b1a8a0baa5470d970aa2297fcdf0bc",
1308
- "505fccacb6b64da293aaca7bc2730aa7",
1309
- "faab2c4f672d4e8891f282e93c7de3bd",
1310
- "760cd50a5ec54f0fb203c2cbda8cd73a",
1311
- "8da3e41b39894ad887b4620e9e4d1f2a",
1312
- "ba3059acec1c48e79a0e59417afa8614",
1313
- "1fa702de844149959e294436f71e7ab1",
1314
- "f72e1b06881a468e808063b332791fb1",
1315
- "29c64a7c86e942e2abda44c6313c905d",
1316
- "53e5d97467594404bc0a7e2de9ed04a1",
1317
- "58153b5b5c4d4cceacbebdc644c2aeb8",
1318
- "478a8bb5d4424b3392cb724f28c91f08",
1319
- "c0b8eed93e964b7b8a2368838d35d16d",
1320
- "1ab673223b22490c8453559e329ac03a",
1321
- "efbaedfac37547da8328ca95a5e10eeb",
1322
- "d0c6ac1211b943af85aec33eb2e522c2",
1323
- "d0f61995fbf24c34a151eef26ed23610",
1324
- "b8e7260d500a454a96002d33e919af58",
1325
- "88fbd55e845b47259b114e2ddaa4cf2e",
1326
- "b1c15edf892042d2bd0f856ccad35761",
1327
- "378ab655daf54fe6a38a5fe6f5e3153b",
1328
- "84a1673702c141789a3a4d25d8af2ad4",
1329
- "0742600d3539458a955cb563f832fa76"
1330
- ]
1331
- },
1332
- "outputId": "2ef71a45-1d33-4299-9397-379d9f7c5e91"
1333
  },
1334
  "execution_count": null,
1335
- "outputs": [
1336
- {
1337
- "output_type": "display_data",
1338
- "data": {
1339
- "text/plain": [
1340
- "<IPython.core.display.HTML object>"
1341
- ],
1342
- "text/html": [
1343
- "\n",
1344
- "<style>\n",
1345
- "/* General Styles */\n",
1346
- "\n",
1347
- "hr {\n",
1348
- " border-color: grey;\n",
1349
- " background-color: grey;\n",
1350
- " opacity: 0.25;\n",
1351
- "}\n",
1352
- "\n",
1353
- ".instruction_AC {\n",
1354
- " font-family: cursive;\n",
1355
- " font-size: 18px;\n",
1356
- " color: grey;\n",
1357
- " user-select: none;\n",
1358
- " cursor: default;\n",
1359
- "}\n",
1360
- "\n",
1361
- "\n",
1362
- "/* Container style */\n",
1363
- "\n",
1364
- ".container_AC {\n",
1365
- " position: relative;\n",
1366
- " background-color: #232323;\n",
1367
- " width: 800px;\n",
1368
- " height: auto;\n",
1369
- " padding: 15px;\n",
1370
- " border-radius: 15px;\n",
1371
- " box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);\n",
1372
- " margin-bottom: 5px;\n",
1373
- " overflow: visible;\n",
1374
- "}\n",
1375
- "\n",
1376
- ".container_AC::before {\n",
1377
- " position: absolute;\n",
1378
- " top: 5px;\n",
1379
- " right: 10px;\n",
1380
- " content: \"AutoCleanerV3.5\";\n",
1381
- " font-weight: bold;\n",
1382
- " font-size: 24px;\n",
1383
- " color: rgba(0, 0, 0, 0.2);\n",
1384
- "}\n",
1385
- "\n",
1386
- ".container_AC::after {\n",
1387
- " position: absolute;\n",
1388
- " top: 30px;\n",
1389
- " right: 10px;\n",
1390
- " content: \"ANXETY\";\n",
1391
- " font-weight: bold;\n",
1392
- " font-size: 18px;\n",
1393
- " color: rgba(0, 0, 0, 0.2);\n",
1394
- "}\n",
1395
- "\n",
1396
- ".custom-select-multiple_AC select {\n",
1397
- " padding: 10px;\n",
1398
- " font-family: cursive;\n",
1399
- " border: 1px solid #262626;\n",
1400
- " border-radius: 10px;\n",
1401
- " color: white;\n",
1402
- " background-color: #1c1c1c;\n",
1403
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
1404
- "}\n",
1405
- "\n",
1406
- ".output_AC {\n",
1407
- " padding: 10px;\n",
1408
- " height: auto;\n",
1409
- " border: 1px solid #262626;\n",
1410
- " border-radius: 10px;\n",
1411
- " background-color: #1c1c1c;\n",
1412
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
1413
- " width: auto;\n",
1414
- " box-sizing: border-box;\n",
1415
- "}\n",
1416
- "\n",
1417
- ".output_message_AC {\n",
1418
- " font-family: cursive;\n",
1419
- " color: white !important;\n",
1420
- " font-size: 14px;\n",
1421
- " user-select: none;\n",
1422
- " cursor: default\n",
1423
- "}\n",
1424
- "\n",
1425
- "\n",
1426
- ".storage_info_AC {\n",
1427
- " padding: 5px 20px;\n",
1428
- " height: auto;\n",
1429
- " border: 1px solid #262626;\n",
1430
- " border-radius: 10px;\n",
1431
- " background-color: #1c1c1c;\n",
1432
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
1433
- " width: auto;\n",
1434
- " font-family: cursive;\n",
1435
- " color: #B2B2B2 !important;\n",
1436
- " font-size: 14px;\n",
1437
- " user-select: none;\n",
1438
- " cursor: default\n",
1439
- "}\n",
1440
- "\n",
1441
- "\n",
1442
- "/* Button and storage info layout */\n",
1443
- ".lower_information_panel_AC {\n",
1444
- " display: flex;\n",
1445
- " align-items: center;\n",
1446
- " justify-content: space-between;\n",
1447
- "}\n",
1448
- "\n",
1449
- "\n",
1450
- "/* Button style */\n",
1451
- "\n",
1452
- ".button_AC {\n",
1453
- " width: auto;\n",
1454
- " font-family: cursive;\n",
1455
- " color: white !important;\n",
1456
- " font-size: 14px;\n",
1457
- " font-weight: bold;\n",
1458
- " height: 35px;\n",
1459
- " border-radius: 15px;\n",
1460
- " background-image: radial-gradient(circle at top left, purple 10%, violet 90%);\n",
1461
- " background-size: 200% 200%;\n",
1462
- " background-position: left bottom;\n",
1463
- " transition: background 0.5s ease-in-out, transform 0.3s ease;\n",
1464
- "}\n",
1465
- "\n",
1466
- ".button_AC:hover {\n",
1467
- " cursor: pointer;\n",
1468
- " background-size: 200% 200%;\n",
1469
- " background-position: right bottom;\n",
1470
- " transform: translateY(1px);\n",
1471
- "}\n",
1472
- "\n",
1473
- ".button_execute_AC:hover {\n",
1474
- " background-image: radial-gradient(circle at top left, purple 10%, #93ac47 90%);\n",
1475
- "}\n",
1476
- "\n",
1477
- ".button_clear_AC:hover {\n",
1478
- " background-image: radial-gradient(circle at top left, purple 10%, #fc3468 90%);\n",
1479
- "}\n",
1480
- "\n",
1481
- ".button_execute_AC:active,\n",
1482
- ".button_clear_AC:active {\n",
1483
- " filter: brightness(0.75);\n",
1484
- "}\n",
1485
- "\n",
1486
- ".jupyter-widgets.lm-Widget:focus {\n",
1487
- " outline: none;\n",
1488
- "}\n",
1489
- "\n",
1490
- "\n",
1491
- "/* Animation of elements */\n",
1492
- "\n",
1493
- "/* Emergence */\n",
1494
- ".container_AC {\n",
1495
- " animation-name: slideInTopBlur;\n",
1496
- " animation-duration: 0.7s;\n",
1497
- " animation-fill-mode: forwards;\n",
1498
- "}\n",
1499
- "\n",
1500
- "@keyframes slideInTopBlur {\n",
1501
- " 0% {\n",
1502
- " transform: translate3d(0, 50%, 0) scale(0.85) rotate3d(1, 0, 0, -85deg);\n",
1503
- " filter: blur(5px) grayscale(1) brightness(0.5);\n",
1504
- " opacity: 0;\n",
1505
- " }\n",
1506
- " 100% {\n",
1507
- " transform: translate3d(0, 0, 0) scale(1) rotate3d(1, 0, 0, 0deg);\n",
1508
- " filter: blur(0) grayscale(0) brightness(1);\n",
1509
- " opacity: 1;\n",
1510
- " }\n",
1511
- "}\n",
1512
- "\n",
1513
- "/* Leaving */\n",
1514
- ".container_AC.hide {\n",
1515
- " animation-name: slideOutTopBlur;\n",
1516
- " animation-duration: 0.5s;\n",
1517
- " animation-fill-mode: forwards;\n",
1518
- "}\n",
1519
- "\n",
1520
- "@keyframes slideOutTopBlur {\n",
1521
- " 0% {\n",
1522
- " transform: translate3d(0, 0, 0) scale(1);\n",
1523
- " filter: blur(0) grayscale(0) brightness(1);\n",
1524
- " opacity: 1;\n",
1525
- " }\n",
1526
- " 100% {\n",
1527
- " transform: translate3d(0, -100%, 0);\n",
1528
- " filter: blur(5px) grayscale(1) brightness(0);\n",
1529
- " opacity: 0;\n",
1530
- " }\n",
1531
- "}\n",
1532
- "</style>\n"
1533
- ]
1534
- },
1535
- "metadata": {}
1536
- },
1537
- {
1538
- "output_type": "display_data",
1539
- "data": {
1540
- "text/plain": [
1541
- "VBox(children=(HTML(value='\\n<span class=\"instruction_AC\">Используйте <span style=\"color: #B2B2B2;\">ctrl</span…"
1542
- ],
1543
- "application/vnd.jupyter.widget-view+json": {
1544
- "version_major": 2,
1545
- "version_minor": 0,
1546
- "model_id": "3fe18eeca02d47f79ec7d4df79d5376f"
1547
- }
1548
- },
1549
- "metadata": {}
1550
- }
1551
- ]
1552
  }
1553
  ]
1554
  }
 
11
  },
12
  "language_info": {
13
  "name": "python"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
  },
16
  "cells": [
17
  {
18
  "cell_type": "code",
19
  "source": [
20
+ "##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##\n",
21
+ "\n",
22
+ "# --change log--\n",
23
+ "\"\"\"\n",
24
+ "V3.6 | 13.03.24\n",
25
+ "Fixed selection window\n",
26
+ "Dynamic update of memory display\n",
27
+ "\"\"\"\n",
28
+ "\n",
29
  "\n",
30
  "import os\n",
31
  "import time\n",
 
61
  "\n",
62
  "\n",
63
  "# ==================== CSS ====================\n",
64
+ "CSS_AC = \"\"\"\n",
65
  "<style>\n",
66
  "/* General Styles */\n",
67
  "\n",
 
98
  " position: absolute;\n",
99
  " top: 5px;\n",
100
  " right: 10px;\n",
101
+ " content: \"AutoCleanerV3.6\";\n",
102
  " font-weight: bold;\n",
103
  " font-size: 24px;\n",
104
  " color: rgba(0, 0, 0, 0.2);\n",
 
117
  ".custom-select-multiple_AC select {\n",
118
  " padding: 10px;\n",
119
  " font-family: cursive;\n",
120
+ " border: 1px solid #262626 !important;\n",
121
  " border-radius: 10px;\n",
122
  " color: white;\n",
123
  " background-color: #1c1c1c;\n",
 
234
  "/* Leaving */\n",
235
  ".container_AC.hide {\n",
236
  " animation-name: slideOutTopBlur;\n",
237
+ " animation-duration: 0.3s;\n",
238
  " animation-fill-mode: forwards;\n",
239
  "}\n",
240
  "\n",
 
253
  "</style>\n",
254
  "\"\"\"\n",
255
  "\n",
256
+ "display(HTML(CSS_AC))\n",
257
  "# ==================== CSS ====================\n",
258
  "\n",
259
  "\n",
 
262
  " deleted_files = 0\n",
263
  " for root, dirs, files in os.walk(directory):\n",
264
  " for file in files:\n",
265
+ " if file.endswith((\".txt\", \".yaml\")):\n",
266
+ " continue\n",
267
+ " os.remove(os.path.join(root, file))\n",
268
+ " deleted_files += 1\n",
 
269
  " return deleted_files\n",
270
  "\n",
271
  "\n",
272
  "def get_word_variant(n, variants):\n",
273
  " unit = abs(n) % 10\n",
274
  " tens = abs(n) % 100\n",
 
275
  " if tens in range(11, 15):\n",
276
  " return variants[2]\n",
277
  " elif unit == 1:\n",
278
  " return variants[0]\n",
279
  " elif unit in range(2, 5):\n",
280
  " return variants[1]\n",
281
+ " else:\n",
282
+ " return variants[2]\n",
283
+ "\n",
284
+ "\n",
285
+ "def update_memory_info():\n",
286
+ " disk_space = psutil.disk_usage(os.getcwd())\n",
287
+ " total = disk_space.total / (1024 ** 3)\n",
288
+ " used = disk_space.used / (1024 ** 3)\n",
289
+ " free = disk_space.free / (1024 ** 3)\n",
290
+ "\n",
291
+ " storage_info.value = f'''\n",
292
+ " <div class=\"storage_info_AC\">Всего: {total:.2f} GB <span style=\"color: #555\">|</span> Используется: {used:.2f} GB <span style=\"color: #555\">|</span> Свободно: {free:.2f} GB</div>\n",
293
+ " '''\n",
294
  "\n",
295
  "\n",
296
  "def on_execute_button_press(button):\n",
 
308
  " message_widget = HTML(f'<p class=\"output_message_AC\">{message}</p>')\n",
309
  " display(message_widget)\n",
310
  "\n",
311
+ " update_memory_info()\n",
312
+ "\n",
313
  "\n",
314
  "def on_clear_button_press(button):\n",
315
  " container.add_class(\"hide\")\n",
316
+ " time.sleep(0.5)\n",
317
  " widgets.Widget.close_all()\n",
318
  "\n",
319
  "\n",
 
327
  " \"ControlNet Модели\": [\"ControlNet Модель\", \"ControlNet Модели\", \"ControlNet Моделей\"]\n",
328
  " }\n",
329
  " deleted_word_variants = [\"Удалена\", \"Удалены\", \"Удалено\"]\n",
 
330
  " for key, value in deleted_files_dict.items():\n",
331
  " word_variant = word_variants.get(key, [\"\", \"\", \"\"])\n",
332
  " deleted_word = get_word_variant(value, deleted_word_variants)\n",
333
  " object_word = get_word_variant(value, word_variant)\n",
 
334
  " messages.append(f\"{deleted_word} {value} {object_word}\")\n",
 
335
  " return messages\n",
336
  "# ================ AutoCleaner function ================\n",
337
  "\n",
338
  "\n",
339
  "# --- storage memory ---\n",
340
  "import psutil\n",
341
+ "disk_space = psutil.disk_usage(os.getcwd())\n",
 
342
  "total = disk_space.total / (1024 ** 3)\n",
343
  "used = disk_space.used / (1024 ** 3)\n",
344
  "free = disk_space.free / (1024 ** 3)\n",
 
349
  "instruction_label = widgets.HTML('''\n",
350
  "<span class=\"instruction_AC\">Используйте <span style=\"color: #B2B2B2;\">ctrl</span> или <span style=\"color: #B2B2B2;\">shift</span> для множественного выбора.</span>\n",
351
  "''')\n",
352
+ "auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width=\"auto\")).add_class(\"custom-select-multiple_AC\")\n",
353
  "output = widgets.Output().add_class(\"output_AC\")\n",
354
  "# ---\n",
355
  "execute_button = Button(description='Выполнить Очистку').add_class(\"button_execute_AC\").add_class(\"button_AC\")\n",
 
369
  "display(container)"
370
  ],
371
  "metadata": {
372
+ "id": "I22dFg7F2j3G"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  },
374
  "execution_count": null,
375
+ "outputs": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  }
377
  ]
378
  }
files_cells/python/en/auto-cleaner_en.py CHANGED
@@ -4,13 +4,21 @@
4
  # In[ ]:
5
 
6
 
7
- ##~ AutoCleaner V3.5 CODE | BY: ANXETY ~##
 
 
 
 
 
 
 
 
8
 
9
  import os
10
  import time
11
  import ipywidgets as widgets
12
  from ipywidgets import Label, Button, VBox, HBox
13
- from IPython.display import display, HTML
14
 
15
 
16
  # ================= DETECT ENV =================
@@ -77,7 +85,7 @@ hr {
77
  position: absolute;
78
  top: 5px;
79
  right: 10px;
80
- content: "AutoCleanerV3.5";
81
  font-weight: bold;
82
  font-size: 24px;
83
  color: rgba(0, 0, 0, 0.2);
@@ -96,7 +104,7 @@ hr {
96
  .custom-select-multiple_AC select {
97
  padding: 10px;
98
  font-family: cursive;
99
- border: 1px solid #262626;
100
  border-radius: 10px;
101
  color: white;
102
  background-color: #1c1c1c;
@@ -241,25 +249,35 @@ def clean_directory(directory):
241
  deleted_files = 0
242
  for root, dirs, files in os.walk(directory):
243
  for file in files:
244
- if not file.endswith((".txt", ".yaml")):
245
- file_path = os.path.join(root, file)
246
- os.remove(file_path)
247
- deleted_files += 1
248
-
249
  return deleted_files
250
 
251
 
252
  def get_word_variant(n, variants):
253
  unit = abs(n) % 10
254
  tens = abs(n) % 100
255
-
256
  if tens in range(11, 15):
257
  return variants[2]
258
  elif unit == 1:
259
  return variants[0]
260
  elif unit in range(2, 5):
261
  return variants[1]
262
- return variants[2]
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
 
265
  def on_execute_button_press(button):
@@ -277,10 +295,12 @@ def on_execute_button_press(button):
277
  message_widget = HTML(f'<p class="output_message_AC">{message}</p>')
278
  display(message_widget)
279
 
 
 
280
 
281
  def on_clear_button_press(button):
282
  container.add_class("hide")
283
- time.sleep(0.3)
284
  widgets.Widget.close_all()
285
 
286
 
@@ -294,22 +314,18 @@ def generate_messages(deleted_files_dict):
294
  "ControlNet Models": ["ControlNet Model", "ControlNet Models", "ControlNet Models"]
295
  }
296
  deleted_word_variants = ["Deleted", "Deleted", "Deleted"]
297
-
298
  for key, value in deleted_files_dict.items():
299
  word_variant = word_variants.get(key, ["", "", ""])
300
  deleted_word = get_word_variant(value, deleted_word_variants)
301
  object_word = get_word_variant(value, word_variant)
302
-
303
  messages.append(f"{deleted_word} {value} {object_word}")
304
-
305
  return messages
306
  # ================ AutoCleaner function ================
307
 
308
 
309
  # --- storage memory ---
310
  import psutil
311
- directory = os.getcwd()
312
- disk_space = psutil.disk_usage(directory)
313
  total = disk_space.total / (1024 ** 3)
314
  used = disk_space.used / (1024 ** 3)
315
  free = disk_space.free / (1024 ** 3)
@@ -320,7 +336,7 @@ AutoCleaner_options = AutoCleaner_options = list(directories.keys())
320
  instruction_label = widgets.HTML('''
321
  <span class="instruction_AC">Use <span style="color: #B2B2B2;">ctrl</span> or <span style="color: #B2B2B2;">shift</span> for multiple selections.</span>
322
  ''')
323
- auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='100%')).add_class("custom-select-multiple_AC")
324
  output = widgets.Output().add_class("output_AC")
325
  # ---
326
  execute_button = Button(description='Execute Cleaning').add_class("button_execute_AC").add_class("button_AC")
 
4
  # In[ ]:
5
 
6
 
7
+ ##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##
8
+
9
+ # --change log--
10
+ """
11
+ V3.6 | 13.03.24
12
+ Fixed selection window
13
+ Dynamic update of memory display
14
+ """
15
+
16
 
17
  import os
18
  import time
19
  import ipywidgets as widgets
20
  from ipywidgets import Label, Button, VBox, HBox
21
+ from IPython.display import display, HTML, Javascript
22
 
23
 
24
  # ================= DETECT ENV =================
 
85
  position: absolute;
86
  top: 5px;
87
  right: 10px;
88
+ content: "AutoCleanerV3.6";
89
  font-weight: bold;
90
  font-size: 24px;
91
  color: rgba(0, 0, 0, 0.2);
 
104
  .custom-select-multiple_AC select {
105
  padding: 10px;
106
  font-family: cursive;
107
+ border: 1px solid #262626 !important;
108
  border-radius: 10px;
109
  color: white;
110
  background-color: #1c1c1c;
 
249
  deleted_files = 0
250
  for root, dirs, files in os.walk(directory):
251
  for file in files:
252
+ if file.endswith((".txt", ".yaml")):
253
+ continue
254
+ os.remove(os.path.join(root, file))
255
+ deleted_files += 1
 
256
  return deleted_files
257
 
258
 
259
  def get_word_variant(n, variants):
260
  unit = abs(n) % 10
261
  tens = abs(n) % 100
 
262
  if tens in range(11, 15):
263
  return variants[2]
264
  elif unit == 1:
265
  return variants[0]
266
  elif unit in range(2, 5):
267
  return variants[1]
268
+ else:
269
+ return variants[2]
270
+
271
+
272
+ def update_memory_info():
273
+ disk_space = psutil.disk_usage(os.getcwd())
274
+ total = disk_space.total / (1024 ** 3)
275
+ used = disk_space.used / (1024 ** 3)
276
+ free = disk_space.free / (1024 ** 3)
277
+
278
+ storage_info.value = f'''
279
+ <div class="storage_info_AC">Total storage: {total:.2f} GB <span style="color: #555">|</span> Used: {used:.2f} GB <span style="color: #555">|</span> Free: {free:.2f} GB</div>
280
+ '''
281
 
282
 
283
  def on_execute_button_press(button):
 
295
  message_widget = HTML(f'<p class="output_message_AC">{message}</p>')
296
  display(message_widget)
297
 
298
+ update_memory_info()
299
+
300
 
301
  def on_clear_button_press(button):
302
  container.add_class("hide")
303
+ time.sleep(0.5)
304
  widgets.Widget.close_all()
305
 
306
 
 
314
  "ControlNet Models": ["ControlNet Model", "ControlNet Models", "ControlNet Models"]
315
  }
316
  deleted_word_variants = ["Deleted", "Deleted", "Deleted"]
 
317
  for key, value in deleted_files_dict.items():
318
  word_variant = word_variants.get(key, ["", "", ""])
319
  deleted_word = get_word_variant(value, deleted_word_variants)
320
  object_word = get_word_variant(value, word_variant)
 
321
  messages.append(f"{deleted_word} {value} {object_word}")
 
322
  return messages
323
  # ================ AutoCleaner function ================
324
 
325
 
326
  # --- storage memory ---
327
  import psutil
328
+ disk_space = psutil.disk_usage(os.getcwd())
 
329
  total = disk_space.total / (1024 ** 3)
330
  used = disk_space.used / (1024 ** 3)
331
  free = disk_space.free / (1024 ** 3)
 
336
  instruction_label = widgets.HTML('''
337
  <span class="instruction_AC">Use <span style="color: #B2B2B2;">ctrl</span> or <span style="color: #B2B2B2;">shift</span> for multiple selections.</span>
338
  ''')
339
+ auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='auto')).add_class("custom-select-multiple_AC")
340
  output = widgets.Output().add_class("output_AC")
341
  # ---
342
  execute_button = Button(description='Execute Cleaning').add_class("button_execute_AC").add_class("button_AC")
files_cells/python/ru/auto-cleaner_ru.py CHANGED
@@ -4,7 +4,15 @@
4
  # In[ ]:
5
 
6
 
7
- ##~ AutoCleaner V3.5 CODE | BY: ANXETY ~##
 
 
 
 
 
 
 
 
8
 
9
  import os
10
  import time
@@ -40,7 +48,7 @@ directories = {
40
 
41
 
42
  # ==================== CSS ====================
43
- CSS = """
44
  <style>
45
  /* General Styles */
46
 
@@ -77,7 +85,7 @@ hr {
77
  position: absolute;
78
  top: 5px;
79
  right: 10px;
80
- content: "AutoCleanerV3.5";
81
  font-weight: bold;
82
  font-size: 24px;
83
  color: rgba(0, 0, 0, 0.2);
@@ -96,7 +104,7 @@ hr {
96
  .custom-select-multiple_AC select {
97
  padding: 10px;
98
  font-family: cursive;
99
- border: 1px solid #262626;
100
  border-radius: 10px;
101
  color: white;
102
  background-color: #1c1c1c;
@@ -213,7 +221,7 @@ hr {
213
  /* Leaving */
214
  .container_AC.hide {
215
  animation-name: slideOutTopBlur;
216
- animation-duration: 0.5s;
217
  animation-fill-mode: forwards;
218
  }
219
 
@@ -232,7 +240,7 @@ hr {
232
  </style>
233
  """
234
 
235
- display(HTML(CSS))
236
  # ==================== CSS ====================
237
 
238
 
@@ -241,25 +249,35 @@ def clean_directory(directory):
241
  deleted_files = 0
242
  for root, dirs, files in os.walk(directory):
243
  for file in files:
244
- if not file.endswith((".txt", ".yaml")):
245
- file_path = os.path.join(root, file)
246
- os.remove(file_path)
247
- deleted_files += 1
248
-
249
  return deleted_files
250
 
251
 
252
  def get_word_variant(n, variants):
253
  unit = abs(n) % 10
254
  tens = abs(n) % 100
255
-
256
  if tens in range(11, 15):
257
  return variants[2]
258
  elif unit == 1:
259
  return variants[0]
260
  elif unit in range(2, 5):
261
  return variants[1]
262
- return variants[2]
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
 
265
  def on_execute_button_press(button):
@@ -277,10 +295,12 @@ def on_execute_button_press(button):
277
  message_widget = HTML(f'<p class="output_message_AC">{message}</p>')
278
  display(message_widget)
279
 
 
 
280
 
281
  def on_clear_button_press(button):
282
  container.add_class("hide")
283
- time.sleep(0.3)
284
  widgets.Widget.close_all()
285
 
286
 
@@ -294,22 +314,18 @@ def generate_messages(deleted_files_dict):
294
  "ControlNet Модели": ["ControlNet Модель", "ControlNet Модели", "ControlNet Моделей"]
295
  }
296
  deleted_word_variants = ["Удалена", "Удалены", "Удалено"]
297
-
298
  for key, value in deleted_files_dict.items():
299
  word_variant = word_variants.get(key, ["", "", ""])
300
  deleted_word = get_word_variant(value, deleted_word_variants)
301
  object_word = get_word_variant(value, word_variant)
302
-
303
  messages.append(f"{deleted_word} {value} {object_word}")
304
-
305
  return messages
306
  # ================ AutoCleaner function ================
307
 
308
 
309
  # --- storage memory ---
310
  import psutil
311
- directory = os.getcwd()
312
- disk_space = psutil.disk_usage(directory)
313
  total = disk_space.total / (1024 ** 3)
314
  used = disk_space.used / (1024 ** 3)
315
  free = disk_space.free / (1024 ** 3)
@@ -320,7 +336,7 @@ AutoCleaner_options = AutoCleaner_options = list(directories.keys())
320
  instruction_label = widgets.HTML('''
321
  <span class="instruction_AC">Используйте <span style="color: #B2B2B2;">ctrl</span> или <span style="color: #B2B2B2;">shift</span> для множественного выбора.</span>
322
  ''')
323
- auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='100%')).add_class("custom-select-multiple_AC")
324
  output = widgets.Output().add_class("output_AC")
325
  # ---
326
  execute_button = Button(description='Выполнить Очистку').add_class("button_execute_AC").add_class("button_AC")
 
4
  # In[ ]:
5
 
6
 
7
+ ##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##
8
+
9
+ # --change log--
10
+ """
11
+ V3.6 | 13.03.24
12
+ Fixed selection window
13
+ Dynamic update of memory display
14
+ """
15
+
16
 
17
  import os
18
  import time
 
48
 
49
 
50
  # ==================== CSS ====================
51
+ CSS_AC = """
52
  <style>
53
  /* General Styles */
54
 
 
85
  position: absolute;
86
  top: 5px;
87
  right: 10px;
88
+ content: "AutoCleanerV3.6";
89
  font-weight: bold;
90
  font-size: 24px;
91
  color: rgba(0, 0, 0, 0.2);
 
104
  .custom-select-multiple_AC select {
105
  padding: 10px;
106
  font-family: cursive;
107
+ border: 1px solid #262626 !important;
108
  border-radius: 10px;
109
  color: white;
110
  background-color: #1c1c1c;
 
221
  /* Leaving */
222
  .container_AC.hide {
223
  animation-name: slideOutTopBlur;
224
+ animation-duration: 0.3s;
225
  animation-fill-mode: forwards;
226
  }
227
 
 
240
  </style>
241
  """
242
 
243
+ display(HTML(CSS_AC))
244
  # ==================== CSS ====================
245
 
246
 
 
249
  deleted_files = 0
250
  for root, dirs, files in os.walk(directory):
251
  for file in files:
252
+ if file.endswith((".txt", ".yaml")):
253
+ continue
254
+ os.remove(os.path.join(root, file))
255
+ deleted_files += 1
 
256
  return deleted_files
257
 
258
 
259
  def get_word_variant(n, variants):
260
  unit = abs(n) % 10
261
  tens = abs(n) % 100
 
262
  if tens in range(11, 15):
263
  return variants[2]
264
  elif unit == 1:
265
  return variants[0]
266
  elif unit in range(2, 5):
267
  return variants[1]
268
+ else:
269
+ return variants[2]
270
+
271
+
272
+ def update_memory_info():
273
+ disk_space = psutil.disk_usage(os.getcwd())
274
+ total = disk_space.total / (1024 ** 3)
275
+ used = disk_space.used / (1024 ** 3)
276
+ free = disk_space.free / (1024 ** 3)
277
+
278
+ storage_info.value = f'''
279
+ <div class="storage_info_AC">Всего: {total:.2f} GB <span style="color: #555">|</span> Используется: {used:.2f} GB <span style="color: #555">|</span> Свободно: {free:.2f} GB</div>
280
+ '''
281
 
282
 
283
  def on_execute_button_press(button):
 
295
  message_widget = HTML(f'<p class="output_message_AC">{message}</p>')
296
  display(message_widget)
297
 
298
+ update_memory_info()
299
+
300
 
301
  def on_clear_button_press(button):
302
  container.add_class("hide")
303
+ time.sleep(0.5)
304
  widgets.Widget.close_all()
305
 
306
 
 
314
  "ControlNet Модели": ["ControlNet Модель", "ControlNet Модели", "ControlNet Моделей"]
315
  }
316
  deleted_word_variants = ["Удалена", "Удалены", "Удалено"]
 
317
  for key, value in deleted_files_dict.items():
318
  word_variant = word_variants.get(key, ["", "", ""])
319
  deleted_word = get_word_variant(value, deleted_word_variants)
320
  object_word = get_word_variant(value, word_variant)
 
321
  messages.append(f"{deleted_word} {value} {object_word}")
 
322
  return messages
323
  # ================ AutoCleaner function ================
324
 
325
 
326
  # --- storage memory ---
327
  import psutil
328
+ disk_space = psutil.disk_usage(os.getcwd())
 
329
  total = disk_space.total / (1024 ** 3)
330
  used = disk_space.used / (1024 ** 3)
331
  free = disk_space.free / (1024 ** 3)
 
336
  instruction_label = widgets.HTML('''
337
  <span class="instruction_AC">Используйте <span style="color: #B2B2B2;">ctrl</span> или <span style="color: #B2B2B2;">shift</span> для множественного выбора.</span>
338
  ''')
339
+ auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width="auto")).add_class("custom-select-multiple_AC")
340
  output = widgets.Output().add_class("output_AC")
341
  # ---
342
  execute_button = Button(description='Выполнить Очистку').add_class("button_execute_AC").add_class("button_AC")