Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cyrinux
Hiboo
Commits
f1845ab6
Verified
Commit
f1845ab6
authored
3 months ago
by
cyrinux
Browse files
Options
Downloads
Patches
Plain Diff
chore: wip
parent
3538cf28
Branches
dev
No related tags found
No related merge requests found
Pipeline
#34694
passed
3 months ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hiboo/configuration.py
+13
-15
13 additions, 15 deletions
hiboo/configuration.py
with
13 additions
and
15 deletions
hiboo/configuration.py
+
13
−
15
View file @
f1845ab6
...
...
@@ -42,24 +42,22 @@ class ConfigManager(dict):
def
init_app
(
self
,
app
):
self
.
config
.
update
(
app
.
config
)
# get environment variables
self
.
config
.
update
(
{
key
:
self
.
__coerce_value
(
os
.
environ
.
get
(
key
,
value
))
for
key
,
value
in
DEFAULT_CONFIG
.
items
()
}
)
self
.
config
.
update
(
{
key
:
self
.
__coerce_value
(
os
.
environ
.
get
(
key
,
value
))
for
key
,
value
in
self
.
get_config_by_prefix
(
"
CACHE_
"
).
items
()
}
)
# update the logging config if necessary
# Get environment variables for all keys
self
.
config
.
update
({
key
:
self
.
__coerce_value
(
os
.
environ
.
get
(
key
,
value
))
for
key
,
value
in
DEFAULT_CONFIG
.
items
()
})
# Ensure environment variables for CACHE_ keys are handled
self
.
config
.
update
({
key
:
self
.
__coerce_value
(
os
.
environ
.
get
(
key
,
DEFAULT_CONFIG
.
get
(
key
)))
for
key
in
os
.
environ
.
keys
()
if
key
.
startswith
(
'
CACHE_
'
)
})
# Update the logging config if necessary
if
self
.
config
.
get
(
"
DEBUG
"
,
False
):
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
#
u
pdate the app config itself
#
U
pdate the app config itself
app
.
config
=
self
def
setdefault
(
self
,
key
,
value
):
if
key
not
in
self
.
config
:
...
...
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