Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
47a85eec
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,发现更多精彩内容 >>
提交
47a85eec
编写于
1月 18, 2017
作者:
A
Alessio Sergi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OS X -> macOS
上级
9cf28634
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
30 addition
and
30 deletion
+30
-30
.coveragerc
.coveragerc
+1
-1
README.rst
README.rst
+4
-4
docs/cmds.rst
docs/cmds.rst
+1
-1
docs/config.rst
docs/config.rst
+5
-5
glances/config.py
glances/config.py
+4
-4
glances/globals.py
glances/globals.py
+1
-1
glances/outdated.py
glances/outdated.py
+2
-2
glances/outputs/glances_curses.py
glances/outputs/glances_curses.py
+2
-2
glances/password.py
glances/password.py
+4
-4
glances/plugins/glances_mem.py
glances/plugins/glances_mem.py
+1
-1
glances/plugins/glances_processlist.py
glances/plugins/glances_processlist.py
+1
-1
glances/processes.py
glances/processes.py
+4
-4
未找到文件。
.coveragerc
浏览文件 @
47a85eec
...
...
@@ -26,5 +26,5 @@ exclude_lines =
except ImportError:
raise NotImplementedError
if WINDOWS
if
OSX
if
MACOS
if BSD
README.rst
浏览文件 @
47a85eec
...
...
@@ -9,7 +9,7 @@ Glances - An eye on your system
:target: https://github.com/nicolargo/glances/
:alt: Github stars
.. image:: https://img.shields.io/travis/nicolargo/glances/master.svg?maxAge=3600&label=Linux%20/%20BSD%20/%20
OSX
.. image:: https://img.shields.io/travis/nicolargo/glances/master.svg?maxAge=3600&label=Linux%20/%20BSD%20/%20
macOS
:target: https://travis-ci.org/nicolargo/glances
:alt: Linux tests (Travis)
...
...
@@ -226,10 +226,10 @@ To install Glances from ports:
# cd /usr/ports/sysutils/py-glances/
# make install clean
OS X
----
macOS
----
-
OS X
users can install Glances using ``Homebrew`` or ``MacPorts``.
macOS
users can install Glances using ``Homebrew`` or ``MacPorts``.
Homebrew
````````
...
...
docs/cmds.rst
浏览文件 @
47a85eec
...
...
@@ -323,7 +323,7 @@ The following commands (key pressed) are supported while in Glances:
``ENTER``
Set the process filter
**Note**: on
OS X
, please use ``CTRL-H`` to delete
**Note**: on
macOS
, please use ``CTRL-H`` to delete
filter.
Filter is a regular expression pattern:
...
...
docs/config.rst
浏览文件 @
47a85eec
...
...
@@ -20,7 +20,7 @@ You can put your own ``glances.conf`` file in the following locations:
=========== ============================================================
``Linux`` ~/.config/glances ($XDG_CONFIG_HOME environment variable) or /etc/glances
``*BSD`` ~/.config/glances or /usr/local/etc/glances
``
OS X``
~/Library/Application Support/glances or /usr/local/etc/glances
``
macOS``
~/Library/Application Support/glances or /usr/local/etc/glances
``Windows`` %APPDATA%\\glances
=========== ============================================================
...
...
@@ -108,10 +108,10 @@ line.
By default, the ``glances-USERNAME.log`` file is under the temporary directory:
===================== ==================================================
``Linux, *BSD,
OS X
`` /tmp
``Windows`` %APPDATA%\\Local\\temp
===================== ==================================================
=====================
=
==================================================
``Linux, *BSD,
macOS
`` /tmp
``Windows``
%APPDATA%\\Local\\temp
=====================
=
==================================================
If you want to use another system path or change the log message, you can use
your own logger configuration. First of all you have to create a glances.json
...
...
glances/config.py
浏览文件 @
47a85eec
...
...
@@ -25,7 +25,7 @@ import multiprocessing
from
io
import
open
from
glances.compat
import
ConfigParser
,
NoOptionError
from
glances.globals
import
BSD
,
LINUX
,
OSX
,
WINDOWS
,
sys_prefix
from
glances.globals
import
BSD
,
LINUX
,
MACOS
,
WINDOWS
,
sys_prefix
from
glances.logger
import
logger
...
...
@@ -52,8 +52,8 @@ class Config(object):
* custom path: /path/to/glances
* Linux: ~/.config/glances, /etc/glances
* BSD: ~/.config/glances, /usr/local/etc/glances
*
OS X
: ~/Library/Application Support/glances, /usr/local/etc/glances
*
*
BSD: ~/.config/glances, /usr/local/etc/glances
*
macOS
: ~/Library/Application Support/glances, /usr/local/etc/glances
* Windows: %APPDATA%\glances
The config file will be searched in the following order of priority:
...
...
@@ -75,7 +75,7 @@ class Config(object):
paths
.
append
(
os
.
path
.
join
(
sys
.
prefix
,
'etc'
,
'glances'
,
self
.
config_filename
))
else
:
paths
.
append
(
os
.
path
.
join
(
'/etc/glances'
,
self
.
config_filename
))
elif
OSX
:
elif
MACOS
:
paths
.
append
(
os
.
path
.
join
(
os
.
path
.
expanduser
(
'~/Library/Application Support/glances'
),
self
.
config_filename
))
...
...
glances/globals.py
浏览文件 @
47a85eec
...
...
@@ -26,7 +26,7 @@ import sys
# Note: Somes libs depends of OS
BSD
=
sys
.
platform
.
find
(
'bsd'
)
!=
-
1
LINUX
=
sys
.
platform
.
startswith
(
'linux'
)
OSX
=
sys
.
platform
.
startswith
(
'darwin'
)
MACOS
=
sys
.
platform
.
startswith
(
'darwin'
)
SUNOS
=
sys
.
platform
.
startswith
(
'sunos'
)
WINDOWS
=
sys
.
platform
.
startswith
(
'win'
)
...
...
glances/outdated.py
浏览文件 @
47a85eec
...
...
@@ -33,7 +33,7 @@ else:
outdated_tag
=
True
from
glances
import
__version__
from
glances.globals
import
BSD
,
LINUX
,
OSX
,
WINDOWS
from
glances.globals
import
BSD
,
LINUX
,
MACOS
,
WINDOWS
from
glances.logger
import
logger
...
...
@@ -156,7 +156,7 @@ class Outdated(object):
return
os
.
path
.
join
(
os
.
environ
.
get
(
'XDG_CONFIG_HOME'
)
or
os
.
path
.
expanduser
(
'~/.config'
),
'glances'
)
elif
OSX
:
elif
MACOS
:
return
os
.
path
.
expanduser
(
'~/Library/Application Support/glances'
)
elif
WINDOWS
:
return
os
.
path
.
join
(
os
.
environ
.
get
(
'APPDATA'
),
'glances'
)
...
...
glances/outputs/glances_curses.py
浏览文件 @
47a85eec
...
...
@@ -23,7 +23,7 @@ import re
import
sys
from
glances.compat
import
u
,
itervalues
from
glances.globals
import
OSX
,
WINDOWS
from
glances.globals
import
MACOS
,
WINDOWS
from
glances.logger
import
logger
from
glances.logs
import
glances_logs
from
glances.processes
import
glances_processes
...
...
@@ -751,7 +751,7 @@ class _GlancesCurses(object):
self
.
new_line
()
self
.
display_plugin
(
stat_display
[
"processlist"
],
display_optional
=
(
self
.
screen
.
getmaxyx
()[
1
]
>
102
),
display_additional
=
(
not
OSX
),
display_additional
=
(
not
MACOS
),
max_y
=
(
self
.
screen
.
getmaxyx
()[
0
]
-
self
.
get_stats_display_height
(
stat_display
[
"alert"
])
-
2
))
self
.
new_line
()
self
.
display_plugin
(
stat_display
[
"alert"
])
...
...
glances/password.py
浏览文件 @
47a85eec
...
...
@@ -27,7 +27,7 @@ import uuid
from
io
import
open
from
glances.compat
import
b
,
input
from
glances.globals
import
BSD
,
LINUX
,
OSX
,
WINDOWS
from
glances.globals
import
BSD
,
LINUX
,
MACOS
,
WINDOWS
from
glances.logger
import
logger
...
...
@@ -44,13 +44,13 @@ class GlancesPassword(object):
def
get_password_path
(
self
):
r
"""Get the path where the password file will be stored.
* Linux and BSD: ~/.config/glances
*
OS X
: ~/Library/glances
* Linux and
*
BSD: ~/.config/glances
*
macOS
: ~/Library/glances
* Windows: %APPDATA%\glances
"""
if
LINUX
or
BSD
:
app_path
=
os
.
environ
.
get
(
'XDG_CONFIG_HOME'
)
or
os
.
path
.
expanduser
(
'~/.config'
)
elif
OSX
:
elif
MACOS
:
app_path
=
os
.
path
.
join
(
os
.
environ
.
get
(
'HOME'
),
'Library'
)
elif
WINDOWS
:
app_path
=
os
.
environ
.
get
(
'APPDATA'
)
...
...
glances/plugins/glances_mem.py
浏览文件 @
47a85eec
...
...
@@ -99,7 +99,7 @@ class Plugin(GlancesPlugin):
# inactive: (UNIX): memory that is marked as not used.
# buffers: (Linux, BSD): cache for things like file system metadata.
# cached: (Linux, BSD): cache for various things.
# wired: (BSD,
OSX
): memory that is marked to always stay in RAM. It is never moved to disk.
# wired: (BSD,
macOS
): memory that is marked to always stay in RAM. It is never moved to disk.
# shared: (BSD): memory that may be simultaneously accessed by multiple processes.
self
.
reset
()
for
mem
in
[
'total'
,
'available'
,
'percent'
,
'used'
,
'free'
,
...
...
glances/plugins/glances_processlist.py
浏览文件 @
47a85eec
...
...
@@ -287,7 +287,7 @@ class Plugin(GlancesPlugin):
except
(
OverflowError
,
TypeError
)
as
e
:
# Catch OverflowError on some Amazon EC2 server
# See https://github.com/nicolargo/glances/issues/87
# Also catch TypeError on
Mac OS X
# Also catch TypeError on
macOS
# See: https://github.com/nicolargo/glances/issues/622
logger
.
debug
(
"Cannot get TIME+ ({})"
.
format
(
e
))
self
.
tag_proc_time
=
False
...
...
glances/processes.py
浏览文件 @
47a85eec
...
...
@@ -21,7 +21,7 @@ import operator
import
os
from
glances.compat
import
iteritems
,
itervalues
,
listitems
from
glances.globals
import
BSD
,
LINUX
,
OSX
,
SUNOS
,
WINDOWS
from
glances.globals
import
BSD
,
LINUX
,
MACOS
,
SUNOS
,
WINDOWS
from
glances.timer
import
Timer
,
getTimeSinceLastUpdate
from
glances.processes_tree
import
ProcessTreeNode
from
glances.filter
import
GlancesFilter
...
...
@@ -279,7 +279,7 @@ class GlancesProcesses(object):
# If io_tag = 0 > Access denied (display "?")
# If io_tag = 1 > No access denied (display the IO rate)
# Availability: all platforms except macOS and Illumos/Solaris
if
not
(
OSX
or
SUNOS
):
if
not
(
MACOS
or
SUNOS
):
try
:
# Get the process IO counters
proc_io
=
proc
.
io_counters
()
...
...
@@ -428,12 +428,12 @@ class GlancesProcesses(object):
standard_stats
=
self
.
max_processes
is
None
)
# Check if s is note None (issue #879)
# ignore the 'idle' process on Windows and *BSD
# ignore the 'kernel_task' process on
OS X
# ignore the 'kernel_task' process on
macOS
# waiting for upstream patch from psutil
if
(
s
is
None
or
BSD
and
s
[
'name'
]
==
'idle'
or
WINDOWS
and
s
[
'name'
]
==
'System Idle Process'
or
OSX
and
s
[
'name'
]
==
'kernel_task'
):
MACOS
and
s
[
'name'
]
==
'kernel_task'
):
continue
# Continue to the next process if it has to be filtered
if
self
.
_filter
.
is_filtered
(
s
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录