;ò
"Fc           @   sa  d  k  Z  d k Td  k Z d  k Z d k Td k l Z d k l Z d k l Z d  k	 Z	 d  k
 Z
 d  k Z d  k Z d  k Z d „  Z e d e i ƒ e d e i ƒ d k Tg  g d Z g  e e <d	 d
 d d d d d d d d d d d g e e <d d d d d d d g e e <d	 d
 d d d d d d d d d d d d d d d g e e <d  d! d" d# d$ d% d& d' d( d) d* d+ g e e <d, d- d. d/ d/ d/ d/ d/ d/ d/ d/ d/ g Z d0 d1 d2 d/ d/ d/ d/ d/ d/ d/ d/ d/ g Z d3 d4 d5 d6 d7 d8 d9 g Z d: f  d; „  ƒ  YZ d< f  d= „  ƒ  YZ d> e f d? „  ƒ  YZ d@ f  dA „  ƒ  YZ dB f  dC „  ƒ  YZ dD dE „ Z dF dG dH dI „ Z dJ g  dK „ Z  dL „  Z! dF dM „ Z" dF dN „ Z# dO „  Z$ e% d/ dP „ Z& dQ „  Z' dR „  Z( dS „  Z) dT „  Z* dU „  Z+ dV „  Z, dW „  Z- e% dF dX „ Z. dF dY „ Z/ dZ „  Z0 d[ „  Z1 d\ „  Z2 d] „  Z3 e4 d^ j o e i5 d_ GHe dF ƒ n d  S(`   N(   s   *(   s   Sorter(   s   strptime(   s   logc         C   sa   t  i i d d ƒ } |  | i t  i ƒ j o. | t  i |  i t  i ƒ } | t  i d <n d  S(   Ns   FONTPATHs    (   s   oss   environs   gets   fontPaths   paths   splits   pathseps   lstrip(   s   paths   fontPath(    (    s   C:\Python\PL\drawgraph.pys   addEnvirionFontPath   s    s   .%scd_fontss   .%sfontsi   s   1s   3s   5s   7s   9s   11s   13s   15s   17s   19s   21s   23s    s   Mos   Tus   Ws   T,s   Fs   Ss   25s   27s   29s   31s   Jans   Febs   Mars   Aprs   Mays   Juns   Juls   Augs   Seps   Octs   Novs   Deci  à i àÿ i@ ÿ i    i  € i €  i€   s   Mondays   Tuesdays	   Wednesdays   Thursdays   Fridays   Saturdays   Sundays	   GraphDatac           B   sn   t  Z d d d „ Z d „  Z d „  Z d d „ Z d „  Z d d „ Z d	 „  Z d
 „  Z	 d „  Z
 d „  Z RS(   Ni    c         C   sË  | |  _  | |  _ |  i ƒ  t i d | d d ƒ |  _ t i d | d d ƒ |  _ t i d | d d ƒ |  _ d |  _	 g  |  _
 g  |  _ g  |  _ g  |  _ t d ƒ |  _ t d ƒ |  _ t d ƒ |  _ t d ƒ |  _ t d ƒ |  _ t d ƒ |  _ t d ƒ |  _ g  |  _ g  |  _ g  |  _ g  |  _ d |  _ t d ƒ |  _ t d ƒ |  _ t d ƒ |  _ d |  _ d |  _ d |  _  g  |  _! g  |  _" g  |  _# g  |  _$ d |  _% t& d ƒ |  _' d |  _( t) d ƒ d  S(	   Ns   shapes   types   Float32i    s   In s   Outs   Tots   DIST-0000-04a9-8e46-eec8(*   s   sizeBarDatas   selfs   sizeLineDatas   initEmptyBarDatas   numarrays   zeross	   lineData0s	   lineData1s	   lineData2s   measurepointss   clickableLabelss   areaDatas   pie_datas	   pie_nodess   floats   traffic_total_outs   traffic_total_ins   traffic_totals   outbound_maxvalues   inbound_maxvalues   total_maxvalues   maxvalues   nodess
   labelColors	   VBS_speeds   VBS_speedValues
   VBS_shapeds   speed_total_in_avgs   speed_total_out_avgs   speed_total_tot_avgs	   data0Names	   data1Names	   data2Names
   bar_labelss   speed_labelss
   pie_labelss   area_labelss   pie_explodes   ints   hostss   time_index_adjs   setLicenseCode(   s   selfs   sizeBarDatas   sizeLineData(    (    s   C:\Python\PL\drawgraph.pys   __init__6   sJ    		
																			c         C   s^   t  i d |  i d d ƒ |  _ t  i d |  i d d ƒ |  _ t  i d |  i d d ƒ |  _ d  S(   Ns   shapes   types   Float32(   s   numarrays   zeross   selfs   sizeBarDatas   barData0s   barData1s   barData2(   s   self(    (    s   C:\Python\PL\drawgraph.pys   initEmptyBarDatan   s    c         C   s+   | t j o d |  _ n | d |  _ d  S(   Ni   (   s
   chart_types
   HOUR_CHARTs   selfs   measurepointss   daysInChart(   s   selfs
   chart_types   daysInChart(    (    s   C:\Python\PL\drawgraph.pys   setMeasurepointst   s    f8.0c         C   sF   t  |  i ƒ | |  _ t  |  i ƒ | |  _ t  |  i ƒ | |  _ d  S(   N(	   s   maxs   selfs	   lineData0s   divs   inbound_maxvalues	   lineData1s   outbound_maxvalues	   lineData2s   total_maxvalue(   s   selfs   div(    (    s   C:\Python\PL\drawgraph.pys   calcMaxvaluesz   s    c         C   sI   t  d „  |  i ƒ |  _ t  d „  |  i ƒ |  _ |  i |  i |  _ d  S(   Nc         C   s   |  | S(   N(   s   xs   y(   s   xs   y(    (    s   C:\Python\PL\drawgraph.pys   <lambda>‚   s    (   s   reduces   selfs   barData0s   traffic_total_ins   barData1s   traffic_total_outs   traffic_total(   s   self(    (    s   C:\Python\PL\drawgraph.pys   calcTotalvalues€   s    c         C   s¹   | d j o d |  _ d |  _ d |  _ n= |  i | | |  _ |  i | | |  _ |  i | | |  _ t	 i
 oC t d t | ƒ d t |  i ƒ d t |  i ƒ d t	 i ƒn d  S(   Ni    s   speedLineTime=s    s   host(   s   speedLineTimes   selfs   speed_total_in_avgs   speed_total_out_avgs   speed_total_tot_avgs   traffic_total_ins   muls   traffic_total_outs   traffic_totals   PL2_inis   developments   debugMsgs   strs	   debugHost(   s   selfs   speedLineTimes   mul(    (    s   C:\Python\PL\drawgraph.pys   calcAvgSpeed†   s    		
c         C   s­  | t j o
 t | ƒ o t | ƒ } n d } t i o t d | ƒ n t i ƒ  } } t
 i d |  i d d ƒ |  _ t
 i d |  i d d ƒ |  _ t
 i d |  i d d ƒ |  _ d } | o£ x  | D]” } t | d d d ƒ d j o# t | d d d ƒ |  i | <n t | d	 d d ƒ d j o# t | d	 d d ƒ |  i | <n | d
 7} qÊ Wn |  i |  i |  _ t i o& t d t t i ƒ  | ƒ d ƒ n d  S(   Ni    s&   Take care of data from PL2: %s recordss   shapes   types   Floats   iniè  i   s   outi   s   Prepare PL2-data took s    sec.(   s
   graph_lists   Nones   lens   noValuess   PL2_inis   developments   debugMsgs   times   timers   timer1s   numarrays   zeross   selfs   measurepointss   data_inbounds   data_outbounds
   data_totals   indexs   xs   floats   str(   s   selfs
   graph_lists   indexs   timers   timer1s   xs   noValues(    (    s   C:\Python\PL\drawgraph.pys   buildDataFromPL2—   s*    
 ##
c         C   s–  t  i  ƒ  } d  k } | i | |  i |  i |  i ƒ \ } } }	 t	 i
 o& t d t t  i  ƒ  | ƒ d ƒ n t  i  ƒ  } d d d d d d d d d d f | } |  i | | | ƒ \ }
 } } | t j o@ d d } | d 8} t | d	 d
 !ƒ d j o |
 d 7}
 qn d } xGt |
 | | ƒ D]3} | | } | | t j o d d GHn yv | | | | !i ƒ  d |  i | | <| | | | !i ƒ  d |  i | | <|	 | | | !i ƒ  d |  i | | <Wn‚ | t j | d j @od |  i | d | |  i | | <|  i | d | |  i | | <|  i | d | |  i | | <qTn X| d 7} q+Wt	 i
 o& t d t t  i  ƒ  | ƒ d ƒ n d  S(   Ns   Corr for some days took s    sec.i   i   i   ix   i   i   i   i   i    s   /==i
   f8.0s   Build LineChartData took (    s   times   timers   PL2_CorrForSomeDayss   corrForSomeDaysPL2s   stat_start_times   selfs   data_inbounds   data_outbounds
   data_totals   PL2_inis   developments   debugMsgs   strs
   chart_types   time_index_speeds   getIndexs   graph_start_times   daysInCharts
   from_indexs   to_indexs	   index_adjs
   HOUR_CHARTs   ints   cous   ranges   xs   x2s   NoValues   maxs	   lineData0s	   lineData1s	   lineData2(   s   selfs
   chart_types   stat_start_times   graph_start_times   daysInCharts	   index_adjs   data_inbounds   PL2_CorrForSomeDayss   data_outbounds
   data_totals
   from_indexs   time_index_speeds   x2s   to_indexs   cous   timers   x(    (    s   C:\Python\PL\drawgraph.pys   buildLineData¹   sD    		
&,

 
&&*  $
c         C   s   t  i  ƒ  } |  i | | | ƒ \ }	 } } d d t
 i t | d d !ƒ ƒ d d d d d d d d d d f } d d d d d d d d d d d	 f | } | t j oÖ d } |	 } t i o' t d
 |	 | | t |  i ƒ f ƒ n x| D]Š } | }
 |  i |
 |
 | d d !i ƒ  d d |  i | <|  i |
 |
 | d d !i ƒ  d d |  i | <| d	 7} | | d d 7} qï Wnì t i o3 t d |	 | | t |  i ƒ t |  i ƒ f ƒ n x« t |	 | | ƒ D]— } | | }
 |  i |
 |
 | !i ƒ  d d |  i | | <|  i |
 |
 | !i ƒ  d d |  i | | <|  i |
 |
 | !i ƒ  d d |  i | | <qÑWt i o& t d t  t  i  ƒ  | ƒ d ƒ n d  S(   Ni   i   i    i   i   i<   i   i   i   s8   from_index=%s to_index=%s time_index_bar=%s size data=%sf60.0sS   from_index=%s to_index=%s time_index_bar=%s size data=%s size graphData.barData0=%ss   Build BarChartData took s    sec.(!   s   times   timers   selfs   getIndexs
   chart_types   graph_start_times   daysInCharts
   from_indexs   to_indexs	   index_adjs   calendars   isleaps   ints   time_index_specs   time_index_bars
   YEAR_CHARTs   cous
   time_indexs   PL2_inis   developments   debugMsgs   lens   data_inbounds   x2s   sums   barData0s   data_outbounds   barData1s   ranges   xs
   data_totals   barData2s   str(   s   selfs
   chart_types   stat_start_times   graph_start_times   daysInCharts	   index_adjs
   time_indexs   time_index_specs   time_index_bars
   from_indexs   x2s   to_indexs   cous   timers   x(    (    s   C:\Python\PL\drawgraph.pys   buildBarDataí   s4    D0
' 11

3 
--1
c         C   s¯   | t j o1 t | d d !ƒ } d } d } | d d } na d } t |  i
 ƒ } d } | t j o8 | d j o' d } d } t | d d !ƒ d } qž n | | | f Sd  S(	   Ni   i   i    i   i<   i   i   i   (   s
   chart_types
   HOUR_CHARTs   ints   graph_start_times   hours
   from_indexs   to_indexs	   index_adjs   lens   selfs   data_inbounds	   DAY_CHARTs   daysInChart(   s   selfs
   chart_types   graph_start_times   daysInCharts
   from_indexs	   index_adjs   hours   to_index(    (    s   C:\Python\PL\drawgraph.pys   getIndex  s    (   s   __name__s
   __module__s   __init__s   initEmptyBarDatas   setMeasurepointss   calcMaxvaluess   calcTotalvaluess   calcAvgSpeeds   buildDataFromPL2s   buildLineDatas   buildBarDatas   getIndex(    (    (    s   C:\Python\PL\drawgraph.pys	   GraphData4   s   8				"	4	-s	   ChartUnitc           B   s   t  Z d „  Z RS(   Nc         C   sU   d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _	 d  S(   Ns    (
   s   selfs   unit_ins   unit_outs   unit_tots   unit_in_speeds   unit_out_speeds   unit_tot_speeds   unit_avg_in_speeds   unit_avg_out_speeds   unit_avg_tot_speed(   s   self(    (    s   C:\Python\PL\drawgraph.pys   __init__2  s    									(   s   __name__s
   __module__s   __init__(    (    (    s   C:\Python\PL\drawgraph.pys	   ChartUnit0  s   s   ToplistGraphDatac           B   s   t  Z d „  Z RS(   Nc         C   sV   t  i |  | ƒ t d ƒ g | |  _ t d ƒ g | |  _ t d ƒ g | |  _ d  S(   Ni    (   s	   GraphDatas   __init__s   selfs   sizeToplistDatas   floats   barData0s   barData1s   barData2(   s   selfs   sizeToplistData(    (    s   C:\Python\PL\drawgraph.pys   __init__I  s    (   s   __name__s
   __module__s   __init__(    (    (    s   C:\Python\PL\drawgraph.pys   ToplistGraphDataF  s   s   GraphToplistDatac           B   sk   t  Z d Z d Z d Z d Z d Z d Z d Z d Z	 d Z
 d Z d Z d Z d Z d Z d Z d „  Z RS(   Ni    s    c         C   s   d  S(   N(    (   s   self(    (    s   C:\Python\PL\drawgraph.pys   __init__Œ  s    (   s   __name__s
   __module__s   unit_ins   unit_outs   unit_tots   unit_in_speeds   unit_out_speeds   unit_tot_speeds   unit_avg_in_speeds   unit_avg_out_speeds   unit_avg_tot_speeds   speed_total_in_avgs   speed_total_out_avgs   speed_total_tot_avgs   unit_VBS_0_speeds   unit_VBS_1_speeds   unit_VBS_2_speeds   __init__(    (    (    s   C:\Python\PL\drawgraph.pys   GraphToplistDatav  s    s	   GraphParac           B   sV   t  Z d „  Z e d „ Z e d „ Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   Nc         C   sâ  d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _	 t
 |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d	 |  _ d
 |  _ d |  _  d |  _! d |  _" d |  _# d |  _$ d |  _% d |  _& g  |  _' d |  _( d |  _) d |  _* d |  _+ d |  _, d |  _- d |  _. d |  _/ d |  _0 d |  _1 t2 |  _3 d |  _4 d |  _5 d |  _6 d |  _7 t8 i9 |  _9 d |  _: d |  _; d |  _< d |  _= d |  _> d |  _? g  |  _@ g  |  _A d |  _B d |  _C t2 |  _D d |  _E d |  _F d |  _G tH |  _I d |  _J tK |  _L d |  _M d |  _N d |  _O d |  _P d |  _Q d |  _R t8 iS |  _S t8 iT |  _T t8 iU |  _U t8 iV |  _V d |  _W d |  _X t2 |  _3 g  g d |  _Y d |  iY t
 <d |  iY tZ <d |  iY t[ <d |  iY t\ <d |  iY t] <d |  iY t^ <g  g d |  __ d |  i_ t
 <t8 i` o d d |  i_ tZ <n d |  i_ tZ <d |  i_ t[ <d |  i_ t\ <d |  i_ t] <d |  i_ t^ <d  S(   Ni    iÿÿÿÿi   s    i   i   iÿ   i¼  iÝÿÿÿi   s   1s    i   iÿÿÿ iððð iÀÀÀ i   i   i   i   i   i<   iP  it  in  (a   s   selfs   ids	   unit_types   refreshs   scales   magics   outputs   stats   graphs   charts   USERDEF_CHARTs
   chart_types   contents   stat_start_times   stat_end_times   graph_start_times   graph_end_times	   from_dates   to_dates   yearNos   monthNos   dayNos   hourNos	   file2Calls   reverseLookups   topboxs   forces   stops   sizes   layouts   hostsInGraphs   hostsInDraws	   chartNames   winTitles   chart_titles
   chartTitles   labelss   userdef_labels
   chart_infos   sideTexts   toplistBackgroundImages   speedBarBackgroundImages   speedLineBackgroundImages   groupIds	   groupNames   printhostnames   createdFlags   filenames   speedFile2Calls   toplistFile2Calls   Nones   stat_servers	   stat_areas
   IP_addresss   hostnames	   netObjects   PL2_inis	   debugHosts
   randomReads   valuesPerDays   daysInCharts
   graph_times   wildcards   wildcardDatas   unitss   speeds   unit_divs   unit_ptrs   images   imgs   plotBgColors   plotAltBgColors	   LineColors   plotEdgeColors   plothGridColors   Transparents   plotvGridColors   topboxBgColors   sideboxBgColors   chartBgColors   chartEdgeColors   titleBgColors   titleTextColors   label_fontfiles   label_fontsizes   title_fontfiles   title_fontsizes   shapeAntiAliass   textAntiAliass   barDataSizes
   HOUR_CHARTs	   DAY_CHARTs
   WEEK_CHARTs   MONTH_CHARTs
   YEAR_CHARTs   lineDataSizes   PL2(   s   self(    (    s   C:\Python\PL\drawgraph.pys   __init__‘  sÈ    																																																																															
c         C   s)   | t j o |  i  } n |  i | Sd  S(   N(   s
   chart_types   Nones   selfs   barDataSize(   s   selfs
   chart_type(    (    s   C:\Python\PL\drawgraph.pys   sizeBarGraphData  s    c         C   s)   | t j o |  i  } n |  i | Sd  S(   N(   s
   chart_types   Nones   selfs   lineDataSize(   s   selfs
   chart_type(    (    s   C:\Python\PL\drawgraph.pys   sizeLineGraphData	  s    c         C   s  t  i  ƒ  }	 |	 d } |	 d } | d d }
 |  i d j o" t  i d t  i |	 ƒ ƒ |  _ n |  i	 d j o" t  i d t  i | ƒ ƒ |  _	 n |  i
 d j o" t  i d t  i |	 ƒ ƒ |  _
 n |  i
 d j o" t  i d t  i | ƒ ƒ |  _	 n |  i d j o" t  i d t  i |	 ƒ ƒ |  _ n |  i d j o" t  i d t  i | ƒ ƒ |  _ n |  i d j  o¼ d |  _ |  i t i j o t i |  _ n |  i t i j o t i |  _ n |  i t i j o t i |  _ n |  i t i j o t i |  _ n |  i t i j o t i |  _ q&n |  i t t t f j o t |  _ n |  i t  t! t" t# f j o t$ |  _% n |  i t& t' t( t) f j o t* |  _% n |  i t+ t, t- t. f j o t/ |  _% n |  i t0 t1 t2 t3 f j o t4 |  _% n |  i |  _
 |  i	 |  _5 |  i% t6 t$ g j o d |  _7 n |  i% t* j o$ t i8 o d |  _7 q_d	 |  _7 n |  i t# t) t. t3 g j o d |  _7 n t i9 o t: d
 |  i d |  i	 d t; |  i< ƒ d t; |  i= ƒ d t; |  i> ƒ d t; |  i ƒ d t; |  i% ƒ d t; |  i7 ƒ d t i? ƒn t  i@ tA |  i
 d ƒ ƒ } |  i t! j o@ t  i d t  i |	 ƒ ƒ |  _
 t  i d t  i | ƒ ƒ |  _5 n |  i t" j o@ t  i d t  i | ƒ ƒ |  _
 t  i d t  i |	 ƒ ƒ |  _5 n |  i t# j o@ t  i d t  i | ƒ ƒ |  _
 t  i d t  i |	 ƒ ƒ |  _5 n |  i t' j oc t  i d t  i |	 ƒ ƒ |  _
 t  i@ tA |  i
 d ƒ ƒ } t  i d t  i | d d ƒ ƒ |  _5 n |  i t( j o_ t  i d t  i |	 ƒ ƒ |  _5 t  i@ tA |  i5 d ƒ ƒ } t  i d t  i | d ƒ ƒ |  _
 n |  i t) j og t  i d t  i |	 d ƒ ƒ |  _5 t  i@ tA |  i5 d ƒ ƒ } t  i d t  i | d d ƒ ƒ |  _
 n t  i d t  i |	 ƒ ƒ } tE iF tG | d d !ƒ tG | d d !ƒ tG | d d !ƒ ƒ } |	 | d } |  i t, j oH t  i d t  i | ƒ ƒ |  _
 t  i d t  i | d d ƒ ƒ |  _5 n |  i t- j oH t  i d t  i | d d ƒ ƒ |  _
 t  i d t  i | ƒ ƒ |  _5 n |  i t. j o@ t  i d t  i |
 ƒ ƒ |  _
 t  i d t  i | ƒ ƒ |  _5 n |  i t1 j oH t  i d t  i | ƒ ƒ |  _
 t  i d t  i | d d ƒ ƒ |  _5 n |  i t2 j oH t  i d t  i | d d ƒ ƒ |  _
 t  i d t  i | ƒ ƒ |  _5 n |  i t j oÏ|  i |  _
 |  i	 |  _5 |  i% tJ j oç t  i@ tA |  i
 d ƒ ƒ } t  i@ tA |  i5 d ƒ ƒ } | | |  _M d |  _< d |  _= d |  _> t4 |  _% |  iM d d j o t* |  _% n |  iM d d j o t/ |  _% n |  iM d j o t$ |  _% n |  iM d j o t6 |  _% q¹	n t  i d t  i | d d ƒ ƒ } t  i d t  i | ƒ ƒ } |  i% t6 j o |  iP d j oe|  i> d j o |  i< d j o |  i= d j o] t; d |  i< ƒ d  t; d! |  i= ƒ d  t; d! |  i> ƒ d" t; d! |  iP ƒ d# |  _
 nM t  i d t  iQ t  i@ tA |  i
 d d !d$ ƒ ƒ t  iR d |  iP ƒ ƒ |  _
 t  i@ tA |  i
 d ƒ ƒ t  iR } t  i d t  iQ | d ƒ ƒ |  _5 t i9 o: t: d% t; |  iP ƒ d" |  i
 d" |  i5 d t i? ƒq|n |  i% t$ j o |  i> d j o4|  i< d j o |  i= d j oH t; d |  i< ƒ d  t; d! |  i= ƒ d  t; d! |  i> ƒ d& |  _
 nŒ t  i d t  i t  i@ tA |  i
 d ƒ ƒ d |  i> d ƒ ƒ |  _
 t i9 o? t: d' t; |  i% ƒ t; |  i> ƒ |  i |  i
 f d t i? ƒn t  i@ tA |  i
 d ƒ ƒ } t  i d t  i | d ƒ ƒ |  _5 n |  i% t/ j o- |  i> d j o |  i< d j o |  i= d j oú t; d |  i< ƒ d  t; d! |  i= ƒ d  t; d! |  i> ƒ d& |  _
 t  i@ tA |  i
 d ƒ ƒ } tE iF tG |  i
 d d !ƒ tG |  i
 d d !ƒ tG |  i
 d d !ƒ ƒ } | | d } t  i d t  i | ƒ ƒ |  _
 t  i d t  i | d d ƒ ƒ |  _5 n |  i% t* j |  i= d j @o÷|  i< d j o tG |  i d d !ƒ } n
 |  i< } |  i= } |  i= d } |  i= d( j o d } | d } n |  i= d } | } t; d | ƒ d  t; d! | ƒ d) |  _
 t; d | ƒ d  t; d! | ƒ d) |  _5 t i9 o5 t: d* t; |  i
 ƒ d+ t; |  i5 ƒ d t i? ƒn t  i d t  i |	 ƒ ƒ |  i5 j  o" t  i d t  i |	 ƒ ƒ |  _5 n |  i% t j o‹ t  i@ tA |  i
 d d !d, d$ ƒ ƒ } t  i d t  i | |  i= d d d ƒ ƒ |  _
 t  i d t  i | tW i i= d d ƒ ƒ |  _5 qn |  i% t4 j |  i< d j @o: t; |  i< ƒ d- |  _
 t; tG |  i< ƒ d ƒ d- |  _5 qyn tX tA |  i
 d ƒ ƒ } tX tA |  i5 d ƒ ƒ } d | d <d | d <t  i@ | ƒ } t  i@ | ƒ } | | |  _M d. |  i
 |  i5 | | f GHd  S(/   Ni€Q i   s    s   %Y-%m-%d 00:00i    i   ie   ig   i   s
   from_date=s	    to_date=s    yearNo=s	    monthNo=s    dayNo=s    Graph=s    Chart_type=s   Stop=s   hosts   %Y-%m-%d %H:%Ms   %Y-%m-%d %H:00s   %Y-%m-01 00:00i   i   i   i   i
   s   %Y-01-01 00:00in  im  i  s   %04ds   -s   %02ds    s   :00s   %Y-%m-%ds   hour=s    00:00s6   Chart_Type=%s dayNo=%s from_date=%s stat_start_time=%si   s	   -01 00:00s   MonthChart s    - s   01-01s   -01-01 00:00s   start - end %s %s %s %s([   s   times   todays	   yesterdays   tomorrows   weekbacks   selfs	   from_dates   strftimes	   localtimes   to_dates   stat_start_times   graph_start_times   graph_end_times   layouts   charts   PL_consts
   LINE_CHARTs   PL2_inis   default_line_layouts	   BAR_CHARTs   default_bar_layouts	   PIE_CHARTs   default_pie_layouts   BGP_PIE_CHARTs   default_BGPpie_layouts   TOPLIST_CHARTs   default_toplist_layouts   TANKMETER_CHARTs   TANKMETER_CHART_2s   TANKMETER_CHART_3s   CUSTOM_GRAPHs   graphs   CUSTOM_DAY_GRAPHs   TODAY_GRAPHs   YESTERDAY_GRAPHs   DAYBACK_GRAPHs	   DAY_CHARTs
   chart_types   CUSTOM_MONTH_GRAPHs   CUR_MONTH_GRAPHs   PREV_MONTH_GRAPHs   MONTH_BACK_GRAPHs   MONTH_CHARTs   CUSTOM_WEEK_GRAPHs   THIS_WEEK_GRAPHs   PREV_WEEK_GRAPHs   WEEK_BACK_GRAPHs
   WEEK_CHARTs   CUSTOM_YEAR_GRAPHs   CUR_YEAR_GRAPHs   PREV_YEAR_GRAPHs   YEAR_BACK_GRAPHs
   YEAR_CHARTs   stat_end_times
   HOUR_CHARTs   stops   PL2s   developments   debugMsgs   strs   yearNos   monthNos   dayNos	   debugHosts   mktimes   strptimes   time_tmps	   time_tmp2s
   date_todays   calendars   weekdays   ints   cur_weekdays   cur_weekday_starts   USERDEF_CHARTs   starts   ends
   graph_times   prev_year_starts   prev_year_stops   hourNos   gmtimes   timezones	   from_years
   from_months   to_months   to_years
   speedCharts   lists   start_ts   end_t(   s   selfs   prev_year_stops   cur_weekday_starts   prev_year_starts   cur_weekdays   tomorrows
   date_todays   starts	   from_years   todays   weekbacks	   yesterdays   end_ts   to_years   ends
   from_months   time_tmps	   time_tmp2s   to_months   start_t(    (    s   C:\Python\PL\drawgraph.pys   update_para  sN   

""""""	

~"""*&"*<*&""*&"				# 0]L""
>  HB
?&@DE*		))
5%"&18(

c      	   C   sé  t  i o< t d |  i |  i |  i |  i |  i |  i	 |  i
 f ƒ n |  i t t t t t t f j oÚ |  i d  |  i d  j o d |  _
 qš|  i d d j oQ t t i t |  i d  d ƒ ƒ t i t |  i d  d ƒ ƒ d d ƒ |  _
 qšt t i t |  i d d	 ƒ ƒ t i t |  i d d	 ƒ ƒ d ƒ |  _
 nY|  i	 t j oM t t i t |  i d d	 ƒ ƒ t i t |  i d d	 ƒ ƒ d ƒ |  _
 n |  i	 t j o d |  _
 n |  i	 t j o d |  _
 n |  i	 t j o d
 |  _
 n |  i	 t j oJt i t |  i d d !d d ƒ ƒ } |  i t j oS t t i t |  i d d !d ƒ ƒ t i t |  i d d !d ƒ ƒ d ƒ |  _
 nR t t i t t i d t i | d d ƒ ƒ d d !d d ƒ ƒ | d ƒ |  _
 |  i t j o\ t t i t |  i d d !d ƒ ƒ t i t |  i d d !d ƒ ƒ d ƒ |  _
 d |  _
 qPn |  i	 t j o: t i  t |  i d d !ƒ ƒ o d |  _
 qšd |  _
 n |  i
 d j o d |  _
 n t  i o$ t d t! |  i
 ƒ d t  i" ƒn d  S(   Ns|   Before: stat_start_time=%s stat_end_time=%s graph_start_time=%s self.graph_end_time=%s graph=%s chart_type=%s daysinchart=%si
   i   i   s   00:00s   %Y-%m-%di€Q s   :00s   %Y-%m-%d %H:%M:%Si   i    i   s   01s   %Y-%m-01 00:00i   i   in  im  s   daysInChart set to s   host(#   s   PL2_inis   developments   debugMsgs   selfs   stat_start_times   stat_end_times   graph_start_times   graph_end_times   graphs
   chart_types   daysInCharts   CUSTOM_GRAPHs   CUSTOM_HOUR_GRAPHs   CUSTOM_DAY_GRAPHs   CUSTOM_WEEK_GRAPHs   CUSTOM_MONTH_GRAPHs   CUSTOM_YEAR_GRAPHs   ints   times   mktimes   strptimes   USERDEF_CHARTs
   HOUR_CHARTs	   DAY_CHARTs
   WEEK_CHARTs   MONTH_CHARTs   time_tmps   strftimes	   localtimes   MONTH_BACK_GRAPHs
   YEAR_CHARTs   calendars   isleaps   strs	   debugHost(   s   selfs   time_tmp(    (    s   C:\Python\PL\drawgraph.pys   setDaysInchart  s@    
<"QMM&SQO 
c         C   sÙ  |  i d j oL d d d d d d d d	 g |  _ d
 d d d d d d g |  _ d |  _ nz|  i d j oL d d d d d d d d g |  _ d d d d d d d g |  _ d |  _ n|  i d j oO d d d d d d d d	 g |  _ d d d d d d d d	 g |  _ d |  _ n¿|  i d j oL d d  d! d" d# d d d	 g |  _ d$ d% d& d' d( d d g |  _ d |  _ nc|  i d) j oO d* d+ d, d- d. d d d	 g |  _ d/ d0 d1 d2 d3 d d d	 g |  _ d |  _ n|  i d4 j oO d5 d6 d7 d8 d9 d d d	 g |  _ d: d; d< d= d> d? d@ dA g |  _ d |  _ n¥ |  i dB j oL dC d+ d d d d d d	 g |  _ d* d0 d d d d d g |  _ dD |  _ nI dE dF dG dH dI d d d	 g |  _ dJ dK dL dM dN d d g |  _ dO |  _ d  S(P   Ni   s    pack.s   Kpack.s   Mpack.s   Gpack.s   Tpack.s   ?????1s   ?????2s   ?????3s    ppss   Kppss   Mppss   Gppss   Tppss   ?iè  i   s   %i   s      cons     Kcons     Mcons     Gcons     Tcons    cons   Kcons   Mcons   Gcons   Tconi   s    conns   Kconn.s   Mconn.s   Gconn.s   Tconn.s    c/ss   Kc/ss   Mc/ss   Gc/ss   Tc/si   s   hostss   Khostss   Mhostss   Ghostss   Thostss   hosts   Khosts   Mhosts   Ghosts   Thosti   s       mss     Sec.s     KSec.s    Msec.s    Gsec.s    mss   Sec.s   KSecs   Msecs   Gsecs   ???1s   ???2s   ???3ic   s    hostsi Êš;s    Bytess   KiBytes   MiBytes   GiBytes   TiBytes   bitss   Kbpss   Mbpss   Gbpss   Tbpsi   (   s   selfs	   unit_types   unitss   speeds   unit_div(   s   self(    (    s   C:\Python\PL\drawgraph.pys   setGraphUnitsN  s>    !!!!!!!!!!!c   	   
   C   s  |  i t t f j o¯ |  i d } |  i d } |  i t j o | d j o
 | d j o
 d } n |  i t j o+ | d j o | d j o |  i |  i j o
 d } n | d | d |  _ n |  i d |  i |  _ d |  _	 t
 i t |  i d d !d ƒ ƒ t
 i } t i oQ t d	 |  i t
 i | t
 i d t
 i | ƒ ƒ t
 i d t
 i | ƒ ƒ f ƒ n |  i t j o„ t
 i d
 t
 i | ƒ ƒ } t i t | d d !ƒ t | d d !ƒ t | d d !ƒ ƒ } d d g | d j t | d | |  _	 n |  i t j o„ t
 i d
 t
 i | ƒ ƒ } t i t | d d !ƒ t | d d !ƒ t | d d !ƒ ƒ } | d d d g | d j t | |  _	 n |  i t j o; t |  i ƒ } d | t
 i d t
 i | ƒ ƒ f |  _	 n |  i t j oì t t
 i d t
 i | ƒ ƒ d d !ƒ } t t
 i d t
 i | |  i d d ƒ ƒ d d !ƒ } t i o+ t t! | ƒ d t! | ƒ d t i" ƒn d t
 i d t
 i | ƒ ƒ d t# t$ | d | | j d t# t$ | d |  _	 n |  i t$ j o& d t
 i d t
 i | ƒ ƒ |  _	 n d  S(   Niûÿÿÿs   00:00s   24:00s    - s    i    i   s   %Y-%m-%d %H:%MsH   graph_start_time=%s timeZone=%s time_index_adj=%s localtime=%s gmtime=%ss   %Y-%m-%di   i   i   i   i
   s"   <*font=arialbd.ttf, color=FF0000*>i   s    s   Week %02d  %ss   %Ys   %y-%m-%di   i€Q i   s     s   hosts   Year (%   s   selfs
   chart_types
   HOUR_CHARTs	   DAY_CHARTs   graph_start_times   title_start_times   graph_end_times   title_end_times   chart_titles
   chart_infos   times   mktimes   strptimes   timezones   time_index_adjs   PL2_inis   developments   debugMsgs   strftimes	   localtimes   gmtimes   dates   calendars   weekdays   ints   weekDayNameLongs
   WEEK_CHARTs   weekNoFromDates   weekNos   MONTH_CHARTs   start_months   daysInCharts	   end_months   strs	   debugHosts
   label_names
   YEAR_CHART(	   s   selfs   weekNos   time_index_adjs   start_months   title_start_times   title_end_times   dates	   end_months   weekday(    (    s   C:\Python\PL\drawgraph.pys   buildChartinfo|  s@    *
>
	)
Q<-<-,(7
+Xc         C   sù  t  i  ƒ  } t | d ƒ d } | d } d |  i d d !t i |  _ |  i |  _	 |  i
 |  _ t i oh t d |  i d |  i
 d t |  i ƒ d	 t |  i ƒ d
 t  i d t  i | ƒ ƒ d |  i ƒn t  i d t  i | ƒ ƒ |  i
 j o |  i o«d |  i d d !t i d t i |  _ |  i d j on|  i d d f j o" t  i d t  i | ƒ ƒ |  _ n |  i d d f j o" t  i d t  i | ƒ ƒ |  _ n |  i d j o" t  i d t  i | ƒ ƒ |  _ n |  i d j o@ t  i d t  i | ƒ ƒ |  _ t  i d t  i | ƒ ƒ |  _
 n |  i d j oH t  i t |  i
 d ƒ ƒ t  i } t  i d t  i | d ƒ ƒ |  _
 n |  i d j o |  i |  _
 q¨q¬n |  i oÍ t i o7 t t  i d t  i | ƒ ƒ d |  i d |  i ƒn t  i d t  i | ƒ ƒ |  i j  oc t  i d t  i | ƒ ƒ |  _ t i o7 t t  i d t  i | ƒ ƒ d |  i d |  i ƒqqƒn t i oh t d |  i d |  i
 d t |  i ƒ d	 t |  i ƒ d
 t  i d t  i | ƒ ƒ d |  i ƒn d  S(   Ni,  i€Q s   dati    i   s   Before s    - s    stop=s    randomread=s	    curtime=s   %Y-%m-%d %H:%Ms   hosts   tmpi   ie   i   if   s   %Y-%m-%d 00:00i   ig   s   %Y<-%m-%d 00:00ih   ic   s   %Y-%m-%d %H:00s    s   After (   s   times   todays   longs   tomorrows   selfs   stat_start_times   oss   seps
   filePrefixs   graph_start_times   stat_end_times   graph_end_times   PL2_inis   developments   debugMsgs   strs   stops
   randomReads   strftimes	   localtimes	   debugHosts   mktimes   strptimes   timezones   time_tmp(   s   selfs   time_tmps   tomorrows   today(    (    s   C:\Python\PL\drawgraph.pys   prepGraphTime´  sH    

W/)"""""&

7%
?
W(   s   __name__s
   __module__s   __init__s   Nones   sizeBarGraphDatas   sizeLineGraphDatas   update_paras   setDaysIncharts   setGraphUnitss   buildChartinfos   prepGraphTime(    (    (    s   C:\Python\PL\drawgraph.pys	   GraphPara  s   	q	ÿ 
	5	.	8s   logo.gifc         C   s    y t  t i ƒ } Wn d } n Xt i d t i |  } t i	 i
 | ƒ p | o t i d t i |  } n t i o t d | d t i ƒn | Sd  S(   Ni    s   datas   imagess   logo_path=%ss   host(   s   ints   PL2_inis   custom_chart_logos
   customLogos   PL_paths   oss   seps   files	   logo_paths   paths   existss   developments   debugMsgs	   debugHost(   s   files	   logo_paths
   customLogo(    (    s   C:\Python\PL\drawgraph.pys   getLogoPathê  s    

i   i   i   c         C   s  | d j o t ƒ  } nÈd  k } d t i d | } t i i | ƒ o•d  k } t	 } t i o t i d j o t i d t i t i } t i i | ƒ o
 t } qxT t i D]E } t i d t i d | } | GHt i i | ƒ o t } Pq· q· Wn | p t i oW xT t i D]E } t i d t i d | } | GHt i i | ƒ o t } Pq!q!Wn y,d } d	 } | i | ƒ } | i } t | d
 t | ƒ ƒ } t | d t | ƒ ƒ } d | | d
 | f GHd | | d | f GH| | j o
 | } n | } d | GH| d
 | | }
 | d | | } t  i  ƒ  }	 | i" |
 | f | i# ƒ } t i% o t& d t  i  ƒ  |	 ƒ n | i' | ƒ Wqát& d | | t( i) ƒ  d f ƒ t i d t i d } qáXn |  i+ | | | | d | d t. d | ƒ ƒ i/ t0 ƒ d  S(   Niÿÿÿÿs   tmps   scaled_logo_%s.pngs    s   datas   logo%ss   imagesii   i#   i    i   s0   imageWidthX1,  img_size[0], scaleWidth  %s %s %ss0   imageHeightX1, img_size[1], scaleHeight %s %s %ss   Scaleing %ss   Resize took %s sec.s+   Error while scaling image %s to %s Error=%ss   logo.gifs   <*block,valign=bottom*><*img=sO   *><*block*><*font=timesbi.ttf,size=%s,color=804040*>  Traffic
  Statistics<*/*>i   (1   s   scales   getLogoPaths	   logo_paths   fileutils   oss   seps   paths   existss   Images   Falses
   found_logos   PL2_inis   custom_chart_logos   custom_chart_logo_files   PL_paths	   imageFiles   Trues   PL_consts   image_file_extensionss   exts   imageWidthX1s   imageHeightX1s   opens   im1s   sizes   img_sizes   floats
   scaleWidths   scaleHeights   scaleings   widths   heights   times   time1s   resizes	   ANTIALIASs   ims   developments   debugMsgs   saves   syss   exc_infos   cs   addTexts   posXs   posYs   ints   setAlignments   TopLeft(   s   cs   scales   posXs   posYs   scaleHeights   heights   imageWidthX1s   ims   imageHeightX1s   time1s   widths   img_sizes	   imageFiles   scaleings	   logo_paths
   scaleWidths   Images   im1s   exts
   found_logos   fileutil(    (    s   C:\Python\PL\drawgraph.pys   addLogoToChartû  sf    		

 
 	
	
! i   c         C   sp   y4 t  t |  ƒ t | ƒ ƒ } |  | t | ƒ }  Wn d } n X| o | | } n d } |  | | f Sd  S(   Ni    s    (   s   ints   logs   values   bases   unit_ptrs   floats   unitss	   unit_name(   s   values   bases   unitss	   unit_names   unit_ptr(    (    s   C:\Python\PL\drawgraph.pys	   scaleData]  s    
c      
   C   s  d |  i G|  i GHt |  i d d !ƒ } d g | } t |  i } t
 i t |  i d d !d ƒ ƒ t
 i } |  i o| d j o | i |  _ nù | d	 j o | i |  _ nÜ | d
 j o± | i } y‘ xŠ t t | ƒ ƒ D]v } y | | i d ƒ d | | <Wn" | | i d ƒ d | | <n X| | i t i t d ƒ d ƒ d ƒ | | <qÜ WWn n X| |  _ n | d j o | i |  _ n d  Sn |  i t j oD | d j o | i |  _ qç| d	 d g j o | i |  _ qçn |  i t j oÚ g  i  } t d ƒ D]5 } | d t
 i# d t
 i$ | d | d ƒ ƒ ƒ q~ } | d j o | |  _ qÑ| d	 d g j oW t% i& o | |  _ qÍd g d |  _ x- t d ƒ D] } | | |  i | d <qªWqÑn |  i t' j oßt |  i( d d !ƒ }
 |
 t |  i* d ƒ } d | |
 f GHt% i, o t- d |  i* |
 | f ƒ n | d j oY g  i  } t d ƒ D] } | d t. d | ƒ ƒ qf~ d	 |  _ |  i |
 | !|  _ qÀ| d	 d g j oþ |  i* t d d d ƒ j oC g  i  } t d ƒ D] } | d t. d | ƒ ƒ qï~ d	 } n@ g  i  } t d ƒ D] } | d t. d | ƒ ƒ q2~ d	 } d g d |  _ x- t d ƒ D] } | |
 | |  i | d <qzW|  i d | |
 d !|  _ qÀn d } |  i t0 j o…| d	 d g j o d d d d d  d! d" g } n d# d$ d% d& d' d( d) g } g  } x§ t d d* ƒ D]– } t
 i# d+ t
 i$ | | d, ƒ ƒ }	 t3 i4 t |	 d d	 !ƒ t |	 d
 d !ƒ t |	 d- d. !ƒ ƒ } | i  | d d/ g | d- j | | d0 |	 ƒ q9W| d j o | |  _ nX | d	 d g j oD d g d* d1 |  _ x- t d* ƒ D] } | | |  i | d1 <q!Wn |  i d | !|  _ n |  i t5 j oè g  } xÒ t d |  i6 ƒ D]¾ } t
 i# d+ t
 i$ | | d, ƒ ƒ }	 t3 i4 t |	 d d	 !ƒ t |	 d
 d !ƒ t |	 d- d. !ƒ ƒ } | i  d d d/ g | d- j t. t |	 d- d. !ƒ ƒ ƒ | d g d | d	 d g j 7} q„W| |  _ n |  i t7 j o | d j o9 g  } x# t t7 D] } | i  d | ƒ qW| |  _ q | d	 d g j o@ d g d2 |  _ x- t d ƒ D] } | | |  i | d3 <qÙWq n d  S(4   Ns)   date ===== date ===== date =====  date %si   i   s    i    i   s   %Y-%m-%d %H:%Mi   i   i   s   /i¤   i   i   s   -s   %H:%Mi  i,  i<   i   s   Hour index high, low %s %ss>   graph.graph_time = %s hour_index_low = %s hour_index_high = %si   s   %02di   s   %02d:00i   s   Mon   s   Tue   s   Wed   s   Thu   s   Fri   s   Sat   s   Sun   s   Mons   Tues   Weds   Thus   Fris   Sats   Suni   s   %y-%m-%di€Q i   i   s"   <*font=arialbd.ttf, color=FF0000*>s   
i0   im  i   (8   s   graphs   graph_start_times   graph_end_times   ints   hours	   labelSizes   labelss
   label_names
   chart_types   labels_names   times   mktimes   strptimes   timezones   time_index_adjs   userdef_labels   labelLayouts   datas
   bar_labelss   speed_labelss
   pie_labelss   ranges   lens   indexs   splits	   translates   strings	   maketranss   chrs   area_labelss   USERDEF_CHARTs
   HOUR_CHARTs   appends   _[1]s   xs   strftimes   gmtimes   PL2_inis   PL2s	   DAY_CHARTs   stat_start_times   hour_index_lows
   graph_times   hour_index_highs   developments   debugMsgs   strs   extras
   WEEK_CHARTs   weekDayNames   dates   calendars   weekdays   MONTH_CHARTs   daysInCharts
   YEAR_CHART(   s   graphs   datas   labelLayouts	   labelSizes   extras   labelss   weekDayNames   time_index_adjs   indexs   dates   hour_index_lows   hours   hour_index_highs   _[1]s   labels_names   weekdays   x(    (    s   C:\Python\PL\drawgraph.pys   buildChartLabelsm  sÒ    )
	 4R
 	
BC? # #< 5  #<8!  	c      	   C   s¡   |  i d | d | | d d | d ƒ |  i | | d t | f d d | d	 d
 d ƒ |  i | | d t	 i
 d t	 i t	 i	 ƒ  ƒ ƒ d d | d	 d
 d ƒ d  S(   Ni   iR   s   arialbd.ttfi
   i    s   ver %s Â© brinet ab%ss	   arial.ttfi   i°°° i   s   Created s   %Y-%m-%d %H:%M:%S(   s   cs   addTexts   scales
   chart_infos   x1s   ys   VERSIONs   createdFlags   x2s   times   strftimes	   localtime(   s   cs   x1s   x2s   ys
   chart_infos   createdFlags   scale(    (    s   C:\Python\PL\drawgraph.pys   addChartinfo,  s    (0c         C   s°   d } | i d j o
 d } n | i d j o
 d } n | i d j o
 d } n | i d @o
 d	 } n | i d
 @o
 d } n |  i d | d | | d d | d ƒ d  S(   Ns    i   s   Inboundi   s   Outboundi   s   In + Outboundi   s   Totali   s   In, Outboundi   iA   s   arialbd.ttfi
   i    (   s
   contentTxts   graphs   contents   cs   addTexts   scale(   s   cs   graphs   scales
   contentTxt(    (    s   C:\Python\PL\drawgraph.pys   addContentInfo4  s    




c      	   C   sÇ  d  k  } t | ƒ d  k } d  k } d  k } d k l } d  k } | i	 t
 t t f j o | i | |  ƒ i ƒ  Sn | i	 t t t t t t t t g j o | i | |  ƒ i ƒ  Sn | i	 t t g j o | i | |  ƒ i ƒ  Sn | i	 t t g j o | i | |  ƒ i ƒ  Sn | i	 t t  g j o | | |  ƒ i ƒ  Sn | i	 t! t" g j o  | i# | |  d d ƒi ƒ  Sn t$ i% o t& d | i	 d | i' ƒn t$ i( d t) i* d d |  f Sd  S(	   N(   s   StackedBarNetCharts   stackedi   s'   No chart fond for speedGraph.chart = %ss   hosts   imagess   SpeedBarBackgroundImage.gifs    (+   s   barnetcharts   reloads   linenetcharts   pienetcharts   areanetcharts   stackedbarnetcharts   StackedBarNetCharts   toplistnetcharts
   speedGraphs   charts
   LINE_CHARTs   LIVEL_LINE_CHARTs   CHANNEL_RX_PACKETSs   LineNetCharts	   graphDatas   draws	   BAR_CHARTs   BAR_AVG_8MAXHOURs   CUSTOM_HOUR_GRAPHs   HOST_COU_CHARTs   BGP_BARCHARTs   TANKMETER_CHARTs   TANKMETER_CHART_2s   TANKMETER_CHART_3s   BarNetCharts   BGP_PIE_CHARTs	   PIE_CHARTs   PieNetCharts
   AREA_CHARTs   BGP_AREACHARTs   AreaNetCharts   STACKED_BAR_CHART1s   STACKED_BAR_CHART2s   STACKED_BAR_CHART3s   STACKED_BAR_CHART4s   ToplistNetCharts   PL2_inis   developments   debugMsgs	   debugHosts   PL_paths   oss   sep(   s	   graphDatas
   speedGraphs   areanetcharts   toplistnetcharts   linenetcharts   pienetcharts   StackedBarNetCharts   barnetchart(    (    s   C:\Python\PL\drawgraph.pys   drawSpeedGraphL  s,    	
				( 
c         C   s0   d k  l } | | |  d | d | ƒi ƒ  Sd  S(   N(   s   ToplistNetCharts   units   stacked(   s   toplistnetcharts   ToplistNetCharts   toplistGraphs	   graphDatas	   speedDatas   stackeds   draw(   s	   graphDatas   toplistGraphs	   speedDatas   stackeds   ToplistNetChart(    (    s   C:\Python\PL\drawgraph.pys   drawToplistGraphw  s    c         C   s   t  |  | | d d ƒSd  S(   Ns   stackedi   (   s   drawToplistGraphs	   graphDatas   toplistGraphs	   speedData(   s	   graphDatas   toplistGraphs	   speedData(    (    s   C:\Python\PL\drawgraph.pys   drawStackedToplistGraph~  s    c         C   s²   y¤ |  i d j o t d j o t |  i ƒ p
 t d j of d  k } | i |  i ƒ d  k } y6 d } | i	 |  i ƒ } | d i
 d ƒ d |  _ Wq£ q£ Xn Wn n Xd  S(   Ns    s   1s   2i    s   .(   s   graphs   hostnames   reverseLookups   lens
   IP_addresss   IP_miscs   dottedQuadToNums   sockets   thenames   gethostbyaddrs   strip(   s   graphs   IP_miscs   sockets   thename(    (    s   C:\Python\PL\drawgraph.pys   findGraphHostname‚  s    :		c         C   sP   |  i d t i |  i |  i ƒ } |  i d j o | d |  i 7} n | Sd  S(   Ns   Trafficstatistics  s   1s     (	   s   graphs	   chartNames   PL_miscs   buildChartPaths   groupIds
   IP_addresss   chart_titles   printhostnames   hostname(   s   graphs   chart_title(    (    s   C:\Python\PL\drawgraph.pys   buildGraphTitle•  s    #c   	         sÅ   d  k  } | i d | i ƒ } | i d | i ƒ } | i |  ƒ } x@ t	 t
 | ƒ ƒ D], } | | } | i ‡  d †  | ƒ | | <qU Wd } x/ t	 d t
 | ƒ ƒ D] } | d | | 7} q¡ W| Sd  S(   Ns   <area shapes   ("\d*,\d*,\d*,)(\d*)(".*In)c            s7   |  i d ƒ t t |  i d ƒ ƒ ˆ  ƒ |  i d ƒ S(   Ni   i   i   (   s   matchs   groups   strs   ints   points(   s   match(   s   points(    s   C:\Python\PL\drawgraph.pys   <lambda>µ  s    s    i   (   s   res   compiles
   IGNORECASEs   re_coordrowss   DOTALLs	   re_coordss   splits   imageMaps	   coordrowss   ranges   lens   indexs   coordrows   subs   newMap(	   s   imageMaps   pointss   indexs	   coordrowss   re_coordrowss   coordrows   res   newMaps	   re_coords(    (   s   pointss   C:\Python\PL\drawgraph.pys   clickableSpeedGraphLabelsœ  s    	 
  c   	         sÉ   d  k  } | i d | i ƒ } | i d ƒ } | i |  ƒ } xJ t d t	 | ƒ d ƒ D]0 } | | } | i ‡  d †  | | ƒ | | <qU Wd } x/ t d t	 | ƒ ƒ D] } | d | | 7} q¥ W| Sd  S(   Ns   <area shapes   ["](\d*)([,]\d*[,]\d*[,]\d*)["]i   i   c            s2   d t  t |  i d ƒ ƒ ˆ  ƒ |  i d ƒ d S(   Ns   "i   i   (   s   strs   ints   matchs   groups   points(   s   match(   s   points(    s   C:\Python\PL\drawgraph.pys   <lambda>É  s    s    (   s   res   compiles
   IGNORECASEs   re_coordrowss	   re_coordss   splits   imageMaps	   coordrowss   ranges   lens   indexs   coordrows   subs   newMap(	   s   imageMaps   pointss   indexs	   coordrowss   re_coordrowss   coordrows   res   newMaps	   re_coords(    (   s   pointss   C:\Python\PL\drawgraph.pys   clickableToplistLabels¾  s    	 
$ c      
   C   s¬  t  i  ƒ  } | i t j o | i t d d ƒ j oŽ t | i d d !ƒ } t | i
 d d !ƒ } | | j o | d 7} n | | } |  i | | !|  _ |  i | | !|  _ |  i | | !|  _ n | i t t f j oF |  i d | i !|  _ |  i d | i !|  _ |  i d | i !|  _ n t d „  t d t |  i ƒ ƒ ƒ } y  t |  i ƒ t |  i ƒ } Wn d } n Xt | d | i ƒ \ } } | _ x< t t |  i ƒ ƒ D]% } |  i | d | i |  i | <qªWx< t t |  i ƒ ƒ D]% } |  i | d | i |  i | <qéWx< t t |  i ƒ ƒ D]% } |  i | d | i |  i | <q(Wd	 } t" i# t" i$ j o d
 | } d | }
 n d
 } d }
 t' | | d | | i) | i* d ƒ }	 |	 i, |
 | d | d | d | | i- | i. | i/ d d ƒ	 } |	 i1 ƒ  i2 | ƒ } |	 i4 t5 ƒ } | i7 d ƒ | i8 | i9 d | i: ƒ | i; t< |  i ƒ d ƒ | i; t< |  i ƒ d ƒ | i; t< |  i ƒ d ƒ |	 i= d ƒ t> |	 | | ƒ Sd  S(   Ni    i€Q i   i   i   c         C   s
   t  |  ƒ S(   N(   s   strs   x(   s   x(    (    s   C:\Python\PL\drawgraph.pys   <lambda>é  s    i   f1024.0i   iô  iO   ih  ii   i™  iÈ   iÀÀÀ s    i0ÿ0 i00ÿ iÿ00 i   (@   s   times   timings
   speedGraphs
   chart_types	   DAY_CHARTs
   graph_times   ranges   ints   stat_start_times   hour_index_lows   stat_end_times   hour_index_highs   sizeLineDatas	   graphDatas	   lineData0s   barData0s	   lineData1s   barData1s	   lineData2s   barData2s   MONTH_CHARTs
   WEEK_CHARTs   daysInCharts   maps   lens   labelss   maxs   data_maxs	   scaleDatas   unitss	   unit_datas   unit_ptrs   xs	   XGAadjusts   PL2_inis
   screenSizes   XGAs
   chartWidths	   plotareaXs   XYCharts   scales   chartBgColors   chartEdgeColors   cs   setPlotAreas   plotBgColors   plotAltBgColors   plotEdgeColors   plotareas   xAxiss	   setLabelss   ts   addBarLayer2s
   Percentages   layers	   setBarGaps   addDataGroups
   IP_addresss   hostnames
   addDataSets   lists
   makeChart2s   makeImageMaps   top_box(   s	   graphDatas
   speedGraphs   top_boxs   scales   layers
   chartWidths   labelss	   XGAadjusts   plotareas   cs	   plotareaXs   timings   sizeLineDatas   hour_index_lows	   unit_datas   hour_index_highs   ts   xs   data_max(    (    s   C:\Python\PL\drawgraph.pys   buildSpeedImageMapÒ  s\    )
$ 
!  #  #  #

&@c         C   s  d } y t i o | d 7} n Wn n Xd } | i t j o |  i | i	 d | ƒ } n | i t
 j o |  i | i	 d | ƒ } n | i t t f j o |  i | i	 d | ƒ } n | i t j o3 | i } |  i | i	 d | i d d	 !| ƒ } n t | d
 ƒ } t ƒ  } | Sd  S(   NsE   title='{xLabel}:

 {value|1}  {dataSetName}
 {totalValue|1} {field0}'s4    onmousedown = "speedChartMouseDown('{field0}','1')"s    s   ptr={x}s   month={={x}+1}s   day={={x}+1}s   hour={={x}+%s}i   i   i   (   s   imageMapParas   PL2_inis	   popUpMenus	   imageMap1s
   speedGraphs
   chart_types   USERDEF_CHARTs   cs   getHTMLImageMaps	   file2Calls
   YEAR_CHARTs
   WEEK_CHARTs   MONTH_CHARTs	   DAY_CHARTs   graph_start_times
   start_hours   clickableSpeedGraphLabelss   contextMenu3Maps	   imageMap3(   s   cs
   speedGraphs   top_boxs	   imageMap1s
   start_hours	   imageMap3s   imageMapPara(    (    s   C:\Python\PL\drawgraph.pys   makeImageMap  s(    
	*	c         C   s+  | t j o | i  } n t i t i j o
 d } n d } t |  i	 ƒ d } d | d d }	 |	 d d d d | } d	 } d
 t d | ƒ } d } d } d }
 | d @o˜ |  i d j o$ | t d |  i ƒ i d ƒ 7} n | d i t |  i	 ƒ ƒ 7} |  i	 } |  i } | d @o | d 8} |  i }
 qUd } | d 7} n | d 7} t } | d @o™ | d 7} | t d |  i ƒ i d ƒ d | i 7} | t d |  i ƒ i d ƒ d | i 7} |
 t d |  i  ƒ i d ƒ d | i! 7}
 | d 8} n | d @o´ | d 7} | t d |  i" i d ƒ d | i# ƒ i d ƒ 7} | t d |  i$ i d ƒ d | i% ƒ i d ƒ 7} |
 t d |  i& i d ƒ d | i' ƒ i d ƒ 7}
 | d 8} n | d @o´ | d 7} | t d |  i( i d ƒ d | i) ƒ i d ƒ 7} | t d |  i* i d ƒ d | i+ ƒ i d ƒ 7} |
 t d |  i, i d ƒ d | i- ƒ i d ƒ 7}
 | d 8} n | d @o	 | d @oz | i/ | | | | d t i0 t i1 | ƒ } | i2 | i3 d d | ƒ | i4 | t5 ƒ t i6 o | i7 d | ƒ qn | | | |
 | | | f Sd  S(   Ni   i    i   i´   i   i   ib   iT   i   s)   <*font=courbd.ttf, size=%s, underline=0*>i   s    i   s   %.0fi   iÜ   i   i   s       Total datas   %.1fs    i   s      Top-Valuei   s      Avg.Valuei   i   iÿÿÿÿi
   (8   s   topboxs   Nones
   speedGraphs   PL2_inis
   screenSizes   XGAs   screenSizeAdjusts   lens	   graphDatas	   data0Names
   row1_widths
   graph_bases	   top_box_Xs	   top_box_Ys   ints   scales   top_box_headLines   top_box_text0s   top_box_text1s   top_box_text2s   hostss   strs   ljusts	   data1Names	   data2Names   top_boxs   traffic_total_ins   rjusts	   speedDatas   unit_ins   traffic_total_outs   unit_outs   traffic_totals   unit_tots   inbound_maxvalues   unit_in_speeds   outbound_maxvalues   unit_out_speeds   total_maxvalues   unit_tot_speeds   speed_total_in_avgs   unit_avg_in_speeds   speed_total_out_avgs   unit_avg_out_speeds   speed_total_tot_avgs   unit_avg_tot_speeds   cs	   addLegends   topbox_data_fontfiles   topbox_data_fontsizes   setBackgrounds   topboxBgColors   addKeys   Transparents   rounded_boxess   setRoundedCorners(   s	   graphDatas
   speedGraphs   cs	   speedDatas   topboxs   scales   screenSizeAdjusts   top_box_headLines   top_boxs
   graph_bases   top_box_text2s
   row1_widths   top_box_text0s   top_box_text1s	   top_box_Ys	   top_box_X(    (    s   C:\Python\PL\drawgraph.pys   addSpeedTopbox?  sf    
$		


+++
444
444-
c         C   s  t  i t  i j o
 d } n d } | i d j o d d d d | } n d d d d | } d	 } d
 t d | ƒ }	 d } d } d } | i d @ob |	 t d |  i ƒ i d ƒ 7}	 d } d } | i d @o | d 8} d } q	d } | d 7} n |	 d 7}	 | i d @o™ |	 d 7}	 | t d |  i ƒ i d ƒ d | i 7} | t d |  i ƒ i d ƒ d | i 7} | t d |  i ƒ i d ƒ d | i 7} | d 8} n | i d @o |	 d 7}	 n | i d @o™ |	 d 7}	 | t d |  i ƒ i d ƒ d | i 7} | t d |  i ƒ i d ƒ d | i 7} | t d |  i ƒ i d ƒ d | i  7} | d 8} n | i! t" j oç |	 d 7}	 | d t# d t$ d ƒ f d d |  i% d i d ƒ d | i& 7} | d t# d t$ d ƒ f d d |  i% d i d ƒ d | i' 7} | d t# d t$ d ƒ f d d |  i% d i d ƒ d | i( 7} | d  8} n | i d! @ov | i* | | | | d t  i+ t  i, | ƒ }
 |
 i. | i/ d" d# ƒ |
 i0 |	 t1 ƒ t  i2 o |
 i3 d$ | ƒ qîn |
 | | | f Sd  S(%   Ni   i    i   i®   i   ib   iT   iý   i   s)   <*font=courbd.ttf, size=%s, underline=0*>i   s    i   s   %.0fi   s   In s   Outi   s   TotiÜ   i   s       s
   Total datas   %.1fs    s      s      Avg.Values    Shapings    <*color=%x*>%si*   i   iJ   i   iÿÿÿÿi   i
   (4   s   PL2_inis
   screenSizes   XGAs   screenSizeAdjusts   toplistGraphs   layouts	   top_box_Xs	   top_box_Ys   ints   scales   top_box_headLines   top_box_text0s   top_box_text1s   top_box_text2s   topboxs   strs	   graphDatas   hostss   ljusts   traffic_total_ins   rjusts   toplistDatas   unit_ins   traffic_total_outs   unit_outs   traffic_totals   unit_tots   speed_total_in_avgs   unit_avg_in_speeds   speed_total_out_avgs   unit_avg_out_speeds   speed_total_tot_avgs   unit_avg_tot_speeds   stats   VBS_STATs
   speedColors   chrs   VBS_speedValues   unit_VBS_0_speeds   unit_VBS_1_speeds   unit_VBS_2_speeds   cs	   addLegends   topbox_data_fontfiles   topbox_data_fontsizes   top_boxs   setBackgrounds   topboxBgColors   addKeys   Transparents   rounded_boxess   setRoundedCorners(   s	   graphDatas   toplistGraphs   cs   toplistDatas   units   scales   top_box_text0s   top_box_text1s   top_box_text2s   top_box_headLines   top_boxs	   top_box_Ys   screenSizeAdjusts	   top_box_X(    (    s   C:\Python\PL\drawgraph.pys   addToplistTopbox  s`    
 



+++
+++
EEE-
c           C   s   d d Sd  S(   Ns+   <area shape="rect" coords="6, 70, 130, 100"sK    onmouseover = "popup('contextMenu3')" + onmouseout = "popdown()" href="#">(    (    (    (    s   C:\Python\PL\drawgraph.pys   contextMenu3MapÙ  s    c         C   s„   t  i t |  d ƒ ƒ t  i } t t  i d t  i | ƒ ƒ ƒ } t t  i d t  i | ƒ ƒ ƒ } | d j o | d 7} n | Sd  S(   Ns   %Y-%m-%d %H:%Ms   %Ys   %WiÔ  i   (   s   times   mktimes   strptimes   dates   timezones   time_secs   ints   strftimes   gmtimes   yearNos   weekNo(   s   dates   yearNos   weekNos   time_sec(    (    s   C:\Python\PL\drawgraph.pys   weekNoFromDateÜ  s    !!c         C   sP   |  i t d ƒ d ƒ i t d ƒ d ƒ i d d ƒ i d d ƒ i d	 d
 ƒ Sd  S(   Ni   s   %0Di
   s   %0As   "s   %22s   #s   %23s   &s   %26(   s   texts   replaces   chr(   s   text(    (    s   C:\Python\PL\drawgraph.pys
   escapeTextæ  s    c          C   s8   t  ƒ  }  d |  d @d ?|  d @d ?|  d @f } | Sd  S(   Ns   %s.%s.%sl      ~ i   i  ÿ i   iÿÿ  (   s
   getVersions   chartDirVers   chartDirVersion(   s   chartDirVers   chartDirVersion(    (    s   C:\Python\PL\drawgraph.pys
   cd_versionî  s    	's   __main__s   FONTPATH(6   s   PL2_inis   PL_debugs   PL_consts   PL_miscs   sorts   Sorters   strptimes   maths   logs   numarrays   times   calendars   oss   cgis   addEnvirionFontPaths   seps
   pychartdirs
   label_names
   HOUR_CHARTs	   DAY_CHARTs
   WEEK_CHARTs   MONTH_CHARTs
   YEAR_CHARTs
   speedColors   weekDayNameLongs	   GraphDatas	   ChartUnits   ToplistGraphDatas   GraphToplistDatas	   GraphParas   getLogoPaths   addLogoToCharts	   scaleDatas   buildChartLabelss   addChartinfos   addContentInfos   drawSpeedGraphs   Nones   drawToplistGraphs   drawStackedToplistGraphs   findGraphHostnames   buildGraphTitles   clickableSpeedGraphLabelss   clickableToplistLabelss   buildSpeedImageMaps   makeImageMaps   addSpeedTopboxs   addToplistTopboxs   contextMenu3Maps   weekNoFromDates
   escapeTexts
   cd_versions   __name__s   environ()   s
   cd_versions	   ChartUnits
   label_names   getLogoPaths   addContentInfos   calendars   drawStackedToplistGraphs   logs   numarrays   buildGraphTitles   addToplistTopboxs   clickableSpeedGraphLabelss   strptimes   weekDayNameLongs   Sorters   drawSpeedGraphs   PL_consts   findGraphHostnames   ToplistGraphDatas   cgis   addChartinfos	   GraphDatas   addLogoToCharts   PL_miscs   contextMenu3Maps   buildChartLabelss   addSpeedTopboxs   GraphToplistDatas   clickableToplistLabelss	   scaleDatas   drawToplistGraphs   PL2_inis
   speedColors
   escapeTexts   makeImageMaps	   GraphParas   weekNoFromDates   buildSpeedImageMaps   times   oss   addEnvirionFontPath(    (    s   C:\Python\PL\drawgraph.pys   ?   sr   					
1=.**ü. ÿ ÿ ]` 	¿	+				"		I	$PJ		
		 