Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
e4d2756c
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 搜索 >>
提交
e4d2756c
编写于
12月 29, 2017
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Glances do not exit when eating 'q' #1207
上级
403fd069
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
15 deletion
+27
-15
NEWS
NEWS
+1
-0
glances/__init__.py
glances/__init__.py
+4
-4
glances/main.py
glances/main.py
+3
-3
glances/outputs/glances_curses.py
glances/outputs/glances_curses.py
+1
-3
glances/standalone.py
glances/standalone.py
+18
-5
未找到文件。
NEWS
浏览文件 @
e4d2756c
...
...
@@ -30,6 +30,7 @@ Bugs corrected:
* KeyError: 'memory_info' on stats sum #1188
* Electron/Atom processes displayed wrong in process list #1192
* Another encoding issue... With both Python 2 and Python 3 #1197
* Glances do not exit when eating 'q' #1207
Backward-incompatible changes:
...
...
glances/__init__.py
浏览文件 @
e4d2756c
...
...
@@ -77,7 +77,7 @@ def end():
# ...after starting the server mode (issue #1175)
pass
logger
.
info
(
"Glances stopped
with CTRL-C
"
)
logger
.
info
(
"Glances stopped
(keypressed: CTRL-C)
"
)
# The end...
sys
.
exit
(
0
)
...
...
@@ -118,6 +118,9 @@ def main():
Select the mode (standalone, client or server)
Run it...
"""
# Catch the CTRL-C signal
signal
.
signal
(
signal
.
SIGINT
,
__signal_handler
)
# Log Glances and PSutil version
logger
.
info
(
'Start Glances {}'
.
format
(
__version__
))
logger
.
info
(
'{} {} and PSutil {} detected'
.
format
(
...
...
@@ -133,8 +136,5 @@ def main():
config
=
core
.
get_config
()
args
=
core
.
get_args
()
# Catch the CTRL-C signal
signal
.
signal
(
signal
.
SIGINT
,
__signal_handler
)
# Glances can be ran in standalone, client or server mode
start
(
config
=
config
,
args
=
args
)
glances/main.py
浏览文件 @
e4d2756c
...
...
@@ -418,11 +418,11 @@ Examples of use:
return
self
.
mode
def
__get_username
(
self
,
description
=
''
):
"""Read an username from the command line.
"""
"""Read an username from the command line."""
return
input
(
description
)
def
__get_password
(
self
,
description
=
''
,
confirm
=
False
,
clear
=
False
,
username
=
'glances'
):
def
__get_password
(
self
,
description
=
''
,
confirm
=
False
,
clear
=
False
,
username
=
'glances'
):
"""Read a password from the command line.
- if confirm = True, with confirmation
...
...
glances/outputs/glances_curses.py
浏览文件 @
e4d2756c
...
...
@@ -341,9 +341,7 @@ class _GlancesCurses(object):
if
return_to_browser
:
logger
.
info
(
"Stop Glances client and return to the browser"
)
else
:
self
.
end
()
logger
.
info
(
"Stop Glances"
)
sys
.
exit
(
0
)
logger
.
info
(
"Stop Glances (keypressed: {})"
.
format
(
self
.
pressedkey
))
elif
self
.
pressedkey
==
ord
(
'
\n
'
):
# 'ENTER' > Edit the process filter
self
.
edit_filter
=
not
self
.
edit_filter
...
...
glances/standalone.py
浏览文件 @
e4d2756c
...
...
@@ -100,7 +100,10 @@ class GlancesStandalone(object):
', '
.
join
(
sorted
(
self
.
stats
.
getExportsList
(
enable
=
False
)))))
def
__serve_forever
(
self
):
"""Main loop for the CLI."""
"""Main loop for the CLI.
return True if we should continue (no exit key has been pressed)
"""
# Start a counter used to compute the time needed for
# update and export the stats
counter
=
Counter
()
...
...
@@ -117,13 +120,23 @@ class GlancesStandalone(object):
# Display stats
# and wait refresh_time - counter
if
not
self
.
quiet
:
self
.
screen
.
update
(
self
.
stats
,
duration
=
self
.
refresh_time
-
counter
.
get
())
# The update function return True if an exit key 'q' or 'ESC'
# has been pressed.
ret
=
not
self
.
screen
.
update
(
self
.
stats
,
duration
=
self
.
refresh_time
-
counter
.
get
())
else
:
# Nothing is displayed
# Break should be done via a signal (CTRL-C)
ret
=
True
return
ret
def
serve_forever
(
self
):
"""Wrapper to the serve_forever function."""
while
True
:
self
.
__serve_forever
()
loop
=
True
while
loop
:
loop
=
self
.
__serve_forever
()
self
.
end
()
def
end
(
self
):
"""End of the standalone CLI."""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录