提交 f8f53ffc 编写于 作者: N nicolargo

Correct issue on Python 3

上级 982054be
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"""Disk I/O plugin.""" """Disk I/O plugin."""
from glances.compat import b from glances.compat import nativestr
from glances.timer import getTimeSinceLastUpdate from glances.timer import getTimeSinceLastUpdate
from glances.plugins.glances_plugin import GlancesPlugin from glances.plugins.glances_plugin import GlancesPlugin
...@@ -189,7 +189,7 @@ class Plugin(GlancesPlugin): ...@@ -189,7 +189,7 @@ class Plugin(GlancesPlugin):
if len(disk_name) > name_max_width: if len(disk_name) > name_max_width:
# Cut disk name if it is too long # Cut disk name if it is too long
disk_name = '_' + disk_name[-name_max_width:] disk_name = '_' + disk_name[-name_max_width:]
msg = '{:{width}}'.format(b(disk_name), msg = '{:{width}}'.format(nativestr(disk_name),
width=name_max_width) width=name_max_width)
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
if args.diskio_iops: if args.diskio_iops:
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
import numbers import numbers
from glances.compat import b from glances.compat import nativestr
from glances.folder_list import FolderList as glancesFolderList from glances.folder_list import FolderList as glancesFolderList
from glances.plugins.glances_plugin import GlancesPlugin from glances.plugins.glances_plugin import GlancesPlugin
...@@ -116,7 +116,7 @@ class Plugin(GlancesPlugin): ...@@ -116,7 +116,7 @@ class Plugin(GlancesPlugin):
path = '_' + i['path'][-name_max_width + 1:] path = '_' + i['path'][-name_max_width + 1:]
else: else:
path = i['path'] path = i['path']
msg = '{:{width}}'.format(b(path), msg = '{:{width}}'.format(nativestr(path),
width=name_max_width) width=name_max_width)
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
try: try:
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
import operator import operator
from glances.compat import u, b from glances.compat import u, nativestr
from glances.plugins.glances_plugin import GlancesPlugin from glances.plugins.glances_plugin import GlancesPlugin
import psutil import psutil
...@@ -230,7 +230,7 @@ class Plugin(GlancesPlugin): ...@@ -230,7 +230,7 @@ class Plugin(GlancesPlugin):
mnt_point = '_' + i['mnt_point'][-name_max_width + 1:] mnt_point = '_' + i['mnt_point'][-name_max_width + 1:]
else: else:
mnt_point = i['mnt_point'] mnt_point = i['mnt_point']
msg = '{:{width}}'.format(b(mnt_point), msg = '{:{width}}'.format(nativestr(mnt_point),
width=name_max_width) width=name_max_width)
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
if args.fs_free_space: if args.fs_free_space:
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
import operator import operator
from glances.compat import b from glances.compat import nativestr
from glances.logger import logger from glances.logger import logger
from glances.plugins.glances_plugin import GlancesPlugin from glances.plugins.glances_plugin import GlancesPlugin
...@@ -196,7 +196,7 @@ class Plugin(GlancesPlugin): ...@@ -196,7 +196,7 @@ class Plugin(GlancesPlugin):
if len(hotspotname) > ifname_max_width: if len(hotspotname) > ifname_max_width:
hotspotname = '_' + hotspotname[-ifname_max_width + 1:] hotspotname = '_' + hotspotname[-ifname_max_width + 1:]
# Add the new hotspot to the message # Add the new hotspot to the message
msg = '{:{width}}'.format(b(hotspotname), msg = '{:{width}}'.format(nativestr(hotspotname),
width=ifname_max_width) width=ifname_max_width)
ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(msg))
msg = '{:>7}'.format(i['signal'], width=ifname_max_width) msg = '{:>7}'.format(i['signal'], width=ifname_max_width)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册