Changeset 119


Ignore:
Timestamp:
03/19/06 10:41:32 (9 years ago)
Author:
xi
Message:

Add an example: yaml highlight script.

Usage:

$ cat your_yaml_document | ./yaml_hl.py                         # Produces colored ASCII output
$ cat your_yaml_document | ./yaml_hl.py -c yaml_hl_html.cfg     # Produces HTML output.
Location:
pyyaml/trunk
Files:
5 added
2 edited

Legend:

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

    r116 r119  
    44class Mark: 
    55 
    6     def __init__(self, name, line, column, buffer, pointer): 
     6    def __init__(self, name, index, line, column, buffer, pointer): 
    77        self.name = name 
     8        self.index = index 
    89        self.line = line 
    910        self.column = column 
  • pyyaml/trunk/lib/yaml/reader.py

    r116 r119  
    145145    def get_mark(self): 
    146146        if self.stream is None: 
    147             return Mark(self.name, self.line, self.column, 
     147            return Mark(self.name, self.index, self.line, self.column, 
    148148                    self.buffer, self.pointer) 
    149149        else: 
    150             return Mark(self.name, self.line, self.column, None, None) 
     150            return Mark(self.name, self.index, self.line, self.column, 
     151                    None, None) 
    151152 
    152153    def determine_encoding(self): 
Note: See TracChangeset for help on using the changeset viewer.