<|file_name|>restore.py<|end_file_name|><｜fim▁begin｜>import os
import shutil
from glob import glob

print 'Content-type:text/html\r\n\r\n'
print '<html>'

found_pages = glob('archive/*.py')

if found_pages:
        <|fim_middle|>


if not found_pages:
    print 'Nothing to restore'

print '</html>'

# EOF
<｜fim▁end｜>
    path = "/cgi-bin/archive/"
    moveto = "/cgi-bin/pages/"
    files = os.listdir(path)
    files.sort()
    for f in files:
        src = path+f
        dst = moveto+f
        shutil.move(src, dst)
    print 'All pages restored'
    print '<meta http-equiv="refresh" content="1";>'