Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
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
Esempio n. 6
0
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
Esempio n. 7
0
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
Esempio n. 8
0
 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
Esempio n. 9
0
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
Esempio n. 10
0
def clear():
    return view.clear()
Esempio n. 11
0
 def draw(self):
     for view in self.views:
         view.clear()
     return [member.draw() for member in self.members]
Esempio n. 12
0
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 == '')
Esempio n. 13
0
    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('')