mirror of https://github.com/nicolargo/glances
Fix python 2.6 compatibility
Add argparse as requirement when running on python 2.6.pull/354/head
parent
9cf956b881
commit
45d6b2521b
|
@ -59,15 +59,15 @@ class Plugin(GlancesPlugin):
|
|||
|
||||
# Build the string message
|
||||
# Header
|
||||
msg = "{} {}".format(__appname__.title(), __version__)
|
||||
msg = "{0} {1}".format(__appname__.title(), __version__)
|
||||
ret.append(self.curse_add_line(msg, "TITLE"))
|
||||
msg = " {} {}".format(_("with PsUtil"), __psutil_version__)
|
||||
msg = " {0} {1}".format(_("with psutil"), __psutil_version__)
|
||||
ret.append(self.curse_add_line(msg))
|
||||
ret.append(self.curse_new_line())
|
||||
|
||||
# Keys
|
||||
msg_col = "{0:1} {1:>35}"
|
||||
msg_col2 = " {0:1} {1:>35}"
|
||||
msg_col = "{0:1} {1:>35}"
|
||||
msg_col2 = " {0:1} {1:>35}"
|
||||
|
||||
ret.append(self.curse_new_line())
|
||||
msg = msg_col.format(_("a"), _("Sort processes automatically"))
|
||||
|
@ -112,7 +112,7 @@ class Plugin(GlancesPlugin):
|
|||
ret.append(self.curse_new_line())
|
||||
msg = msg_col.format(_("s"), _("Show/hide sensors stats"))
|
||||
ret.append(self.curse_add_line(msg))
|
||||
msg = msg_col2.format(_("z"), _("Enable/Disable processes stats"))
|
||||
msg = msg_col2.format(_("z"), _("Enable/Disable processes stats"))
|
||||
ret.append(self.curse_add_line(msg))
|
||||
ret.append(self.curse_new_line())
|
||||
msg = msg_col.format(_("q"), _("Quit (Esc and Ctrl-C also work)"))
|
||||
|
|
|
@ -65,7 +65,7 @@ class Plugin(GlancesPlugin):
|
|||
ret = []
|
||||
|
||||
# Add the line with decoration
|
||||
ret.append(self.curse_add_line(_("Uptime: {}").format(self.stats)))
|
||||
ret.append(self.curse_add_line(_("Uptime: {0}").format(self.stats)))
|
||||
|
||||
# Return the message with decoration
|
||||
return ret
|
||||
|
|
6
setup.py
6
setup.py
|
@ -8,8 +8,7 @@ from setuptools import setup
|
|||
|
||||
data_files = [
|
||||
('share/doc/glances', ['AUTHORS', 'COPYING', 'NEWS', 'README.rst',
|
||||
'conf/glances.conf', 'docs/glances-doc.rst',
|
||||
'docs/glances-doc.html']),
|
||||
'conf/glances.conf', 'docs/glances-doc.html']),
|
||||
('share/doc/glances/images', glob.glob('docs/images/*.png')),
|
||||
('share/man/man1', ['man/glances.1'])
|
||||
]
|
||||
|
@ -32,6 +31,9 @@ if sys.platform.startswith('win'):
|
|||
else:
|
||||
requires = ['psutil>=2.0.0']
|
||||
|
||||
if sys.version_info < (2, 7):
|
||||
requires += ['argparse']
|
||||
|
||||
setup(
|
||||
name='Glances',
|
||||
version='2.0',
|
||||
|
|
Loading…
Reference in New Issue