Rename export folder to avoid error of the dep lib use inside an export plugin has the same name: for example csv, use the python lib csv...

This commit is contained in:
nicolargo 2024-03-30 18:24:31 +01:00
parent ae596610ff
commit 24a3aead9d
20 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ class GlancesExport(object):
def __init__(self, config=None, args=None):
"""Init the export class."""
# Export name (= module name without glances_)
# Export name
self.export_name = self.__class__.__module__
logger.debug("Init export module %s" % self.export_name)

View File

@ -142,12 +142,6 @@ class GlancesStandalone(object):
self.stats.update()
logger.debug('Stats updated duration: {} seconds'.format(counter.get()))
# Export stats
# Start a counter used to compute the time needed
counter_export = Counter()
self.stats.export(self.stats)
logger.debug('Stats exported duration: {} seconds'.format(counter_export.get()))
# Patch for issue1326 to avoid < 0 refresh
adapted_refresh = self.refresh_time - counter.get()
adapted_refresh = adapted_refresh if adapted_refresh > 0 else 0
@ -164,6 +158,12 @@ class GlancesStandalone(object):
time.sleep(adapted_refresh)
ret = True
# Export stats
# Start a counter used to compute the time needed
counter_export = Counter()
self.stats.export(self.stats)
logger.debug('Stats exported duration: {} seconds'.format(counter_export.get()))
return ret
def serve_n(self, n=1):