Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ibehii authored Sep 10, 2023
1 parent 964dd2c commit 09a9fee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PasswordGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def __exists_checker__(FilePath) -> None:
font='ANSI Shadow') + Fore.RESET)

# ======== # getting all file name from user # ======== #
all_password_list_contents: list = list()
FilesContents: list = list()
try:
file_name: str = input(
Fore.MAGENTA + '\n1 - Enter your file path -> ' + Fore.RESET)
Expand All @@ -480,7 +480,7 @@ def __exists_checker__(FilePath) -> None:
exit(Fore.RED + f'We don\'t have permission to read the {file_name} file' + Fore.RESET)
#The last line doesn't have \n so when it sorted it will connect to another item
FileData[-1] +='\n'
all_password_list_contents.extend(FileData)
FilesContents.extend(FileData)

# getting name of the file from user
input_number = 2
Expand All @@ -504,7 +504,7 @@ def __exists_checker__(FilePath) -> None:
#The last line doesn't have \n so when it sorted it will connect to another item
FileData[-1] = FileData[-1] +'\n'

all_password_list_contents.extend(FileData)
FilesContents.extend(FileData)
user_request: str = input(
Fore.YELLOW + '\nWant to add more password list ? [Y/n] ' + Fore.RESET)
if user_request.lower() == 'y' or user_request.lower() == 'yes' or user_request == '':
Expand All @@ -521,7 +521,7 @@ def __exists_checker__(FilePath) -> None:
if path.exists(__file__.replace('PasswordGenerator.py', 'passwords.txt')):
__rename_if_file_exist__()
with open(__file__.replace('PasswordGenerator.py', file_name), 'w') as f:
f.writelines(all_password_list_contents)
f.writelines(FilesContents)

print(Fore.YELLOW + 'Your file save as : ' + __file__.replace('PasswordGenerator.py', file_name) + Fore.RESET)
print(Fore.GREEN + 'Done !' + Fore.RESET)
Expand Down

0 comments on commit 09a9fee

Please sign in to comment.