Normalize module docstring format
[invirt/packages/invirt-base.git] / python / invirt / config.py
index 8c5e7e2..1589889 100644 (file)
@@ -1,5 +1,6 @@
 from __future__ import with_statement
 
+from __future__ import absolute_import
 import json
 from invirt.common import *
 import os
@@ -63,7 +64,7 @@ def list_files():
 def load_master():
     config = dict()
     for filename in list_files():
-        with closing(file(filename)) as f:
+        with closing(open(filename)) as f:
             augment(config, yaml.load(f, loader))
     return config
 
@@ -116,7 +117,7 @@ def load(force_refresh = False):
         # lock with other concurrent reads).  This isolation is accomplished
         # using an atomic filesystem rename in the refreshing stage.
         try: 
-            with closing(file(cache_path)) as f:
+            with closing(open(cache_path)) as f:
                 ns.cfg = json.read(f.read())
         except: do_refresh = True
 
@@ -131,7 +132,7 @@ def load(force_refresh = False):
             with lock_file(lock_path):
                 ns.cfg = load_master()
                 try: 
-                    with closing(file(cache_path + '.tmp', 'w')) as f:
+                    with closing(open(cache_path + '.tmp', 'w')) as f:
                         f.write(json.write(ns.cfg))
                 except: pass # silent failure
                 else: rename(cache_path + '.tmp', cache_path)
@@ -140,6 +141,5 @@ def load(force_refresh = False):
     return ns.cfg
 
 dicts = load()
-structs = dicts2struct(dicts)
-
-# vim:et:sw=4:ts=4
+structs = dicts2struct(dicts, '')
+safestructs = dicts2struct(dicts, '', '')