From 76fe655f3938b67e079f194f2dede85905589a44 Mon Sep 17 00:00:00 2001
From: Guido Sterbini <sterbini@hpc-201-11-01-a.cr.cnaf.infn.it>
Date: Mon, 5 Jul 2021 12:08:45 +0200
Subject: [PATCH] Adding config_to_yaml

---
 tree_maker/__init__.py |  2 +-
 tree_maker/general.py  | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tree_maker/__init__.py b/tree_maker/__init__.py
index e882033..96553ef 100644
--- a/tree_maker/__init__.py
+++ b/tree_maker/__init__.py
@@ -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 * 
 
diff --git a/tree_maker/general.py b/tree_maker/general.py
index bcdddb0..64b2c9e 100644
--- a/tree_maker/general.py
+++ b/tree_maker/general.py
@@ -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)
-- 
GitLab