'Update stats to a server.
The method builds two lists: names and values
and calls the export method to export the stats.
Be aware that CSV export overwrite this class and use a specific one.'

def update(self, stats):

    if (not self.export_enable):
        return False
    all_stats = stats.getAllExportsAsDict(plugin_list=self.plugins_to_export())
    all_limits = stats.getAllLimitsAsDict(plugin_list=self.plugins_to_export())
    for plugin in self.plugins_to_export():
        if isinstance(all_stats[plugin], dict):
            all_stats[plugin].update(all_limits[plugin])
        elif isinstance(all_stats[plugin], list):
            for i in all_stats[plugin]:
                i.update(all_limits[plugin])
        else:
            continue
        (export_names, export_values) = self.__build_export(all_stats[plugin])
        self.export(plugin, export_names, export_values)
    return True
