Ignore:
Timestamp:
08/21/07 16:25:34 (7 years ago)
Author:
xi
Message:

Make compose() and load() ensure that the input stream contains a single document. Fixes #54.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/lib/yaml/constructor.py

    r251 r258  
    3737        if self.check_node(): 
    3838            return self.construct_document(self.get_node()) 
     39 
     40    def get_single_data(self): 
     41        # Ensure that the stream contains a single document and construct it. 
     42        node = self.get_single_node() 
     43        if node is not None: 
     44            return self.construct_document(node) 
     45        return None 
    3946 
    4047    def construct_document(self, node): 
Note: See TracChangeset for help on using the changeset viewer.