Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
3c5975c5
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3c5975c5
编写于
7月 01, 2014
作者:
N
Nicolas Hennion
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean column and line var from plugins
上级
73bd3444
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
24 addition
and
124 deletion
+24
-124
glances/outputs/glances_curses.py
glances/outputs/glances_curses.py
+2
-2
glances/plugins/glances_alert.py
glances/plugins/glances_alert.py
+0
-6
glances/plugins/glances_cpu.py
glances/plugins/glances_cpu.py
+0
-6
glances/plugins/glances_diskio.py
glances/plugins/glances_diskio.py
+0
-6
glances/plugins/glances_fs.py
glances/plugins/glances_fs.py
+0
-6
glances/plugins/glances_help.py
glances/plugins/glances_help.py
+0
-6
glances/plugins/glances_load.py
glances/plugins/glances_load.py
+0
-6
glances/plugins/glances_mem.py
glances/plugins/glances_mem.py
+0
-6
glances/plugins/glances_memswap.py
glances/plugins/glances_memswap.py
+0
-6
glances/plugins/glances_monitor.py
glances/plugins/glances_monitor.py
+0
-6
glances/plugins/glances_network.py
glances/plugins/glances_network.py
+0
-6
glances/plugins/glances_now.py
glances/plugins/glances_now.py
+2
-5
glances/plugins/glances_percpu.py
glances/plugins/glances_percpu.py
+0
-6
glances/plugins/glances_plugin.py
glances/plugins/glances_plugin.py
+17
-22
glances/plugins/glances_processcount.py
glances/plugins/glances_processcount.py
+0
-6
glances/plugins/glances_processlist.py
glances/plugins/glances_processlist.py
+0
-6
glances/plugins/glances_sensors.py
glances/plugins/glances_sensors.py
+0
-6
glances/plugins/glances_system.py
glances/plugins/glances_system.py
+0
-6
glances/plugins/glances_uptime.py
glances/plugins/glances_uptime.py
+3
-5
未找到文件。
glances/outputs/glances_curses.py
浏览文件 @
3c5975c5
...
...
@@ -432,12 +432,12 @@ class GlancesCurses(object):
screen_y
=
self
.
screen
.
getmaxyx
()[
0
]
# Set the upper/left position of the message
if
plugin_stats
[
'
column'
]
<
0
:
if
plugin_stats
[
'
align'
]
==
'right'
:
# Right align (last column)
display_x
=
screen_x
-
self
.
get_stats_display_width
(
plugin_stats
)
else
:
display_x
=
self
.
column
if
plugin_stats
[
'
line'
]
<
0
:
if
plugin_stats
[
'
align'
]
==
'bottom'
:
# Bottom (last line)
display_y
=
screen_y
-
self
.
get_stats_display_height
(
plugin_stats
)
else
:
...
...
glances/plugins/glances_alert.py
浏览文件 @
3c5975c5
...
...
@@ -40,12 +40,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
1
# Enter -1 to diplay bottom
self
.
line_curse
=
-
1
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_cpu.py
浏览文件 @
3c5975c5
...
...
@@ -47,12 +47,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
1
# Init stats
self
.
first_call
=
True
...
...
glances/plugins/glances_diskio.py
浏览文件 @
3c5975c5
...
...
@@ -39,12 +39,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
3
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_fs.py
浏览文件 @
3c5975c5
...
...
@@ -64,12 +64,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
4
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_help.py
浏览文件 @
3c5975c5
...
...
@@ -41,12 +41,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
0
def
update
(
self
):
"""No stats. It is just a plugin to display the help."""
...
...
glances/plugins/glances_load.py
浏览文件 @
3c5975c5
...
...
@@ -48,12 +48,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
1
# Enter -1 to diplay bottom
self
.
line_curse
=
1
# Init stats
self
.
reset
()
...
...
glances/plugins/glances_mem.py
浏览文件 @
3c5975c5
...
...
@@ -58,12 +58,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
2
# Enter -1 to diplay bottom
self
.
line_curse
=
1
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_memswap.py
浏览文件 @
3c5975c5
...
...
@@ -47,12 +47,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
3
# Enter -1 to diplay bottom
self
.
line_curse
=
1
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_monitor.py
浏览文件 @
3c5975c5
...
...
@@ -34,12 +34,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
1
# Enter -1 to diplay bottom
self
.
line_curse
=
3
# Init stats
self
.
glances_monitors
=
None
...
...
glances/plugins/glances_network.py
浏览文件 @
3c5975c5
...
...
@@ -47,12 +47,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
2
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_now.py
浏览文件 @
3c5975c5
...
...
@@ -37,12 +37,9 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
-
1
self
.
set_align
(
'bottom'
)
def
update
(
self
):
"""Update current date/time."""
...
...
glances/plugins/glances_percpu.py
浏览文件 @
3c5975c5
...
...
@@ -39,12 +39,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
1
# Init stats
self
.
reset
()
...
...
glances/plugins/glances_plugin.py
浏览文件 @
3c5975c5
...
...
@@ -42,6 +42,9 @@ class GlancesPlugin(object):
# Init the args
self
.
args
=
args
# Init the default alignement (for curses)
self
.
set_align
(
'left'
)
# Init the input method
self
.
input_method
=
'local'
self
.
short_system_name
=
None
...
...
@@ -279,30 +282,23 @@ class GlancesPlugin(object):
----------------------------
display | Display the stat (True or False)
msgdict | Message to display (list of dict [{ 'msg': msg, 'decoration': decoration } ... ])
column | column number
line | Line number
align | Message position
"""
display_curse
=
False
column_curse
=
-
1
line_curse
=
-
1
if
hasattr
(
self
,
'display_curse'
):
display_curse
=
self
.
display_curse
if
hasattr
(
self
,
'column_curse'
):
column_curse
=
self
.
column_curse
if
hasattr
(
self
,
'line_curse'
):
line_curse
=
self
.
line_curse
if
hasattr
(
self
,
'align'
):
align_curse
=
self
.
align
if
max_width
is
not
None
:
ret
=
{
'display'
:
display_curse
,
'msgdict'
:
self
.
msg_curse
(
args
,
max_width
=
max_width
),
'column'
:
column_curse
,
'line'
:
line_curse
}
'align'
:
align_curse
}
else
:
ret
=
{
'display'
:
display_curse
,
'msgdict'
:
self
.
msg_curse
(
args
),
'column'
:
column_curse
,
'line'
:
line_curse
}
'align'
:
align_curse
}
return
ret
...
...
@@ -336,17 +332,16 @@ class GlancesPlugin(object):
"""Go to a new line."""
return
self
.
curse_add_line
(
'
\n
'
)
def
set_curse_column
(
self
,
column
):
"""Set the Curse column
Enter -1 to right align
"""
self
.
column_curse
=
column
def
set_align
(
self
,
align
=
'left'
):
"""Set the Curse align"""
if
align
in
(
'left'
,
'right'
,
'bottom'
):
self
.
align
=
align
else
:
self
.
align
=
'left'
def
set_curse_line
(
self
,
line
):
"""Set the Curse line
Enter -1 to right align
"""
self
.
line_curse
=
line
def
get_align
(
self
):
"""Get the Curse align"""
return
self
.
align
def
auto_unit
(
self
,
number
,
low_precision
=
False
):
"""Make a nice human-readable string out of number.
...
...
glances/plugins/glances_processcount.py
浏览文件 @
3c5975c5
...
...
@@ -37,12 +37,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
1
# Enter -1 to diplay bottom
self
.
line_curse
=
2
# Note: 'glances_processes' is already init in the glances_processes.py script
...
...
glances/plugins/glances_processlist.py
浏览文件 @
3c5975c5
...
...
@@ -41,12 +41,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
1
# Enter -1 to diplay bottom
self
.
line_curse
=
4
# Note: 'glances_processes' is already init in the glances_processes.py script
...
...
glances/plugins/glances_sensors.py
浏览文件 @
3c5975c5
...
...
@@ -57,12 +57,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
5
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_system.py
浏览文件 @
3c5975c5
...
...
@@ -56,12 +56,6 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
0
# Enter -1 to diplay bottom
self
.
line_curse
=
0
# Init the stats
self
.
reset
()
...
...
glances/plugins/glances_uptime.py
浏览文件 @
3c5975c5
...
...
@@ -45,12 +45,10 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self
.
display_curse
=
True
# Set the message position
# It is NOT the curse position but the Glances column/line
# Enter -1 to right align
self
.
column_curse
=
-
1
# Enter -1 to diplay bottom
self
.
line_curse
=
0
self
.
set_align
(
'right'
)
# Init the stats
self
.
reset
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录