Changeset 784


Ignore:
Timestamp:
Jul 29, 2008, 11:39:06 PM (16 years ago)
Author:
y_z
Message:

lazily import yaml for faster module load times

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-base/files/usr/share/python-support/sipb-xen-base/invirt/config.py

    r781 r784  
    1 import json, yaml
     1import json
    22from invirt.common import *
    33from os.path import getmtime
     
    3737        @with_lock_file('/var/lib/invirt/cache.lock')
    3838        def cfg():
     39            import yaml
    3940            cfg = with_closing(file(src_path))(lambda f: yaml.load(f, default_loader))
    4041            try: with_closing(file(cache_path, 'w'))(lambda f: f.write(json.write(cfg)))
Note: See TracChangeset for help on using the changeset viewer.