'Overwrite the getattr method in case of attribute is not found.
The goal is to dynamically generate the following methods:
- getPlugname(): return Plugname stat in JSON format
- getViewsPlugname(): return views of the Plugname stat in JSON format'

def __getattr__(self, item):

    if item.startswith('getViews'):
        plugname = item[len('getViews'):].lower()
        plugin = self._plugins[plugname]
        if hasattr(plugin, 'get_json_views'):
            return getattr(plugin, 'get_json_views')
        else:
            raise AttributeError(item)
    elif item.startswith('get'):
        plugname = item[len('get'):].lower()
        plugin = self._plugins[plugname]
        if hasattr(plugin, 'get_stats'):
            return getattr(plugin, 'get_stats')
        else:
            raise AttributeError(item)
    else:
        raise AttributeError(item)
