Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
03db71ce
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,发现更多精彩内容 >>
提交
03db71ce
编写于
7月 04, 2021
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Also search glances.conf file in /usr/share/doc/glances/glances.conf #1862
上级
4c8b6d7f
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
27 addition
and
7 deletion
+27
-7
docs/config.rst
docs/config.rst
+3
-3
docs/man/glances.1
docs/man/glances.1
+4
-4
glances/config.py
glances/config.py
+20
-0
未找到文件。
docs/config.rst
浏览文件 @
03db71ce
...
@@ -17,9 +17,9 @@ Location
...
@@ -17,9 +17,9 @@ Location
You can put your own ``glances.conf`` file in the following locations:
You can put your own ``glances.conf`` file in the following locations:
==================== =============================================================
==================== =============================================================
``Linux``, ``SunOS`` ~/.config/glances/
glances.conf, /etc/glances/glances.conf
``Linux``, ``SunOS`` ~/.config/glances/
, /etc/glances/, /usr/share/docs/glances/
``*BSD`` ~/.config/glances/
glances.conf, /usr/local/etc/glances/glances.conf
``*BSD`` ~/.config/glances/
, /usr/local/etc/glances/, /usr/share/docs/glances/
``macOS`` ~/Library/Application Support/glances/
glances.conf, /usr/local/etc/glances/glances.conf
``macOS`` ~/Library/Application Support/glances/
, /usr/local/etc/glances/, /usr/share/docs/glances/
``Windows`` %APPDATA%\\glances\glances.conf
``Windows`` %APPDATA%\\glances\glances.conf
==================== =============================================================
==================== =============================================================
...
...
docs/man/glances.1
浏览文件 @
03db71ce
.\" Man page generated from reStructuredText.
.\" Man page generated from reStructuredText.
.
.
.TH "GLANCES" "1" "Jul 0
3
, 2021" "3.2.1_beta1" "Glances"
.TH "GLANCES" "1" "Jul 0
4
, 2021" "3.2.1_beta1" "Glances"
.SH NAME
.SH NAME
glances \- An eye on your system
glances \- An eye on your system
.
.
...
@@ -523,19 +523,19 @@ _
...
@@ -523,19 +523,19 @@ _
T{
T{
\fBLinux\fP, \fBSunOS\fP
\fBLinux\fP, \fBSunOS\fP
T} T{
T} T{
~/.config/glances/
glances.conf, /etc/glances/glances.conf
~/.config/glances/
, /etc/glances/, /usr/share/docs/glances/
T}
T}
_
_
T{
T{
\fB*BSD\fP
\fB*BSD\fP
T} T{
T} T{
~/.config/glances/
glances.conf, /usr/local/etc/glances/glances.conf
~/.config/glances/
, /usr/local/etc/glances/, /usr/share/docs/glances/
T}
T}
_
_
T{
T{
\fBmacOS\fP
\fBmacOS\fP
T} T{
T} T{
~/Library/Application Support/glances/
glances.conf, /usr/local/etc/glances/glances.conf
~/Library/Application Support/glances/
, /usr/local/etc/glances/, /usr/share/docs/glances/
T}
T}
_
_
T{
T{
...
...
glances/config.py
浏览文件 @
03db71ce
...
@@ -91,6 +91,24 @@ def system_config_dir():
...
@@ -91,6 +91,24 @@ def system_config_dir():
return
path
return
path
def
default_config_dir
():
r
"""Return the system-wide config dir (full path).
- Linux, SunOS, *BSD, macOS: /usr/share/doc (as defined in the setup.py files)
- Windows: %APPDATA%\glances
"""
if
LINUX
or
SUNOS
or
BDS
or
MACOS
:
path
=
'/usr/share/doc'
else
:
path
=
os
.
environ
.
get
(
'APPDATA'
)
if
path
is
None
:
path
=
''
else
:
path
=
os
.
path
.
join
(
path
,
'glances'
)
return
path
class
Config
(
object
):
class
Config
(
object
):
"""This class is used to access/read config file, if it exists.
"""This class is used to access/read config file, if it exists.
...
@@ -129,6 +147,7 @@ class Config(object):
...
@@ -129,6 +147,7 @@ class Config(object):
* /path/to/file (via -C flag)
* /path/to/file (via -C flag)
* user's home directory (per-user settings)
* user's home directory (per-user settings)
* system-wide directory (system-wide settings)
* system-wide directory (system-wide settings)
* default pip directory (as defined in the setup.py file)
"""
"""
paths
=
[]
paths
=
[]
...
@@ -137,6 +156,7 @@ class Config(object):
...
@@ -137,6 +156,7 @@ class Config(object):
paths
.
append
(
os
.
path
.
join
(
user_config_dir
(),
self
.
config_filename
))
paths
.
append
(
os
.
path
.
join
(
user_config_dir
(),
self
.
config_filename
))
paths
.
append
(
os
.
path
.
join
(
system_config_dir
(),
self
.
config_filename
))
paths
.
append
(
os
.
path
.
join
(
system_config_dir
(),
self
.
config_filename
))
paths
.
append
(
os
.
path
.
join
(
default_config_dir
(),
self
.
config_filename
))
return
paths
return
paths
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录