Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tree_maker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
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
ABP Computing
ABP Computing Sandbox
tree_maker
Commits
76fe655f
Commit
76fe655f
authored
3 years ago
by
Guido Sterbini
Browse files
Options
Downloads
Patches
Plain Diff
Adding config_to_yaml
parent
a7ccd1fa
No related branches found
No related tags found
2 merge requests
!2
Dev v0.0.1
,
!1
Dev v0.0.1
Pipeline
#2790221
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tree_maker/__init__.py
+1
-1
1 addition, 1 deletion
tree_maker/__init__.py
tree_maker/general.py
+6
-6
6 additions, 6 deletions
tree_maker/general.py
with
7 additions
and
7 deletions
tree_maker/__init__.py
+
1
−
1
View file @
76fe655f
...
...
@@ -11,7 +11,7 @@ from .general import tree_from_yaml
from
.general
import
tree_from_json
from
.general
import
from_yaml
from
.general
import
from_json
from
.general
import
py
_to_yaml
from
.general
import
config
_to_yaml
from
.tag
import
*
from
.tag_json
import
*
...
...
This diff is collapsed.
Click to expand it.
tree_maker/general.py
+
6
−
6
View file @
76fe655f
...
...
@@ -37,9 +37,9 @@ def from_json(filename, verbose=False):
if
verbose
:
print
(
e
)
return
{}
def
py
_to_yaml
(
filename
):
'''
Convert the
*filename*
.py (containg dictionaries) to an
equivalent
*filename*
.yaml
'''
import
filename
as
my_dict
with
open
(
filename
+
'
.yaml
'
,
'
w
'
)
as
fid
:
yaml
.
dump
(
my_dict
,
fid
)
def
config
_to_yaml
():
'''
Convert the
config
.py (containg dictionaries) to an
equivalent
config
.yaml
'''
import
config
as
my_dict
with
open
(
'
config
.yaml
'
,
'
w
'
)
as
fid
:
yaml
.
dump
(
my_dict
.
configuration
,
fid
)
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