Changes between Version 30 and Version 31 of PyYAMLDocumentation


Ignore:
Timestamp:
06/19/06 13:09:58 (8 years ago)
Author:
xi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PyYAMLDocumentation

    v30 v31  
    297297}}} 
    298298 
     299 
    299300The default representation for '''`Dice`''' objects is not nice: 
    300301{{{ 
     
    416417- APL 
    417418- ASP 
     419 
    418420- Assembly 
    419421- Awk 
     
    984986 
    985987 
    986 === YAMLError === 
    987  
    988 {{{ 
    989 #!python 
    990 YAMLError() 
    991 }}} 
    992  
    993 If YAML parser encounters an error condition, it raises an exception which is an instance of 
    994 '''`YAMLError`''' or of its subclass. An application may catch this exception and warn a user. 
    995 {{{ 
    996 #!python 
    997 try: 
    998     config = yaml.load(file('config.yaml', 'r')) 
    999 except yaml.YAMLError, exc: 
    1000     print "Error in configuration file:", exc 
    1001 }}} 
    1002  
    1003  
    1004988=== Mark === 
    1005989{{{ 
     
    1013997'''`buffer`''', when it is not `None`, is a part of the input stream that contain the position 
    1014998and '''`pointer`''' refers to the position in the `buffer`. 
     999 
     1000 
     1001=== YAMLError === 
     1002 
     1003{{{ 
     1004#!python 
     1005YAMLError() 
     1006}}} 
     1007 
     1008If the YAML parser encounters an error condition, it raises an exception which is an instance of 
     1009'''`YAMLError`''' or of its subclass. An application may catch this exception and warn a user. 
     1010{{{ 
     1011#!python 
     1012try: 
     1013    config = yaml.load(file('config.yaml', 'r')) 
     1014except yaml.YAMLError, exc: 
     1015    print "Error in configuration file:", exc 
     1016}}} 
     1017 
     1018An exception produced produced by the YAML processor may point to the problematic position. 
     1019{{{ 
     1020#!python 
     1021>>> try: 
     1022...     yaml.load("unbalanced blackets: ][") 
     1023... except yaml.YAMLError, exc: 
     1024...     if hasattr(exc, 'problem_mark'): 
     1025...         mark = exc.problem_mark 
     1026...         print "Error position: (%s:%s)" % (mark.line+1, mark.column+1) 
     1027 
     1028Error position: (1:22) 
     1029}}} 
    10151030 
    10161031 
     
    11231138TagToken(value=(u'!!', u'int')) 
    11241139ScalarToken(plain=False, style="'", value=u'5') 
     1140 
    11251141BlockEntryToken() 
    11261142AliasToken(value=u'A')