Ejemplo n.º 1
0
    def modify_password(self):
        os.system('clear')
        print(color.BOLD + color.RED + 'Modify Password'.center(30) +
              color.END)
        print('')

        if self.select():
            if input('Want to generate Password (Y/N): ').lower() == 'y':
                password_generator.main()

            new_pass = input('New Password : ')
            sql.modify(self.username, self.website, self.account, new_pass)
Ejemplo n.º 2
0
def main():
    while True:

        os.system('clear')
        print(color.BOLD + color.GREEN + color.UNDERLINE +
              'Password Manager'.center(30) + color.END)
        print('')
        print('1. Login')
        print('2. Sign Up')
        print('3. Generate a strong password')
        print('4. Check my password if secure')
        print('5. Exit')

        ch = input().lower()

        if ch == '1' or ch == 'login':
            user.user_login()

        elif ch == '2' or ch == 'sign':
            user.user_signup()

        elif ch == '3' or ch == 'generate':

            password_generator.main()

        elif ch == '4' or ch == 'check':
            password_checker.main()

        elif ch == '5' or ch == 'exit':
            return

        else:
            print('Invalid Choice!')

        print('Want to Exit Program (Y/N) : ', end='')
        en = input().lower()

        if en == 'y':
            return
        else:
            pass
Ejemplo n.º 3
0
    def main(self):

        while True:
            os.system('clear')
            print(color.BOLD + color.RED + self.username.center(30) +
                  color.END)
            print('')
            print('1. Add Password')
            print('2. Delete a Password')
            print('3. Modify a Password')
            print('4. Show Password')
            print('5. Generate a strong password')
            print('6. Check my password if secure')
            print('7. Log out')

            ch = input().lower()

            if ch == '1' or ch == 'add':
                self.add_password()
            elif ch == '2' or ch == 'delete':
                self.delete_password()
            elif ch == '3' or ch == 'modify':
                self.modify_password()
            elif ch == '4' or ch == 'show':
                self.show_password()
            elif ch == '5' or ch == 'generate':
                password_generator.main()
            elif ch == '6' or ch == 'check':
                password_checker.main()
            elif ch == '7' or ch == 'exit':
                return
            else:
                print('Invalid Choice!')

            en = input("'Y' to Log out, or press Enter....").lower()

            if en == 'y':
                return
            else:
                pass
Ejemplo n.º 4
0
def main():
	"""
	Main module for all others, presents menus in loops for easy end-user accessibility and
	re-usability.
	:return:
	:rtype:
	"""
	# Try statement for catching errors
	try:
		# Continuous while loop that keeps the program going indefinitely
		while True:
			# Prints a long yellow line to separate sections of the menu
			my_tools.print_lines()
			# Program's banner, containing the name, version and date
			print(
				"\t\t\t\t\t\t\t",
				my_tools.PyColors.bold,
				my_tools.PyColors.Fg.light_yellow,
				" <<< Dashboard >>>",
				my_tools.PyColors.reset,
				"\n\n\t\t\t\t\t",
				my_tools.PyColors.Fg.light_green,
				"  Project Version <|> Last Updated\n\t\t\t\t\t\t\t",
				"  0.0.5         12/05/2020",
				my_tools.PyColors.reset
			)

			# Presents the user with a menu of options to choose from
			first_choice = input(
				"\n 1) General"
				"\n 2) Game of Chance"
				"\n 3) Release Notes"
				"\n 4) Quit"
				"\n\n Please select from one of the options listed above (1-4): "
			).strip()

			#
			if first_choice == "1":
				while True:
					my_tools.print_lines()
					print(
						"\t\t\t\t\t\t\t\t ",
						my_tools.PyColors.bold,
						my_tools.PyColors.Fg.dark_green,
						"General Module",
						my_tools.PyColors.reset
					)

					second_choice = input(
						"\n 1) Password Generator"
						"\n 2) Coin Flip"
						"\n 3) Random Number Generator"
						"\n 4) Calculator"
						"\n 5) Return To Main Menu"
						"\n\n Please select from one of the options listed above (1-5): "
					).strip()

					#
					if second_choice == "1":
						password_generator.main()

					#
					elif second_choice == "2":
						coin_flip.main()

					#
					elif second_choice == "3":
						random_number.main()

					#
					elif second_choice == "4":
						calculator.main()

					# Returns the user to the main menu
					elif second_choice == "5":
						break

			#
			elif first_choice == "2":

				#
				while True:
					my_tools.print_lines()
					print(
						"\n\t\t\t ",
						my_tools.PyColors.Bg.light_blue,
						"Test 2 Module",
						my_tools.PyColors.reset
					)
					second_choice = input(
						"\n 1) Test 1"
						"\n 2) Test 2"
						"\n 3) About Module"
						"\n 4) Return To Main Menu"
						"\n\n Please select from one of the options listed above (1-4): "
					).strip()
					try:
						#
						if int(second_choice) in range(1, 3):
							# Test.Test(second_choice)
							pass

						#
						elif second_choice == "3":
							# Test.Test.about_module()
							pass

						# Returns to the previous menu
						elif second_choice == "4":
							break

					# Protects the program from erroneous data being entered
					except ValueError:
						continue

			# How to section on reporting any issues with this program
			elif first_choice == "3":
				my_tools.print_lines()
				print(
					"\n\t\t\t ",
					my_tools.PyColors.Bg.light_blue,
					"Version 0.0.0 Release Notes",
					my_tools.PyColors.reset,
					"\n\n New Features:"
					"\n"
				)
				input("\n\n Press enter to continue...").strip()
				continue

			# Enables to user to exit the program without a keyboard interrupt
			elif first_choice == "4":
				print("\n\n ...Exiting program\n\n")
				sys.exit(0)

	# Gracefully ends the program when the user hits the 'control + c' keys
	except KeyboardInterrupt:
		print("\n\n ...Exiting program\n\n")
		sys.exit(0)
Ejemplo n.º 5
0
from password_generator import main

password = main()
print("Password Generated Successfully!")
print(f"Password:\n{password}")