Bastos

let’s code!


Tidy facilitando a vida do designer, de nada cara ;)

#!/usr/bin/python
# -*- coding: latin-1 -*-
from __future__ import with_statement
import os

for root, dirs, files in os.walk('./tidythis'):
    for arq in files:
        print 'PROCESSANDO: '+os.path.join(root,arq)
        if arq[-3:] == 'php':
            os.popen('tidy -asxhtml -latin1 -icm '+os.path.join(root,arq)+' >>out.txt', 'rb')
        else:
            print 'ARQUIVO '+os.path.join(root,arq)+' nao eh php'

Published by Bastos, on May 16th, 2007 at 10:54 am. Filled under: code, python, xhtml | 1 Comment