mirror of
https://github.com/nicolargo/glances.git
synced 2026-03-13 11:28:12 -04:00
Correct issue on Python 3
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
"""Disk I/O plugin."""
|
||||
|
||||
from glances.compat import b
|
||||
from glances.compat import nativestr
|
||||
from glances.timer import getTimeSinceLastUpdate
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
|
||||
@@ -189,7 +189,7 @@ class Plugin(GlancesPlugin):
|
||||
if len(disk_name) > name_max_width:
|
||||
# Cut disk name if it is too long
|
||||
disk_name = '_' + disk_name[-name_max_width:]
|
||||
msg = '{:{width}}'.format(b(disk_name),
|
||||
msg = '{:{width}}'.format(nativestr(disk_name),
|
||||
width=name_max_width)
|
||||
ret.append(self.curse_add_line(msg))
|
||||
if args.diskio_iops:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
import numbers
|
||||
|
||||
from glances.compat import b
|
||||
from glances.compat import nativestr
|
||||
from glances.folder_list import FolderList as glancesFolderList
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
|
||||
@@ -116,7 +116,7 @@ class Plugin(GlancesPlugin):
|
||||
path = '_' + i['path'][-name_max_width + 1:]
|
||||
else:
|
||||
path = i['path']
|
||||
msg = '{:{width}}'.format(b(path),
|
||||
msg = '{:{width}}'.format(nativestr(path),
|
||||
width=name_max_width)
|
||||
ret.append(self.curse_add_line(msg))
|
||||
try:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
import operator
|
||||
|
||||
from glances.compat import u, b
|
||||
from glances.compat import u, nativestr
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
|
||||
import psutil
|
||||
@@ -230,7 +230,7 @@ class Plugin(GlancesPlugin):
|
||||
mnt_point = '_' + i['mnt_point'][-name_max_width + 1:]
|
||||
else:
|
||||
mnt_point = i['mnt_point']
|
||||
msg = '{:{width}}'.format(b(mnt_point),
|
||||
msg = '{:{width}}'.format(nativestr(mnt_point),
|
||||
width=name_max_width)
|
||||
ret.append(self.curse_add_line(msg))
|
||||
if args.fs_free_space:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
import operator
|
||||
|
||||
from glances.compat import b
|
||||
from glances.compat import nativestr
|
||||
from glances.logger import logger
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
|
||||
@@ -196,7 +196,7 @@ class Plugin(GlancesPlugin):
|
||||
if len(hotspotname) > ifname_max_width:
|
||||
hotspotname = '_' + hotspotname[-ifname_max_width + 1:]
|
||||
# Add the new hotspot to the message
|
||||
msg = '{:{width}}'.format(b(hotspotname),
|
||||
msg = '{:{width}}'.format(nativestr(hotspotname),
|
||||
width=ifname_max_width)
|
||||
ret.append(self.curse_add_line(msg))
|
||||
msg = '{:>7}'.format(i['signal'], width=ifname_max_width)
|
||||
|
||||
Reference in New Issue
Block a user