Professional Documents
Culture Documents
cgitb.enable()
import sys
import os
import shutil
def main():
while d != y:
(c,d) = os.path.split(src)
skip_list.append(d)
src = c
a+=1
newdst = os.path.join(dst,skip_list[a-1])
try:
shutil.copytree(newsrc,newdst)
except EnvironmentError:
print "content-type: text/html\n"
print "<h1>Error happened in copying . Baseline not updated</h1>"
else:
print "content-type: text/html\n"
print "<h1>Baseline has been updated successfully</h1>"
# running a loop for each of the file to check whether it's a .pdf or .ps
for file in files:
(Name,exten) = os.path.splitext(file)
if ( exten == ".pdf"):
path1 = sys.argv[3] + os.sep + file
(filepath1, filename1) = os.path.split(dst)
(shortname, extension) = os.path.splitext(filename1)
(filepath2, filename2) = os.path.split(dst)
if(extension==".ps"):
shutil.copy2(path1,filepath2)
if(extension==".pdf"):
shutil.copy2(path1,filepath2)
#base_prev_modtime = os.stat(dst).st_mtime
if(0):
print "content-type: text/html\n"
print "<h1>Error happened in copying. Baseline not updated</h1>"
else:
print "content-type: text/html\n"
print "<h1>Baseline has been updated successfully</h1>"
if __name__ == "__main__":
main()