Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BIP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
BIP
Commits
85c49cea
Commit
85c49cea
authored
2 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF,BF: Small typos, resolve cfgdir, add len function
parent
f7998da1
No related branches found
No related tags found
1 merge request
!3
BIP configuration system
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bip/utils/config.py
+8
-3
8 additions, 3 deletions
bip/utils/config.py
with
8 additions
and
3 deletions
bip/utils/config.py
+
8
−
3
View file @
85c49cea
...
@@ -393,7 +393,7 @@ class Config:
...
@@ -393,7 +393,7 @@ class Config:
settings
=
Config
.
apply_overrides
(
settings
,
overrides
)
settings
=
Config
.
apply_overrides
(
settings
,
overrides
)
self
.
__settings
=
settings
self
.
__settings
=
settings
self
.
__cfgdir
=
cfgdir
self
.
__cfgdir
=
op
.
abspath
(
cfgdir
)
@property
@property
...
@@ -402,6 +402,11 @@ class Config:
...
@@ -402,6 +402,11 @@ class Config:
return
self
.
__cfgdir
return
self
.
__cfgdir
def
__len__
(
self
):
"""
Return the number of entries in this Config.
"""
return
len
(
self
.
__settings
)
def
__contains__
(
self
,
key
):
def
__contains__
(
self
,
key
):
"""
Return True if a configuration item with key exists.
"""
"""
Return True if a configuration item with key exists.
"""
return
key
in
self
.
__settings
return
key
in
self
.
__settings
...
@@ -414,7 +419,7 @@ class Config:
...
@@ -414,7 +419,7 @@ class Config:
def
__getattr__
(
self
,
key
):
def
__getattr__
(
self
,
key
):
"""
Return the configuration item with the specified key.
"""
"""
Return the configuration item with the specified key.
"""
return
self
[
k
w
ey
]
return
self
[
key
]
def
get
(
self
,
key
,
default
=
None
):
def
get
(
self
,
key
,
default
=
None
):
...
@@ -443,7 +448,7 @@ class Config:
...
@@ -443,7 +448,7 @@ class Config:
def
gettuple
(
self
,
prefix
=
None
,
**
kwargs
):
def
gettuple
(
self
,
prefix
=
None
,
**
kwargs
):
"""
Same as getall, but values are returned as a tuple.
"""
"""
Same as getall, but values are returned as a tuple.
"""
return
tuple
(
self
.
getall
(
prefix
,
**
kwargs
))
return
tuple
(
self
.
getall
(
prefix
,
**
kwargs
)
.
values
()
)
def
keys
(
self
):
def
keys
(
self
):
...
...
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