Esempio n. 1
0
    def __init__(self, args=None):
        """
        Init the plugin.
        """
        UnicornPlugin.__init__(self, args=args)

        # Init stats
        self.reset()
Esempio n. 2
0
    def __init__(self, args=None):
        """Init the plugin."""
        UnicornPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Init the stats
        self.reset()
Esempio n. 3
0
    def __init__(self, args=None):
        """Init the plugin."""
        UnicornPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        self._cpu_number = psutil.cpu_count()

        # Init stats
        self.reset()
Esempio n. 4
0
    def __init__(self, args=None):
        """Init the plugin."""
        UnicornPlugin.__init__(self, args=args)

        # Init the sensor class
        self.glancesgrabhddtemp = GlancesGrabHDDTemp(args=args)

        # We do not want to display the stat in a dedicated area
        # The HDD temp is displayed within the sensors plugin
        self.display_curse = False

        # Init stats
        self.reset()
Esempio n. 5
0
    def update_views(self):
        """Update stats views."""
        # Call the father's method
        UnicornPlugin.update_views(self)

        # Add specifics informations
        # Alert
        for i in self.stats:
            ifrealname = i['interface_name'].split(':')[0]
            self.views[i[self.get_key()]]['rx']['decoration'] = self.get_alert(
                int(i['rx'] // i['time_since_update'] * 8),
                header=ifrealname + '_rx')
            self.views[i[self.get_key()]]['tx']['decoration'] = self.get_alert(
                int(i['tx'] // i['time_since_update'] * 8),
                header=ifrealname + '_tx')
Esempio n. 6
0
    def update_views(self):
        """Update stats views."""
        # Call the father's method
        UnicornPlugin.update_views(self)

        # Add specifics informations
        # Alert
        for i in self.stats:
            if not i['value']:
                continue
            if i['type'] == 'battery':
                self.views[i[
                    self.get_key()]]['value']['decoration'] = self.get_alert(
                        100 - i['value'], header=i['type'])
            else:
                self.views[i[
                    self.get_key()]]['value']['decoration'] = self.get_alert(
                        i['value'], header=i['type'])
Esempio n. 7
0
    def __init__(self, args=None):
        """Init the plugin."""
        UnicornPlugin.__init__(self, args=args)

        # Init the sensor class
        self.glancesgrabsensors = GlancesGrabSensors()

        # Instance for the HDDTemp Plugin in order to display the hard disks
        # temperatures
        self.hddtemp_plugin = HddTempPlugin(args=args)

        # Instance for the BatPercent in order to display the batteries
        # capacities
        self.batpercent_plugin = BatPercentPlugin(args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Init the stats
        self.reset()