6 filename=doc_root_directory +
"/example_code_list/html/index.html"
7 index_file=open(filename)
8 entire_file = index_file.read()
12 urls = re.findall(
r'[Hh][Rr][Ee][Ff] *= *[\'"]?([^\'" >]+)',entire_file)
22 new_url = string.replace(url,
"../../../doc",
"../..")
23 if new_url.startswith(
'..'):
26 local_urls.append(new_url[4:new_url.index(
"#")])
28 local_urls.append(new_url[4:])
31 find_command =
"find " + doc_root_directory +
" -name \'index.html\'"
33 proc = subprocess.Popen(find_command, shell=
True, stdin=subprocess.PIPE,\
34 stdout=subprocess.PIPE)
36 local_files = proc.stdout.read()
37 new_local_files = local_files.split()
41 for url
in new_local_files:
42 local_file = string.replace(url,doc_root_directory,
"./")
43 local_files.append(local_file)
45 new_local_files = local_files
48 print "Files not linked in example list file\n"
50 for url
in new_local_files:
51 if url
not in local_urls:
def search_dead_links(doc_root_directory)
Definition: check_links_in_example_list.py:4