Graph export is broken if there is no graph section in Glances configuration file #2839

issue2851
nicolargo 2024-06-22 10:37:00 +02:00
parent f5ecbf7a1f
commit 2ee3c86e2b
1 changed files with 6 additions and 4 deletions

View File

@ -34,10 +34,12 @@ class Export(GlancesExport):
# Manage options (command line arguments overwrite configuration file) # Manage options (command line arguments overwrite configuration file)
self.path = args.export_graph_path or self.path self.path = args.export_graph_path or self.path
self.generate_every = int(getattr(self, 'generate_every', 0)) self.generate_every = int(getattr(self, 'generate_every', 0) or 0)
self.width = int(getattr(self, 'width', 800)) self.width = int(getattr(self, 'width', 800) or 800)
self.height = int(getattr(self, 'height', 600)) self.height = int(getattr(self, 'height', 600) or 600)
self.style = getattr(pygal.style, getattr(self, 'style', 'DarkStyle'), pygal.style.DarkStyle) self.style = (
getattr(pygal.style, getattr(self, 'style', 'DarkStyle'), pygal.style.DarkStyle) or pygal.style.DarkStyle
)
# Create export folder # Create export folder
try: try: