Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
acb9dd34
Commit
acb9dd34
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Changed configuration status var (refs
#19005
).
parent
fe44e558
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
envsetup.py
+6
-6
6 additions, 6 deletions
envsetup.py
utils.py
+9
-10
9 additions, 10 deletions
utils.py
with
15 additions
and
16 deletions
envsetup.py
+
6
−
6
View file @
acb9dd34
...
...
@@ -136,14 +136,14 @@ class EnvSetup():
elif
target
==
'
c
'
:
# Display current configuration
log
(
'
Configuration status:
'
)
status
=
utils
.
get_conf
(
'
_
config_status
'
)
if
not
status
:
log
(
'
No c
onfiguration.
'
)
override
=
utils
.
get_conf
(
'
_
override
'
)
if
not
override
:
log
(
'
C
onfiguration
status not available
.
'
)
else
:
log
(
'
Is default | Name | Value
'
)
for
name
,
i
nfo
in
status
.
items
():
is_default
=
'
\033
[9
4
m
yes
'
if
i
nfo
[
'
using_default
'
]
else
'
\033
[9
3
m
no
'
log
(
'
%s
\033
[0m |
\033
[95m%s
\033
[0m |
\033
[96m%s
\033
[0m
'
%
(
is_default
,
name
,
info
[
'
value
'
]
))
for
name
,
i
s_overriden
in
override
.
items
():
is_default
=
'
\033
[9
3
m
no
'
if
i
s_overriden
else
'
\033
[9
4
m
yes
'
log
(
'
%s
\033
[0m |
\033
[95m%s
\033
[0m |
\033
[96m%s
\033
[0m
'
%
(
is_default
,
name
,
utils
.
get_conf
(
name
)
))
else
:
# Run an action
found
=
False
...
...
This diff is collapsed.
Click to expand it.
utils.py
+
9
−
10
View file @
acb9dd34
...
...
@@ -41,12 +41,13 @@ def exec_cmd(cmd, get_out=False):
def
load_conf
():
base_dir
=
get_dir
(
__file__
)
files
=
(
(
DEFAULT_CONF_PATH
,
True
),
(
CONF_PATH
,
False
),
(
os
.
path
.
join
(
base_dir
,
DEFAULT_CONF_PATH
)
,
True
),
(
os
.
path
.
join
(
base_dir
,
CONF_PATH
)
,
False
),
)
only_default
=
True
status
=
OrderedDict
()
override
=
OrderedDict
()
for
path
,
is_default
in
files
:
if
not
os
.
path
.
exists
(
path
):
log
(
'
The configuration file for EnvSetup script does not exist.
\n
Path of configuration file: %s
'
%
path
,
error
=
True
)
...
...
@@ -64,21 +65,19 @@ def load_conf():
val
=
(
'
=
'
.
join
(
val
)).
strip
(
'
\t\'\"
'
)
CONF
[
name
]
=
val
if
is_default
:
status
[
name
]
=
dict
(
value
=
val
,
using_default
=
True
)
override
[
name
]
=
False
else
:
only_default
=
False
if
name
not
in
status
:
status
[
name
]
=
dict
()
status
[
name
][
'
value
'
]
=
val
status
[
name
][
'
using_default
'
]
=
False
CONF
[
'
_config_status
'
]
=
status
override
[
name
]
=
True
CONF
[
'
_override
'
]
=
override
# Check a value to know if the config file has been changed
if
only_default
:
log
(
'
\033
[93mWarning:
\033
[0m
'
)
log
(
'
The configuration is using only default values.
'
)
log
(
'
Perhaps you forget to change the configuration.
'
)
log
(
'
Path of configuration file: %s
'
%
CONF_PATH
)
log
(
'
Path of configuration file: %s
'
%
os
.
path
.
join
(
base_dir
,
CONF_PATH
)
)
log
(
'
Perhaps you want to quit this script to change the configuration?
\n
'
)
return
CONF
def
get_conf
(
name
,
default
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment