SEESenv/scripts/changenames.py
author amit@thunder
Tue, 02 Mar 2010 17:07:14 +0530
changeset 41 e54725be4df6
parent 40 ef147a79b098
child 43 134b87b382f5
permissions -rw-r--r--
Changed paths dependent on repo location to be taken from the script also changed how the soup is printed

import glob
import subprocess
import re
import time
import os
import sys
repo=sys.argv[1]
names= glob.glob(os.path.join(repo,'ch1*.html'))
for name in names:
    reg_obj=re.compile(os.path.join(repo,'ch1[0-9].*.html'))
    if (reg_obj.match(name)):
        changed_name=re.sub('ch1','chn1',name)
    else:
        changed_name=name    
    command="cp %s %s" %(name ,changed_name)
    subprocess.Popen(command,shell=True)
    time.sleep(2)