File: omp_decimal_align.py

package info (click to toggle)
graphicsmagick 1.4%2Breally1.3.46-2
  • links: PTS
  • area: main
  • in suites: sid
  • size: 41,896 kB
  • sloc: ansic: 250,504; cpp: 18,843; sh: 9,308; perl: 3,634; makefile: 2,568; tcl: 2,209; python: 1,250
file content (19 lines) | stat: -rwxr-xr-x 399 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ts=4:sw=4:expandtab:

# Copyright 2008 Mark Mitchell
# License: Same as GraphicsMagick.

import sys
import re

try:
    infilename = sys.argv[1]
    infile = file(infilename, 'r')
except IndexError:
    infile = sys.stdin

for line in infile:
    line = re.sub(r'<td>(\d+\.\d+</td>)', r'<td class="decimal">\1', line)
    sys.stdout.write(line)