__copyright__ = "Copyright (C) 2004-2006 PhiloSoft Design"
-import os, shutil
+import os, shutil, filecmp
os.umask(0022) # octal; -rw-r--r--
from m_lib.m_path import get_homedir
else:
next = file_types[i+1][0]
add_headers(fname, prev, next)
- os.rename(fname + ".html", fname + ".tmpl")
+ if os.path.exists(fname + ".tmpl") and filecmp.cmp(fname + ".html", fname + ".tmpl"):
+ os.remove(fname + ".html")
+ else:
+ os.rename(fname + ".html", fname + ".tmpl")
os.chmod(fname, 0644)