Testing: Cleanup Module

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2023-12-13 11:00:09 +09:00
parent 9ea7cd57e0
commit 88658b7230
1 changed files with 23 additions and 25 deletions

View File

@ -39,32 +39,29 @@ def make_check_sum():
def check_build_type_xfce():
""" Decided which ISO needs to be moved for XFCE """
os.chdir(HOME_FOLDER + FUSATO_ROOT)
look_for_file = ['deb.64xfc', 'deb.32xfc', 'deb.armxfc',
'dev.64xfc', 'dev.32xfc', 'dev.armxfc'
]
def look_for_files(directory_path):
look_for_file = ['deb.64xfc', 'deb.32xfc', 'deb.armxfc',
'dev.64xfc', 'dev.32xfc', 'dev.armxfc'
]
def check_debian_xfce():
""" Check is a debian build is needed """
for build_version in look_for_file:
if build_version == look_for_file[0]:
check_path = Path(build_version)
if check_path.is_file():
process_deb_64_xfce()
break
elif build_version == look_for_file[1]:
check_path = Path(build_version)
if check_path.is_file():
process_deb_32_xfce()
break
elif build_version == look_for_file[2]:
check_path = Path(build_version)
if check_path.is_file():
process_deb_arm_xfce()
break
""" Check i a debian build is needed """
for file_name in look_for_file:
file_path = os.path.join(directory_path, file_name)
if os.path.exists(file_path):
# Execute the corresponding function based on the file name
function_name = f"process_{file_name.replace('.', '_')}"
function_to_call = globals().get(function_name)
if function_to_call is not None and callable(function_to_call):
function_to_call()
else:
check_devuan_xfce()
break
print(f"Function {function_name} not defined.")
else:
print(f"File {file_name} not found. Need to wait.")
def check_devuan_xfce():
@ -86,10 +83,11 @@ def check_build_type_xfce():
process_dev_arm_xfce()
break
else:
print("Nothing to do")
print("Nothing to do for Devuan")
break
check_debian_xfce()
def check_build_type_gfb():
""" Decided which ISO needs to be moved for gfb """
os.chdir(HOME_FOLDER + FUSATO_ROOT)
@ -442,7 +440,7 @@ def process_dev_arm_gfb():
shutil.copy(rdes_sum, des_sum)
# Debian OpenBox
def copy_debian_opb_based():
""" Copy the new ISO debian base to its Nightly folder
OpenBox
@ -506,7 +504,7 @@ def copy_debian_opb_based():
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
# Devuan OpenBox
def copy_devuan_opb_based():
""" Copy the new ISO devuan base to its Nightly folder
OpenBox