'''
Created on 30-Jun-2020

@author: Rishi Priyansh
'''
class _Base:
    def __init__(self, **args):
        
        for k, v in args.items():
            setattr(self, k, v)
            
        self.keys = args.keys()
        if not args.get('verbose', None):
            list(self.keys).append('verbose')
            self.verbose = False
            pass
        
            
        if self.verbose:
            print("\n{}".format(self))
            pass
        pass
    #def __init__(self, verbose = False):

    def __str__(self):
        s = type(self).__name__ + ":"
            
        if len(self.keys) > 0:
            for k in self.keys:
                value = getattr(self, k)
                s = s + "\n" + "  " + "{}:\t{}".format(k, value)
        
        s = s + "\n"
        return s
        pass 
    #def __str__(self):
    

    pass
#class _Base:
