Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
5b78805b
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,发现更多精彩内容 >>
提交
5b78805b
编写于
12月 04, 2014
作者:
A
Alessio Sergi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix blind except statements
上级
ed0ef184
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
19 addition
and
19 deletion
+19
-19
glances/core/glances_autodiscover.py
glances/core/glances_autodiscover.py
+1
-1
glances/core/glances_client.py
glances/core/glances_client.py
+2
-2
glances/core/glances_monitor_list.py
glances/core/glances_monitor_list.py
+1
-1
glances/core/glances_processes.py
glances/core/glances_processes.py
+4
-4
glances/outputs/glances_curses.py
glances/outputs/glances_curses.py
+6
-6
glances/outputs/glances_history.py
glances/outputs/glances_history.py
+1
-1
glances/plugins/glances_diskio.py
glances/plugins/glances_diskio.py
+1
-1
glances/plugins/glances_help.py
glances/plugins/glances_help.py
+1
-1
glances/plugins/glances_system.py
glances/plugins/glances_system.py
+1
-1
glances/plugins/glances_uptime.py
glances/plugins/glances_uptime.py
+1
-1
未找到文件。
glances/core/glances_autodiscover.py
浏览文件 @
5b78805b
...
...
@@ -227,7 +227,7 @@ class GlancesAutoDiscoverClient(object):
gateway_itf
=
netifaces
.
gateways
()[
'default'
][
netifaces
.
AF_INET
][
1
]
# IP address for the interface
return
netifaces
.
ifaddresses
(
gateway_itf
)[
netifaces
.
AF_INET
][
0
][
'addr'
]
except
:
except
Exception
:
return
None
def
close
(
self
):
...
...
glances/core/glances_client.py
浏览文件 @
5b78805b
...
...
@@ -30,7 +30,7 @@ except ImportError:
from
xmlrpclib
import
Transport
,
ServerProxy
,
ProtocolError
,
Fault
try
:
import
http.client
as
httplib
except
:
except
ImportError
:
# Python 2
import
httplib
...
...
@@ -214,7 +214,7 @@ class GlancesClient(object):
# Update the stats
try
:
self
.
stats
.
update
()
except
:
except
Exception
:
# Client can not get SNMP server stats
return
"Disconnected"
else
:
...
...
glances/core/glances_monitor_list.py
浏览文件 @
5b78805b
...
...
@@ -80,7 +80,7 @@ class MonitorList(object):
value
[
"description"
]
=
description
try
:
re
.
compile
(
regex
)
except
:
except
Exception
:
continue
else
:
value
[
"regex"
]
=
regex
...
...
glances/core/glances_processes.py
浏览文件 @
5b78805b
...
...
@@ -288,7 +288,7 @@ class GlancesProcesses(object):
self
.
process_filter_re
=
re
.
compile
(
value
)
logger
.
debug
(
_
(
"Process filter regular expression compilation OK: %s"
)
%
self
.
get_process_filter
())
except
:
except
Exception
:
logger
.
error
(
_
(
"Can not compile process filter regular expression: %s"
)
%
value
)
self
.
process_filter_re
=
None
...
...
@@ -487,7 +487,7 @@ class GlancesProcesses(object):
pass
except
psutil
.
AccessDenied
:
procstat
[
'memory_swap'
]
=
None
except
:
except
Exception
:
# Add a dirty except to handle the PsUtil issue #413
procstat
[
'memory_swap'
]
=
None
...
...
@@ -495,7 +495,7 @@ class GlancesProcesses(object):
try
:
procstat
[
'tcp'
]
=
len
(
proc
.
connections
(
kind
=
"tcp"
))
procstat
[
'udp'
]
=
len
(
proc
.
connections
(
kind
=
"udp"
))
except
:
except
Exception
:
procstat
[
'tcp'
]
=
None
procstat
[
'udp'
]
=
None
...
...
@@ -570,7 +570,7 @@ class GlancesProcesses(object):
# Update thread number (global statistics)
try
:
self
.
processcount
[
'thread'
]
+=
proc
.
num_threads
()
except
:
except
Exception
:
pass
if
self
.
_enable_tree
:
...
...
glances/outputs/glances_curses.py
浏览文件 @
5b78805b
...
...
@@ -95,14 +95,14 @@ class _GlancesCurses(object):
curses
.
init_pair
(
8
,
curses
.
COLOR_BLUE
,
-
1
)
try
:
curses
.
init_pair
(
9
,
curses
.
COLOR_MAGENTA
,
-
1
)
except
:
except
Exception
:
if
args
.
theme_white
:
curses
.
init_pair
(
9
,
curses
.
COLOR_BLACK
,
-
1
)
else
:
curses
.
init_pair
(
9
,
curses
.
COLOR_WHITE
,
-
1
)
try
:
curses
.
init_pair
(
10
,
curses
.
COLOR_CYAN
,
-
1
)
except
:
except
Exception
:
if
args
.
theme_white
:
curses
.
init_pair
(
10
,
curses
.
COLOR_BLACK
,
-
1
)
else
:
...
...
@@ -553,7 +553,7 @@ class _GlancesCurses(object):
elif
(
self
.
history_tag
or
self
.
reset_history_tag
)
and
not
self
.
args
.
enable_history
:
try
:
self
.
glances_history
.
graph_enabled
()
except
:
except
Exception
:
self
.
display_popup
(
_
(
"History disabled
\n
Enable it using --enable-history"
))
else
:
...
...
@@ -717,7 +717,7 @@ class _GlancesCurses(object):
# Do not disply outside the screen
screen_x
-
x
,
self
.
colors_list
[
m
[
'decoration'
]])
except
:
except
Exception
:
pass
else
:
# New column
...
...
@@ -803,7 +803,7 @@ class _GlancesCurses(object):
# Size with all options
c
=
len
(
max
(
''
.
join
([
i
[
'msg'
]
for
i
in
curse_msg
[
'msgdict'
]]).
split
(
'
\n
'
),
key
=
len
))
except
:
except
Exception
:
return
0
else
:
return
c
...
...
@@ -815,7 +815,7 @@ class _GlancesCurses(object):
"""
try
:
c
=
[
i
[
'msg'
]
for
i
in
curse_msg
[
'msgdict'
]].
count
(
'
\n
'
)
except
:
except
Exception
:
return
0
else
:
return
c
+
1
...
...
glances/outputs/glances_history.py
浏览文件 @
5b78805b
...
...
@@ -29,7 +29,7 @@ from glances.core.glances_globals import logger
try
:
from
matplotlib
import
__version__
as
matplotlib_version
import
matplotlib.pyplot
as
plt
except
:
except
ImportError
:
matplotlib_check
=
False
logger
.
warning
(
'Can not load Matplotlib library. Please install it using "pip install matplotlib"'
)
...
...
glances/plugins/glances_diskio.py
浏览文件 @
5b78805b
...
...
@@ -70,7 +70,7 @@ class Plugin(GlancesPlugin):
# write_time: time spent writing to disk (in milliseconds)
try
:
diskiocounters
=
psutil
.
disk_io_counters
(
perdisk
=
True
)
except
:
except
Exception
:
return
self
.
stats
# Previous disk IO stats are stored in the diskio_old variable
...
...
glances/plugins/glances_help.py
浏览文件 @
5b78805b
...
...
@@ -62,7 +62,7 @@ class Plugin(GlancesPlugin):
# Configuration file path
try
:
msg
=
'{0}: {1}'
.
format
(
_
(
"Configuration file"
),
self
.
config
.
get_loaded_config_file
())
except
AttributeError
as
e
:
except
AttributeError
:
pass
else
:
ret
.
append
(
self
.
curse_new_line
())
...
...
glances/plugins/glances_system.py
浏览文件 @
5b78805b
...
...
@@ -152,7 +152,7 @@ class Plugin(GlancesPlugin):
msg
=
' ({0} {1} {2})'
.
format
(
self
.
stats
[
'os_name'
],
self
.
stats
[
'os_version'
],
self
.
stats
[
'platform'
])
except
:
except
Exception
:
msg
=
' ({0})'
.
format
(
self
.
stats
[
'os_name'
])
ret
.
append
(
self
.
curse_add_line
(
msg
,
optional
=
True
))
...
...
glances/plugins/glances_uptime.py
浏览文件 @
5b78805b
...
...
@@ -74,7 +74,7 @@ class Plugin(GlancesPlugin):
try
:
# In hundredths of seconds
self
.
stats
=
str
(
timedelta
(
seconds
=
int
(
uptime
)
/
100
))
except
:
except
Exception
:
pass
# Return the result
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录