Changes between Version 13 and Version 14 of PyYAMLDocumentation


Ignore:
Timestamp:
05/07/06 03:05:55 (9 years ago)
Author:
xi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PyYAMLDocumentation

    v13 v14  
    956956{{{ 
    957957#!python 
     958Loader(stream) 
     959SafeLoader(stream) 
    958960BaseLoader(stream) 
    959 SafeLoader(stream) 
    960 Loader(stream) 
    961 }}} 
    962  
    963 '''`BaseLoader`''', '''`SafeLoader`''', and '''`Loader`''' provide the PyYAML ''Loader'' interfaces. 
    964 '''`Loader`''' is the most common of them and should be used in most cases. '''`BaseLoader`''' does not 
    965 resolve or support any tags and construct only basic Python objects: lists, dictionaries and Unicode strings. 
    966 '''`SafeLoader`''' supports only standard YAML tags and thus it does not construct class instances and 
    967 probably safe to use with documents received from an untrusted source. 
    968  
    969 '''`stream`''' is an input YAML stream. It can be a string, a Unicode string, an open file, an open Unicode file. 
     961}}} 
     962 
     963'''`BaseLoader`''', '''`SafeLoader`''', and '''`Loader`''' provide the following interfaces: 
     964 ''Scanner'', ''Parser'', ''Composer'', ''Constructor'', ''Resolver''. 
     965  
     966'''`Loader(stream)`''' is the most common of the above classes and should be used in most cases. 
     967`stream` is an input YAML stream. It can be a string, a Unicode string, an open file, an open Unicode file. 
     968 
     969'''`Loader`''' supports all predefined tags and may construct an arbitrary Python object. Therefore it is not safe to use 
     970`Loader` to load a document received from an untrusted source. By default, the functions `scan`, `parse`, 
     971`compose`, `construct`, and others use `Loader`. 
     972 
     973'''`SafeLoader(stream)`''' supports only standard YAML tags and thus it does not construct class instances and 
     974probably safe to use with documents received from an untrusted source. The functions `safe_load` and 
     975`safe_load_all` use `SafeLoader` to parse a stream. 
     976 
     977'''`BaseLoader(stream)`''' does not resolve or support any tags and construct only basic Python objects: 
     978lists, dictionaries and Unicode strings. 
     979 
    970980 
    971981 
     
    10171027 
    10181028==== Composer interface ==== 
     1029 
     1030{{{ 
     1031#!python 
     1032compose(stream, Loader=Loader) 
     1033compose_all(stream, Loader=Loader) 
     1034 
     1035Loader.check_node() 
     1036Loader.get_node() 
     1037}}} 
     1038 
     1039'''`compose(stream)`''' parses the given `stream` and returns the root of the representation graph 
     1040for the first document in the stream. If there are no documents in the stream, it returns `None`. 
     1041 
     1042'''`compose_all(stream)`''' parses the given `stream` and returns a sequence of representation graphs 
     1043corresponding to the documents in the stream. 
     1044 
     1045'''`Loader.check_node()`''' returns `True` is there are more documents available in the stream. Otherwise 
     1046it returns `False`. 
     1047 
     1048'''`Loader.get_node()`''' construct the representation graph of the next document in the stream and 
     1049returns its root node. 
    10191050 
    10201051