Commits

Anonymous committed 28cac02

[persister] .yaml extension added

Comments (0)

Files changed (1)

persister/flexible_persister.py

   default value, without any manipulation needed for the attributes)
 - the cache/dict issue:
   - the dir persister has a cache to avoid rereading the attributes in the file
-  - the yaml persister does not have a cache: all yaml data has to be continously
-    mirrored in the dict. So when the root yaml persister is created the whole
-    subpersister and all the attibutes go into memory
+  - the yaml persister does not have a cache: all yaml data has to be
+    continously mirrored in the dict. So when the root yaml persister is
+    created the whole subpersister and all the attibutes go into memory
 """
 import os
 import shutil
         return FlexiblePersister(name, self, create=create)
 
     def _compute_attribute_path_yaml(self, name):
-        return os.path.join(self.data_dir, name)
+        return os.path.join(self.data_dir, name) + '.yaml'
 
     def _compute_attribute_path_pickle(self, name):
-        """the pickle file must stay in the directory of the first ancestor which
-        is not an inside-yaml persister"""
+        """the pickle file must stay in the directory of the first ancestor
+        which is not an inside-yaml persister"""
         persister = self
         path_items = [name]
         count = 0
         "persist the persiter itself by writing the yaml file"
 
         if self.is_dir:
-            raise ValueError("can't write a yaml directory persister (named %s)" 
-                             % self.name)
+            raise ValueError("can't write a yaml directory persister "
+                             "(named %s)" % self.name)
         elif self.is_yaml:
             write_to_yaml_file(self.dict, self.yaml_path)
         else: