mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-23 20:45:33 +03:00
make lint
in glances/cpu_percent.py
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
This commit is contained in:
parent
f92150a4f6
commit
6ea8244906
@ -8,7 +8,7 @@
|
||||
|
||||
"""CPU percent stats shared between CPU and Quicklook plugins."""
|
||||
|
||||
from typing import List, Optional, TypedDict
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
import psutil
|
||||
|
||||
@ -121,7 +121,7 @@ class CpuPercent:
|
||||
def _compute_cpu() -> float:
|
||||
return psutil.cpu_percent(interval=0.0)
|
||||
|
||||
def get_percpu(self) -> List[PerCpuPercentInfo]:
|
||||
def get_percpu(self) -> list[PerCpuPercentInfo]:
|
||||
"""Update and/or return the per CPU list using the psutil library."""
|
||||
# Never update more than 1 time per cached_timer_cpu
|
||||
if self.timer_percpu.finished():
|
||||
@ -131,7 +131,7 @@ class CpuPercent:
|
||||
self.percpu_percent = self._compute_percpu()
|
||||
return self.percpu_percent
|
||||
|
||||
def _compute_percpu(self) -> List[PerCpuPercentInfo]:
|
||||
def _compute_percpu(self) -> list[PerCpuPercentInfo]:
|
||||
psutil_percpu = enumerate(psutil.cpu_times_percent(interval=0.0, percpu=True))
|
||||
return [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user