diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 170b148..933a6f5 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -18,3 +18,8 @@ #### Version 1.2.1 - Added more characters allowed in the passwords + +#### Version 1.2.2 + +- Updated readme +- You can now only enter integers in the character limits field diff --git a/Mango.py b/Mango.py index d5f869e..fa1c966 100644 --- a/Mango.py +++ b/Mango.py @@ -31,34 +31,38 @@ def generatePassword(): if userInput.get() == "": completedPassword.insert(1.0,"Please enter a number") else: - numberOfCharacters = int(userInput.get()) - if numberOfCharacters > 7 and numberOfCharacters < 33: - password = [None] * numberOfCharacters - for index, values in enumerate(password): - passwordReceived = returnNumber() #65 and 122 - passwordChar = chr(passwordReceived) - password[index] = passwordChar - generatedPassword = ''.join(password) - print("Original password:",generatedPassword) - asciiString = "/0123456789:;<=>?@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]\^_`{|}~" - countedInt = 0 - for values in userExcludeInput.get(): - if values in asciiString: - countedInt += 1 - print("Counted int is:",countedInt) - if countedInt == 80: - generatedPassword = "nice try" - else: - for values in generatedPassword: - if values in userExcludeInput.get(): - newlyReplaced = chr(returnNumber()) - while newlyReplaced in userExcludeInput.get(): + try: + + numberOfCharacters = int(userInput.get()) + if numberOfCharacters > 7 and numberOfCharacters < 33: + password = [None] * numberOfCharacters + for index, values in enumerate(password): + passwordReceived = returnNumber() #65 and 122 + passwordChar = chr(passwordReceived) + password[index] = passwordChar + generatedPassword = ''.join(password) + print("Original password:",generatedPassword) + asciiString = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@[]^_`{|}~:;<=>?/\\" + countedInt = 0 + for values in userExcludeInput.get(): + if values in asciiString: + countedInt += 1 + print("Counted int is:",countedInt) + if countedInt == 80: + generatedPassword = "nice try" + else: + for values in generatedPassword: + if values in userExcludeInput.get(): newlyReplaced = chr(returnNumber()) - print("Replaced", values,"with",newlyReplaced) - generatedPassword = generatedPassword.replace(values, newlyReplaced) - completedPassword.insert(1.0,generatedPassword) - else: - completedPassword.insert(1.0,'Please enter a valid number 8-32') + while newlyReplaced in userExcludeInput.get(): + newlyReplaced = chr(returnNumber()) + print("Replaced", values,"with",newlyReplaced) + generatedPassword = generatedPassword.replace(values, newlyReplaced) + completedPassword.insert(1.0,generatedPassword) + else: + completedPassword.insert(1.0,'Please enter a valid number 8-32') + except ValueError: + completedPassword.insert(1.0,'Please enter only integer values.') completedPassword.configure(state='disabled') diff --git a/README.md b/README.md index 3c4dffd..e8d85a0 100644 --- a/README.md +++ b/README.md @@ -1 +1,34 @@ -# MangoPasswordGenerator \ No newline at end of file +# Mango + +--- + +A simple, easy to use password generator written in Python + +## Geting Started + +### Character Limits + +The first input field is where you specify how many characters you would like to make the password. +**_We have hard limits of minimum 8 characters and maximum of 32 characters._** +If you enter a value that is not within this range, you will see that the program does not let you generate a password. +You are only allowed to enter numerical values into this field. (**0-9**) + +### Exclusions + +You may specify to the program certain characters you would like excluded from the final generated password. + +The current list of available characters that the program can generate are as follows: + +- All numbers **[0-9]** +- Uppercase letters **[A-Z]** +- Lowercase letters **[a-z]** +- Various Symbols **[@[]^\_`{|}~:;<=>?/\\]** + +### Generating the password + +The program will output the password in a text field that will allow you to copy onto the clipboard. + +### License + +This software uses the GPL-3.0 license. +You can read more about it [here](https://github.com/BlueberryTechnologies/Mango?tab=GPL-3.0-1-ov-file#).