vj12
clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

increment_spans.py
text/x-python

Download raw (292 bytes)

#! /usr/bin/python

from BeautifulSoup import BeautifulSoup
from sys import argv


f = open(argv[1])
soup = BeautifulSoup(f.read())
f.close()

for i, node in enumerate(soup.findAll('span')):
    node['id'] = "c_%04d" % i
    node['class'] += " chunk"
    #print(node)

print(soup.prettify())