mirror of https://github.com/nicolargo/glances.git
Remove future dep
This commit is contained in:
parent
750f33f5b1
commit
d80a9cf229
|
|
@ -32,7 +32,7 @@ The return string is a string with one or more line (\n between lines).
|
|||
If the *one_line* var is true then the AMP will be displayed in one line.
|
||||
"""
|
||||
|
||||
from glances.globals import u, b, n, nativestr
|
||||
from glances.globals import u, b, nativestr
|
||||
from glances.timer import Timer
|
||||
from glances.logger import logger
|
||||
|
||||
|
|
|
|||
|
|
@ -137,13 +137,6 @@ def b(s, errors='replace'):
|
|||
return s.encode('utf-8', errors=errors)
|
||||
|
||||
|
||||
def n(s):
|
||||
'''Only in Python 2...
|
||||
from future.utils import bytes_to_native_str as n
|
||||
'''
|
||||
return s
|
||||
|
||||
|
||||
def nativestr(s, errors='replace'):
|
||||
if isinstance(s, text_type):
|
||||
return s
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"""Disk I/O plugin."""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from glances.globals import nativestr, n
|
||||
from glances.globals import nativestr
|
||||
from glances.timer import getTimeSinceLastUpdate
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
from glances.logger import logger
|
||||
|
|
@ -110,7 +110,7 @@ class Plugin(GlancesPlugin):
|
|||
try:
|
||||
diskstat = {
|
||||
'time_since_update': time_since_update,
|
||||
'disk_name': n(disk),
|
||||
'disk_name': disk,
|
||||
'read_count': diskio[disk].read_count - \
|
||||
self.diskio_old[disk].read_count,
|
||||
'write_count': diskio[disk].write_count - \
|
||||
|
|
@ -123,7 +123,7 @@ class Plugin(GlancesPlugin):
|
|||
except (KeyError, AttributeError):
|
||||
diskstat = {
|
||||
'time_since_update': time_since_update,
|
||||
'disk_name': n(disk),
|
||||
'disk_name': disk,
|
||||
'read_count': 0,
|
||||
'write_count': 0,
|
||||
'read_bytes': 0,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import base64
|
|||
|
||||
from glances.timer import getTimeSinceLastUpdate
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
from glances.globals import n
|
||||
from glances.logger import logger
|
||||
|
||||
import psutil
|
||||
|
|
@ -165,8 +164,8 @@ class Plugin(GlancesPlugin):
|
|||
rx = cumulative_rx - self.network_old[net].bytes_recv
|
||||
tx = cumulative_tx - self.network_old[net].bytes_sent
|
||||
cx = rx + tx
|
||||
netstat = {'interface_name': n(net),
|
||||
'alias': self.has_alias(n(net)),
|
||||
netstat = {'interface_name': net,
|
||||
'alias': self.has_alias(net),
|
||||
'time_since_update': time_since_update,
|
||||
'cumulative_rx': cumulative_rx,
|
||||
'rx': rx,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
psutil>=5.3.0
|
||||
defusedxml
|
||||
future
|
||||
packaging
|
||||
Loading…
Reference in New Issue