Code Duplication    Length = 14-14 lines in 2 locations

glances/plugins/glances_cpu.py 1 location

@@ 62-75 (lines=14) @@
59
    percentage.
60
    """
61
62
    def __init__(self, args=None, config=None):
63
        """Init the CPU plugin."""
64
        super(Plugin, self).__init__(args=args,
65
                                     config=config,
66
                                     items_history_list=items_history_list)
67
68
        # We want to display the stat in the curse interface
69
        self.display_curse = True
70
71
        # Call CorePlugin in order to display the core number
72
        try:
73
            self.nb_log_core = CorePlugin(args=self.args).update()["log"]
74
        except Exception:
75
            self.nb_log_core = 1
76
77
    @GlancesPlugin._check_decorator
78
    @GlancesPlugin._log_result_decorator

glances/plugins/glances_load.py 1 location

@@ 53-66 (lines=14) @@
50
    stats is a dict
51
    """
52
53
    def __init__(self, args=None, config=None):
54
        """Init the plugin."""
55
        super(Plugin, self).__init__(args=args,
56
                                     config=config,
57
                                     items_history_list=items_history_list)
58
59
        # We want to display the stat in the curse interface
60
        self.display_curse = True
61
62
        # Call CorePlugin in order to display the core number
63
        try:
64
            self.nb_log_core = CorePlugin(args=self.args).update()["log"]
65
        except Exception:
66
            self.nb_log_core = 1
67
68
    def _getloadavg(self):
69
        """Get load average. On both Linux and Windows thanks to PsUtil"""