Skip to content

Commit 4245589

Browse files
Removal of the backup feature
git should be the one we focus on and use, all history is preserved, and the --backup feature bloats the code Signed-off-by: Shahm Najeeb <[email protected]>
1 parent 96b64b6 commit 4245589

File tree

3 files changed

+1
-49
lines changed

3 files changed

+1
-49
lines changed

CODE/Logicytics.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
import gc
44
import os
5-
import shutil
65
import subprocess
76
import sys
8-
import zipfile
97
from concurrent.futures import ThreadPoolExecutor, as_completed
108
from datetime import datetime
119

@@ -254,36 +252,6 @@ def __performance(self):
254252

255253

256254
class SpecialAction:
257-
@staticmethod
258-
def backup(directory: str, name: str):
259-
"""
260-
Creates a backup of a specified directory by zipping its contents and moving it to a designated backup location.
261-
262-
Args:
263-
directory (str): The path to the directory to be backed up.
264-
name (str): The name of the backup file.
265-
266-
Returns:
267-
None
268-
"""
269-
if not os.path.exists(directory):
270-
log.critical(f"Directory {directory} does not exist!")
271-
return
272-
273-
# Check if backup exists, delete it if so
274-
if os.path.exists(f"../ACCESS/BACKUP/{name}.zip"):
275-
os.remove(f"../ACCESS/BACKUP/{name}.zip")
276-
277-
# Zip the directory and move it to the backup location
278-
with zipfile.ZipFile(f"{name}.zip", "w") as zip_file:
279-
for root, dirs, files in os.walk(directory):
280-
for file in files:
281-
file_path = os.path.join(root, file)
282-
relative_path = os.path.relpath(str(file_path), start=os.getcwd())
283-
zip_file.write(str(file_path), arcname=relative_path)
284-
285-
shutil.move(f"{name}.zip", "../ACCESS/BACKUP")
286-
287255
@staticmethod
288256
def update() -> tuple[str, str]:
289257
"""
@@ -407,16 +375,6 @@ def handle_special_actions():
407375
input("Press Enter to exit...")
408376
exit(1)
409377

410-
if ACTION == "backup":
411-
log.info("Backing up...")
412-
SpecialAction.backup(".", "Default_Backup")
413-
log.debug("Backup complete -> CODE dir")
414-
SpecialAction.backup("../MODS", "Mods_Backup")
415-
log.debug("Backup complete -> MODS dir")
416-
log.info("Backup complete!")
417-
input("Press Enter to exit...")
418-
exit(0)
419-
420378

421379
def check_privileges():
422380
"""

CODE/logicytics/Flag.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,6 @@ def __available_arguments(cls) -> tuple[argparse.Namespace, argparse.ArgumentPar
487487
f"{cls.__colorify('- Use to get a special log file to report the bug -', 'b')}.",
488488
)
489489

490-
parser.add_argument(
491-
"--backup",
492-
action="store_true",
493-
help="Backup Logicytics files to the ACCESS/BACKUPS directory "
494-
f"{cls.__colorify('- Use on your own device only -', 'y')}.",
495-
)
496-
497490
parser.add_argument(
498491
"--update",
499492
action="store_true",

CODE/vulnscan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import aiofiles
99
import joblib
1010
import numpy as np
11+
# noinspection PyPackageRequirements
1112
import torch
1213
from pathlib import Path
1314
from safetensors import safe_open

0 commit comments

Comments
 (0)