def get_name(): valid = False while (not valid): view.clear() view.logo() name = input("Insert your name and surname: ") if (re.match('[a-zA-Z\s]*$', name)): valid = True return name
def text_search_menu(database): view.clear() search_str = input('Input word or phrase to search: ') if view.print_table(database, database.full_text_search(search_str)): return True else: print(f'Cannot find \'{search_str}\'') return True
def generate_customers_menu(database): view.clear() num_to_generate = input('Input a number of customers to generate: ') if int(num_to_generate) <= 0: return False database.generate_random_customers(num_to_generate) return True
def select_menu(database): table_name = input('Input table name: ') if table_name not in database.table_names: return False else: view.clear() view.print_table(database, database.get_from_table(table_name), table_name) return True
def delete_menu(database): view.clear() view.print_table_names(database) table_name = input('Input table name: ') if table_name not in database.table_names: return False else: delete_id = input('Input id to delete: ') database.delete_from_table(table_name, delete_id) return True
def insert_menu(database): view.clear() view.print_table_names(database) table_name = input('Input table name: ') if table_name not in database.table_names: return False else: view.print_column_names(database, table_name) values = input('Input values for columns separeted by space: ').split() database.insert_to_table(table_name, *values) return True
def menu(message): op = 4 while op != '1' and op != '2' and op != '3': view.clear() view.logo() print(message) print('\n\t\t MENU') print('1- Generate wordlist') print('2- Validate password') print('3- Close') op = input('What is your choice number: ') return op
def __init__(self, profile): profile = self.from_dict_to_list(profile) want_finish = False while not want_finish: view.clear() if (not self.is_weak(profile)): print("Congratulations, this passwords looks fine.") op = "C" while (op.lower() != 'n' or op.lower() != 'y'): op = input("Do you want to try another password? Y/N ") if(op.lower() == 'n' or op.lower() == 'y'): break if(op.lower() == "n"): want_finish = True
def get_by_menu(database): view.clear() view.print_get_by_menu() choice = input('Input your choice: ') while True: while choice == '1': view.clear() min_core = input('Input min core value: ') max_core = input('Input max core value: ') if (int(min_core) < 0 or int(max_core) < 0 or int(min_core) > int(max_core)): print('Wrong values!') time.sleep(1) else: view.print_table( database, database.get_videocards_by_core(min_core, max_core)) return True while choice == '2': view.clear() vendors = input('Input vendor separeted by space: ').split() print(vendors) view.print_table(database, database.get_videocards_by_vendors(vendors)) return True while choice == '3': return False
def clear(): return view.clear()
def draw(self): for view in self.views: view.clear() return [member.draw() for member in self.members]
def validate_url(url): domain = 'https://pt-br.facebook.com/' if (not ((url.find(domain) == 0) or url == '')): view.clear() print("\t The URL must be in this format: https://pt-br.facebook.com/") return ((url.find(domain) == 0) or url == '')
op = 4 while op != '1' and op != '2' and op != '3': view.clear() view.logo() print(message) print('\n\t\t MENU') print('1- Generate wordlist') print('2- Validate password') print('3- Close') op = input('What is your choice number: ') return op if __name__ == "__main__": view.clear() view.logo() url = get_URL() profile = {} if (url != ''): profile = fs.scraping(url) else: profile["name"] = get_name() get_information(profile) view.clear() view.show_info(profile) finish = False t = Combinations(profile) info = t.info op = menu('')