import pyperclip

class User:
    '''
    Class that generates new instances of users
    '''
    lock_list = [] # Empty lock list

    def __init__(self,identity,data_id,website,weblogin,name):
        self.identity = identity
        self.data_id = data_id
        self.website = website
        self.weblogin = weblogin
        self.name = name


    def save_password(self):

        '''
        save_password method saves user objects into lock_list
        '''

        User.lock_list.append(self)
    
    @classmethod
    def display_data(cls,number,counter):
        '''
        display all passwords generated by the user
        '''
        for password in cls.lock_list:
            if password.identity == number:
                if password.data_id == counter:
                    return password
    
    @classmethod
    def existing_data(cls,number):
        '''
        Checks if data exists in the profile
        '''
        for data in cls.lock_list:
            if data.identity == number:
                return True 
        return False


class Credentials:
    '''
    Class that generates new instances of users
    '''
    user_list=[]

    def __init__(self, identify, user_name, password):
        '''
        __init__ method that helps us define properties for our objects.
        '''
        self.identify = identify
        self.user_name = user_name
        self.password = password

    def create_account(self):
        '''
        create_account method that creates credentials for the various users
        '''
        Credentials.user_list.append(self)

    @classmethod
    def authenticate_account(cls, name, lock):
        '''
        Method that checks if the username and password are correct
        '''
        for user in cls.user_list:
            if user.user_name == name and user.password == lock:
                return user
        return 0


   