%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/vdo/utils/ |
Current File : //lib/python2.7/site-packages/vdo/utils/YAMLObject.pyo |
� .�t_c @ sH d Z d d l Z d d l Z e j d � d e j f d � � YZ d S( s} YAMLObject - Provides mapping to/from YAML. $Id: //eng/vdo-releases/magnesium/src/python/vdo/utils/YAMLObject.py#2 $ i����Nt utilst YAMLObjectc B s� e Z d Z e j Z e d � � Z e d � � Z d � Z e d � � Z e d � � Z e d � � Z d � Z e d � � Z d � Z RS( s� Provides conversion of objects to and from YAML representations. The attributes that are included in the YAML representation are taken from an instance's __dict__ filtered through the list returned from the _yamlAttributeKeys property. The list from the _yamlAttributeKeys property is used to check for missing attributes when generating the YAML representation. It is also used to check for missing or extraneous attributes when constructing an instance from the YAML representation. Subclasses must override _yamlAttributeKeys. Subclasses must specify the class attribute yaml_tag which indicates the type of the instance in the YAML representation. Class attributes: yaml_tag (unicode string) - YAML representation identfifier; must be specified by subclasses yaml_loader - The loader to use; set to yaml.SafeLoader to allow yaml.load_safe() to instantiate objects c c s1 | j � } | V| j | � } | j | � d S( s� Constructs and returns an instance from its YAML representation. Returns: instance constructed from YAML representation. N( t _yamlMakeInstancet construct_mappingt _yamlSetAttributes( t clst loadert nodet instancet mapping( ( s8 /usr/lib/python2.7/site-packages/vdo/utils/YAMLObject.pyt from_yaml>