;ς
Fc           @   s°   d  k  Z  d  k Z d  k Z d  k Z d f  d     YZ e d j oh d Z e d d  Z e i d  e i d  e i	 d	  e i
 d
 e    e i	 d e    n d  S(   Ns   HTMLc           B   sΧ   t  Z e e e d  Z d d  Z d   Z d   Z d   Z d d d  Z d d d	  Z	 d d d d d
  Z
 d e d d d  Z d   Z e e d d  Z e d  Z e d  Z d   Z d   Z d   Z RS(   Nc         C   sΑ   g  |  _ g  |  _ | t j o |  i |  nC |  i d  t i o |  i d  n |  i d  |  i d  | o |  i d |  n | t j o |  i
 d |  n |  i
 d  d  S(   NsV  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="brinet ab">
<meta http-equiv="imagetoolbar" content="no">
sD   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
sI   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
s  
<meta http-equiv="Content-Language" content="sv">
<meta name="ROBOTS" content="All">
<meta name="RESOURCE-TYPE" content="document">
<meta name="distribution" content="GLOBAL">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Expires" content="Thu, 01 Dec 1994 16:00:00 GMT">
<link rel="STYLESHEET" href="./statistics.css" type="text/css">
s   <title>%s</title>
s
   <body %s>
s   <body>
(   s   selfs	   html_heads	   html_bodys   heads   Nones   append_heads   PL2_inis   useUTF8s	   win_titles	   body_argss   append_body(   s   selfs   heads	   body_argss	   win_title(    (    s   C:\Python\PL\html.pys   __init__   s    		
s   bodyc         C   s/   | d j o |  i |  n |  i |  d  S(   Ns   head(   s   parts   selfs   append_heads   codes   append_body(   s   selfs   codes   part(    (    s   C:\Python\PL\html.pys   append=   s    c         C   s   |  i i |  d  S(   N(   s   selfs	   html_heads   appends   code(   s   selfs   code(    (    s   C:\Python\PL\html.pys   append_headC   s    c         C   s   |  i i |  d  S(   N(   s   selfs	   html_bodys   appends   code(   s   selfs   code(    (    s   C:\Python\PL\html.pys   append_bodyF   s    c         C   s0   d d i  |  i  d i  |  i  f } | Sd S(   sΜ   
		print 'HEAD HEAD'
		print self.html_head
		print 'BODY BODY'
		print self.html_body

		import sys
		reload (sys)
		encode = sys.getdefaultencoding()

		print encode
		sys.setdefaultencoding('utf-8')
		s   %s</head>
%s</body>
</html>
s    N(   s   joins   selfs	   html_heads	   html_bodys   tmp_html(   s   selfs   tmp_html(    (    s   C:\Python\PL\html.pys	   html_codeI   s     ( s    c         C   s   |  i i d | | f  d  S(   Ns     <th scope="row" %s >%s</th>
(   s   selfs	   html_bodys   appends   header_paras   header(   s   selfs   header_paras   header(    (    s   C:\Python\PL\html.pys   tableHeaderRowScopec   s    c         C   s   |  i i d | | f  d  S(   Ns     <td %s >%s</td>
(   s   selfs	   html_bodys   appends	   data_paras   data(   s   selfs	   data_paras   data(    (    s   C:\Python\PL\html.pys   tableDataRowf   s    c         C   sX   |  i i d  |  i i d | | f  |  i i d | | f  |  i i d  d  S(   Ns   <tr>
s     <th scope="row" %s >%s</th>
s     <td %s >%s</td>
s   </tr>
(   s   selfs	   html_bodys   appends   header_paras   headers	   data_paras   data(   s   selfs   header_paras   headers	   data_paras   data(    (    s   C:\Python\PL\html.pys   tableRowScopei   s    s   %sc         C   s   |  i d |  d | d | d } xN | D]F } |  i | | d d d g | | d t |  j | d f  q. W|  i d	  d  S(
   Ns   <select %s>
s     <option value="s   "%s>s
   </option>
i    s    s   selectedi   s
   </select>
(
   s   selfs   append_bodys   argss   format1s   format2s
   option_strs   list_objectss   objects   strs   selected(   s   selfs   list_objectss   argss   selecteds   format1s   format2s
   option_strs   object(    (    s   C:\Python\PL\html.pys	   selectBoxo   s     Dc         C   sc   |  i   } t i d t |  d t i t i o t	 i
 |  Sn d GHHt	 i
 |  GHd  Sd  S(   Ns   Output HTML %s bytess   hosts   Content-type: text/html
(   s   selfs	   html_codes   htmlCodes   PL_debugs   debugMsgs   lens   PL2_inis	   debugHosts   twisteds   PL2_languages   swapLanguage(   s   selfs   htmlCode(    (    s   C:\Python\PL\html.pys   output_htmlv   s     
c         C   s  t  i oW t i d | d t  i t | d  } | i   }
 | i
   | i d d  |
 SnΉ t o8 d | d } t t d  } | i |  | i
   n t | d  } d	 GHy2 d  k }	 d  k } |	 i | i i   | i  Wn n Xd  k } | i i | i    | i
   d  S(
   Ns   twisted chart output: s   hosts   rbs   Content-types	   image/pngs   <map name="im" id="im"> 
s   </map>s   ws   Content-type: image/png
(   s   PL2_inis   twisteds   PL_debugs   debugMsgs	   imagefiles	   debugHosts   opens   fs   reads   images   closes   requests	   setHeaders   mapFiles   imageMaps
   outputfiles   writes   msvcrts   oss   setmodes   syss   stdouts   filenos   O_BINARY(   s   selfs	   imagefiles   requests   mapfiles   imageMaps   syss
   outputfiles   oss   fs   msvcrts   image(    (    s   C:\Python\PL\html.pys   output_image   s,    

 	c         C   s   t  i o. t i d d t  i | i d d  | Sn[ d GHy2 d  k } d  k	 } | i
 | i i   | i  Wn n Xd  k } | i i |  d  S(   Ns   twisted chart output: images   hosts   Content-types	   image/pngs   Content-type: image/png
(   s   PL2_inis   twisteds   PL_debugs   debugMsgs	   debugHosts   requests	   setHeaders   images   msvcrts   oss   setmodes   syss   stdouts   filenos   O_BINARYs   write(   s   selfs   images   requests   msvcrts   syss   os(    (    s   C:\Python\PL\html.pys   output_image2¬   s    
 	c   	      C   sZ  t  i d | d t i t i o d  k } t  i d d t i t | d  } | i	   } | i   | i d d  | i d d | i i |  d	  | Sn³ t i | } t  i d
 d t i t | d  } t  i d d t i d GHy2 d  k } d  k } | i | i i   | i  Wn n Xd  k } | i i | i	    | i   d  S(   Ns	   filename=s   hosts   Twisted export outputs   rbs   Content-Types   application/downloads   Content-Dispositions   attachment;filename="%s"i   s   Send the file to webbrowsers2   Output the exportfile as "application/is-download"s&   Content-type: application/is-download
(   s   PL_debugs   debugMsgs   filenames   PL2_inis	   debugHosts   twisteds   oss   opens   fs   reads   exports   closes   requests	   setHeaders   paths   splits   PL_paths
   exportfiles   msvcrts   setmodes   syss   stdouts   filenos   O_BINARYs   write(	   s   selfs   filenames   requests   fs   syss   exports
   exportfiles   oss   msvcrt(    (    s   C:\Python\PL\html.pys   downloadΔ   s.    
	
$ 	c         C   s,   | i t d  d  i t d  d  Sd  S(   Ni   s   %0Di
   s   %0A(   s   texts   replaces   chr(   s   selfs   text(    (    s   C:\Python\PL\html.pys
   escapeTextθ   s    c         C   s\   | i t d  d  i t d  d  i d d  i d d  i d	 d
  i d d  Sd  S(   Ni   s   %0Di
   s   %0As   "s   %22s   #s   %23s   &s   %26s   ?s   %3f(   s   texts   replaces   chr(   s   selfs   text(    (    s   C:\Python\PL\html.pys   escapeText2ν   s    c         C   sE   g  } x+ | D]# } | i d t t |    q Wd i |  Sd  S(   Ns   %s    (   s   esc_txts   texts   chrs   appends   hexs   ords   join(   s   selfs   texts   esc_txts   chr(    (    s   C:\Python\PL\html.pys   escapeText3φ   s
     !(   s   __name__s
   __module__s   Nones   __init__s   appends   append_heads   append_bodys	   html_codes   tableHeaderRowScopes   tableDataRows   tableRowScopes	   selectBoxs   output_htmls   output_images   output_image2s   downloads
   escapeTexts   escapeText2s   escapeText3(    (    (    s   C:\Python\PL\html.pys   HTML	   s    2				'$			s   __main__u   Bertil NΓ€slunds	   body_argssO   bgcolor="#e0e0e0" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"s   head part 1
s   head part 2
s   body part 1
s   body part 2 %(name)s
s^  
<form method=GET name="inputNAT" action="JavaScript:findXlate(document.inputNAT.NAT_IP.value)" style='margin:0px;'>
  <table>
    <tr>
      <td>
        <b>NAT IP-address</b><br>
        <input name="NAT_IP" value = "" size=14 >
        <input type="submit" value="Find Xlate">
        &nbsp;&nbsp;%(name)s
      </td>
    </tr>
  </table>
</form>
(   s   PL2_inis   PL_debugs   PL2_languages   oss   HTMLs   __name__s   names	   html_tests   append_heads   append_bodys   appends   vars(   s   PL2_inis   names	   html_tests   PL_debugs   PL2_languages   HTMLs   os(    (    s   C:\Python\PL\html.pys   ?   s   				υ