def copymode(src, dst):
"""Copy mode bits from src to dst"""
if hasattr(os, 'chmod'):
st = os.stat(src)
mode = stat.S_IMODE(st.st_mode)
os.chmod(dst, mode)
import sys import re from os.path import exists from shutil import move, copymode ns_exp = re.compile(r'http://naeblis.cx/ns/kid#') omit_exp = re.compile(r'py:omit=')
fo = open(fout, 'wb')
fo.write(text)
fo.close()
copymode(fin, fout)
print 'Upgraded: %s...' % fout
if len(sys.argv) == 1: