Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Leipzig Machine Learning Group
conML
python
Commits
7f2c26f5
Commit
7f2c26f5
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Load default settings if the user does not specify a path.
parent
abdcd33f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cml/controller/api.py
+17
-1
17 additions, 1 deletion
cml/controller/api.py
with
17 additions
and
1 deletion
cml/controller/api.py
+
17
−
1
View file @
7f2c26f5
"""
Entry point.
"""
from
cml.usecases.query
import
PreprocessUsecase
from
os.path
import
join
,
expanduser
from
cml.usecases.query
import
PreprocessUsecase
,
KnowledgeSearchUsecase
from
cml.ports.source_adapters
import
PandasAdapter
from
cml.shared.settings
import
Settings
from
cml.shared.settings
import
specific_settings_factory
,
read_settings
...
...
@@ -22,6 +24,20 @@ __all__ = (
)
def
default_path
(
func
):
def
wrapper
(
path
:
str
=
None
):
if
not
path
:
path
=
join
(
expanduser
(
"
~
"
),
"
.cml
"
,
"
settings.ini
"
)
try
:
func
(
path
)
except
FileNotFoundError
as
e
:
# TODO (dmt):Provide proper exception handling!
pass
return
wrapper
@default_path
def
load_settings
(
path
:
str
):
read_settings
(
path
)
...
...
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