Sharedwww / sagesrc / update.pyOpen in CoCalc
#!/usr/bin/python

import os
os.chdir('/home/was/www/sagesrc')
os.system('rm -rf sage')
os.system('cp -rv /home/was/www/sage/dist/src/sage-darcs/sage/ .')

def fix_ext(d):
    for F in os.listdir(d):
        print F
        f = '%s/%s'%(d,F)
        print f
        if os.path.isdir(f):
            fix_ext(f)
        elif f[-4:] != '.txt':
            os.system('mv %s %s.txt'%(f,f))

fix_ext('sage')