mirror of
https://github.com/nicolargo/glances.git
synced 2024-09-11 12:47:14 +03:00
Merge branch 'issue2776' into develop
This commit is contained in:
commit
05bc1449db
@ -13,18 +13,20 @@ import psutil
|
|||||||
|
|
||||||
from glances.logger import logger
|
from glances.logger import logger
|
||||||
from glances.plugins.plugin.model import GlancesPluginModel
|
from glances.plugins.plugin.model import GlancesPluginModel
|
||||||
|
from glances.globals import LINUX
|
||||||
|
|
||||||
# Batinfo library (optional; Linux-only)
|
# Batinfo library (optional; Linux-only)
|
||||||
batinfo_tag = True
|
if LINUX:
|
||||||
try:
|
batinfo_tag = True
|
||||||
import batinfo
|
try:
|
||||||
except ImportError:
|
import batinfo
|
||||||
logger.debug("batinfo library not found. Fallback to psutil.")
|
except ImportError:
|
||||||
|
logger.debug("batinfo library not found. Fallback to psutil.")
|
||||||
|
batinfo_tag = False
|
||||||
|
else:
|
||||||
batinfo_tag = False
|
batinfo_tag = False
|
||||||
|
|
||||||
# Availability:
|
# PsUtil Sensors_battery available on Linux, Windows, FreeBSD, macOS
|
||||||
# Linux, Windows, FreeBSD (psutil>=5.1.0)
|
|
||||||
# macOS (psutil>=5.4.2)
|
|
||||||
psutil_tag = True
|
psutil_tag = True
|
||||||
try:
|
try:
|
||||||
psutil.sensors_battery()
|
psutil.sensors_battery()
|
||||||
|
Loading…
Reference in New Issue
Block a user