Sharedwww / sagesrc / update.pyOpen in CoCalc
Author: William A. Stein
1
#!/usr/bin/python
2
3
import os
4
os.chdir('/home/was/www/sagesrc')
5
os.system('rm -rf sage')
6
os.system('cp -rv /home/was/www/sage/dist/src/sage-darcs/sage/ .')
7
8
def fix_ext(d):
9
for F in os.listdir(d):
10
print F
11
f = '%s/%s'%(d,F)
12
print f
13
if os.path.isdir(f):
14
fix_ext(f)
15
elif f[-4:] != '.txt':
16
os.system('mv %s %s.txt'%(f,f))
17
18
fix_ext('sage')
19
20