# Author : Scott Hathaway # Version : 0.0.1 # Date : 3/22/2002 # Purpose : This script creates an html report of a website # : that includes the total number of files, the # : total number of files that have another file # : linked to them, and the number that have no links. # Notes : This script takes two command-line arguments as follows - # : site_info.py "c:/path/to/website/" "c:/file/to/write.html" # Credits : DirectoryWalker and normalDate are # : not my scripts. If you know who wrote them, # : please let me know and I will give the proper # : credit. # Misc : More free scripts and programs at - # : www.hcsprogramming.com # : scott@hcsprogramming.com # : Feel free to improve this program and send me the changes. # : I will post them here for others to download. import DirectoryWalker import os import sys from normalDate import ND dwFiles = DirectoryWalker.DirectoryWalker(sys.argv[1]) allFiles=[] checkedFiles=[] unCheckedFiles=[] referencedFiles=[] unReferencedFiles=[] i=1 for file in dwFiles: if os.path.exists(file) and os.path.isfile(file) and os.path.basename(file) != '.' and os.path.basename(file) != '..': file = file.lower() file = file.replace('\\','/') allFiles.append(file) file = str(file) if (file.endswith('html')==1) or (file.endswith('htm')==1) or (file.endswith('asp')==1) or (file.endswith('php')==1) or (file.endswith('js')==1) or (file.endswith('vbs')==1) or (file.endswith('inc')==1) or (file.endswith('css')==1) : checkedFiles.append(file) else: unCheckedFiles.append(file) a = "
\n" a += "| Total Files | " + str(len(allFiles)) + " | |
| Checked Files | " + str(len(checkedFiles)) + " | |
| UnChecked Files | " + str(len(unCheckedFiles)) + " |