@@ -518,18 +518,27 @@ def is_available():
518518
519519
520520class Memory :
521- @staticmethod
522- def stats ():
521+ last_values_memory_swap = []
522+ last_values_memory_virtual = []
523+
524+ @classmethod
525+ def stats (cls ):
523526 memory_stats_theme_data = config .THEME_DATA ['STATS' ]['MEMORY' ]
524527
525528 swap_percent = sensors .Memory .swap_percent ()
529+ save_last_value (swap_percent , cls .last_values_memory_swap ,
530+ memory_stats_theme_data ['SWAP' ]['LINE_GRAPH' ].get ("HISTORY_SIZE" , DEFAULT_HISTORY_SIZE ))
526531 display_themed_progress_bar (memory_stats_theme_data ['SWAP' ]['GRAPH' ], swap_percent )
527532 display_themed_percent_radial_bar (memory_stats_theme_data ['SWAP' ]['RADIAL' ], swap_percent )
533+ display_themed_line_graph (memory_stats_theme_data ['SWAP' ]['LINE_GRAPH' ], cls .last_values_memory_swap )
528534
529535 virtual_percent = sensors .Memory .virtual_percent ()
536+ save_last_value (virtual_percent , cls .last_values_memory_virtual ,
537+ memory_stats_theme_data ['VIRTUAL' ]['LINE_GRAPH' ].get ("HISTORY_SIZE" , DEFAULT_HISTORY_SIZE ))
530538 display_themed_progress_bar (memory_stats_theme_data ['VIRTUAL' ]['GRAPH' ], virtual_percent )
531539 display_themed_percent_radial_bar (memory_stats_theme_data ['VIRTUAL' ]['RADIAL' ], virtual_percent )
532540 display_themed_percent_value (memory_stats_theme_data ['VIRTUAL' ]['PERCENT_TEXT' ], virtual_percent )
541+ display_themed_line_graph (memory_stats_theme_data ['VIRTUAL' ]['LINE_GRAPH' ], cls .last_values_memory_virtual )
533542
534543 display_themed_value (
535544 theme_data = memory_stats_theme_data ['VIRTUAL' ]['USED' ],
@@ -552,17 +561,22 @@ def stats():
552561
553562
554563class Disk :
555- @staticmethod
556- def stats ():
564+ last_values_disk_usage = []
565+
566+ @classmethod
567+ def stats (cls ):
557568 used = sensors .Disk .disk_used ()
558569 free = sensors .Disk .disk_free ()
559570
560571 disk_theme_data = config .THEME_DATA ['STATS' ]['DISK' ]
561572
562573 disk_usage_percent = sensors .Disk .disk_usage_percent ()
574+ save_last_value (disk_usage_percent , cls .last_values_disk_usage ,
575+ disk_theme_data ['USED' ]['LINE_GRAPH' ].get ("HISTORY_SIZE" , DEFAULT_HISTORY_SIZE ))
563576 display_themed_progress_bar (disk_theme_data ['USED' ]['GRAPH' ], disk_usage_percent )
564577 display_themed_percent_radial_bar (disk_theme_data ['USED' ]['RADIAL' ], disk_usage_percent )
565578 display_themed_percent_value (disk_theme_data ['USED' ]['PERCENT_TEXT' ], disk_usage_percent )
579+ display_themed_line_graph (disk_theme_data ['USED' ]['LINE_GRAPH' ], cls .last_values_disk_usage )
566580
567581 display_themed_value (
568582 theme_data = disk_theme_data ['USED' ]['TEXT' ],
@@ -585,25 +599,42 @@ def stats():
585599
586600
587601class Net :
588- @staticmethod
589- def stats ():
590- interval = config .THEME_DATA ['STATS' ]['CPU' ]['PERCENTAGE' ].get ("INTERVAL" , None )
591- upload_wlo , uploaded_wlo , download_wlo , downloaded_wlo = sensors .Net .stats (WLO_CARD , interval )
602+ last_values_wlo_upload = []
603+ last_values_wlo_download = []
604+ last_values_eth_upload = []
605+ last_values_eth_download = []
606+
607+ @classmethod
608+ def stats (cls ):
592609 net_theme_data = config .THEME_DATA ['STATS' ]['NET' ]
610+ interval = net_theme_data .get ("INTERVAL" , None )
611+ upload_wlo , uploaded_wlo , download_wlo , downloaded_wlo = sensors .Net .stats (WLO_CARD , interval )
593612
613+ save_last_value (upload_wlo , cls .last_values_wlo_upload ,
614+ net_theme_data ['WLO' ]['UPLOAD' ]['LINE_GRAPH' ].get ("HISTORY_SIZE" , DEFAULT_HISTORY_SIZE ))
594615 Net ._show_themed_tax_rate (net_theme_data ['WLO' ]['UPLOAD' ]['TEXT' ], upload_wlo )
595616 Net ._show_themed_total_data (net_theme_data ['WLO' ]['UPLOADED' ]['TEXT' ], uploaded_wlo )
617+ display_themed_line_graph (net_theme_data ['WLO' ]['UPLOAD' ]['LINE_GRAPH' ], cls .last_values_wlo_upload )
596618
619+ save_last_value (download_wlo , cls .last_values_wlo_download ,
620+ net_theme_data ['WLO' ]['DOWNLOAD' ]['LINE_GRAPH' ].get ("HISTORY_SIZE" , DEFAULT_HISTORY_SIZE ))
597621 Net ._show_themed_tax_rate (net_theme_data ['WLO' ]['DOWNLOAD' ]['TEXT' ], download_wlo )
598622 Net ._show_themed_total_data (net_theme_data ['WLO' ]['DOWNLOADED' ]['TEXT' ], downloaded_wlo )
623+ display_themed_line_graph (net_theme_data ['WLO' ]['DOWNLOAD' ]['LINE_GRAPH' ], cls .last_values_wlo_download )
599624
600625 upload_eth , uploaded_eth , download_eth , downloaded_eth = sensors .Net .stats (ETH_CARD , interval )
601626
627+ save_last_value (upload_eth , cls .last_values_eth_upload ,
628+ net_theme_data ['ETH' ]['UPLOAD' ]['LINE_GRAPH' ].get ("HISTORY_SIZE" , DEFAULT_HISTORY_SIZE ))
602629 Net ._show_themed_tax_rate (net_theme_data ['ETH' ]['UPLOAD' ]['TEXT' ], upload_eth )
603630 Net ._show_themed_total_data (net_theme_data ['ETH' ]['UPLOADED' ]['TEXT' ], uploaded_eth )
631+ display_themed_line_graph (net_theme_data ['ETH' ]['UPLOAD' ]['LINE_GRAPH' ], cls .last_values_eth_upload )
604632
633+ save_last_value (download_eth , cls .last_values_eth_download ,
634+ net_theme_data ['ETH' ]['DOWNLOAD' ]['LINE_GRAPH' ].get ("HISTORY_SIZE" , DEFAULT_HISTORY_SIZE ))
605635 Net ._show_themed_tax_rate (net_theme_data ['ETH' ]['DOWNLOAD' ]['TEXT' ], download_eth )
606636 Net ._show_themed_total_data (net_theme_data ['ETH' ]['DOWNLOADED' ]['TEXT' ], downloaded_eth )
637+ display_themed_line_graph (net_theme_data ['ETH' ]['DOWNLOAD' ]['LINE_GRAPH' ], cls .last_values_eth_download )
607638
608639 @staticmethod
609640 def _show_themed_total_data (theme_data , amount ):
0 commit comments