ó
!å Rc           @   s=   d  d l  Z  d  d l Z d Z d Z d „  Z d d „ Z d S(   iÿÿÿÿNs   
<!DOCTYPE html>
<head>
	<link rel="stylesheet" type="text/css" href="/html/css/style.css"> 
</head> 

<body> 

	<div id=container>

		<div id="head_info">

s!   
		</div>
	<div>
</body>
</html>
c          C   sZ   d }  t  j j |  ƒ s, t  j j |  ƒ r< t  j |  ƒ n t j |  ƒ t  j |  ƒ d  S(   Nt   report(   t   ost   patht   isdirt   existst   mkdirt   shutilt   rmtree(   R    (    (    sJ   /vol/project/2012/wmproject2013/chandra/web-project/Crawler/make_report.pyt
   create_dir   s
    &t   rootc         C   sU  d GH| d k r= t  d d ƒ } | j t ƒ | j d ƒ nD | j d ƒ d } t  d | d	 d ƒ } | j t ƒ | j d
 ƒ | j d ƒ | j d ƒ d } t } x‹|  j ƒ  D]}\ } } | j d ƒ rÜ | d  } n  | rø | j d ƒ t } n | j d ƒ t } | j d | d ƒ | j d ƒ | j d ƒ xe | d j ƒ  D]S \ } }	 | | d t | d | ƒ d 7} | j d | d t |	 ƒ d ƒ qKWxe | d j ƒ  D]S \ } }
 | | d t | d | ƒ d 7} | j d | d t |
 ƒ d ƒ q³W| d t | ƒ GH| j d ƒ | j d ƒ | j d  ƒ | j d! ƒ | j d" ƒ | j d# | d$ ƒ | j d% ƒ | j d& t | | ƒ d' ƒ | j d( ƒ | j d ƒ | j d) ƒ | j d* ƒ | j d# | d+ ƒ | j d& | d, ƒ | j d( ƒ | j d ƒ | j d ƒ | j d- ƒ q´ W| j t	 ƒ | j
 ƒ  d. GHd  S(/   Ns   Creating a report ....R	   s   report/report.htmlt   ws5   			<p>This page is generated for the web master!</p>
t   @i    s   report/s   .htmls4   			<p>This page is generated for {{user_name}}!</p>
s   </div>s   		<div id="mini-container">
t    t   /iÿÿÿÿs   	<div id="parent_page1">
s   	<div id="parent_page2">
s   		<p id="parent_link">s   </p>
s   		<div id="broken_links">
si   		<table id="broken_links_talbe"><thead><tr><th>Broken Links</th><th>Error Code</th></tr></thead><tbody>
t   ;i   t   |s   			<tr><td>s	   </td><td>s   </td></tr>
i   t    s   		</tbody></table>
s	   		</div>
s   		<div id="form">
s   		<div id="mock_form">
s-   			<form method="get" action="/mockthepage">
s   			<button name="url" value="s   ">See mock page!</button>
sD   			<input type="hidden" value="{{user_name}}" name="uname"></input>
s   			<input type="hidden" value="s   " name="location">
s   			</form>
s   		<div id="source_form">
s-   			<form method="post" action="/seesource/">
s   ">View source page!</button>
s   " name="pointers"></input>
s   	</div>
s!   Report created for the root user!(   t   opent   writet
   html_startt   splitt   Truet	   iteritemst   endswitht   Falset   strt   html_endt   close(   t   error_linkst   locationt   usernamet   ft   post_messaget
   choose_divt   urlt   brokent	   brokenURLt   httperrt   urlerr(    (    sJ   /vol/project/2012/wmproject2013/chandra/web-project/Crawler/make_report.pyt   writeHTMLDoc   sh    	$'$'
(   R   R   R   R   R   R'   (    (    (    sJ   /vol/project/2012/wmproject2013/chandra/web-project/Crawler/make_report.pyt   <module>   s
   
	