mò
Ó3Bc           @   s@   d  k  Td  k Td k Z d k Z d k Z d f  d „  ƒ  YZ d S(   (   t   *Nt   Exportc           B   st   t  Z d  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d „  Z RS(   s#   Module to export the double_lin_regt   outputc         C   sG   d d d d g |  _ |  i d d g |  _ d d g |  _ | |  _ d  S(   Nt   pngt   svgt   figt   jpegt   windowt   text(   t   selft	   File_listt   Export_listR   t   output_file_namet   Output_file_name(   R	   R   (    (    t    /home/lathuili/fractal/export.pyt   __init__   s    c         C   s   | |  _ d  S(   N(   t   plotR	   t   Plot(   R	   R   (    (    R   t   set_plot   s    c         C   s   | |  _ d  S(   N(   t   regR	   t   Reg(   R	   R   (    (    R   t   set_reg   s    c         C   s   t  |  i ƒ S(   N(   t   lenR	   R   (   R	   (    (    R   t   size_of_export_list   s    c         C   s   |  i S(   N(   R	   R
   (   R	   (    (    R   t	   file_list   s    c         C   s   | |  _ d  S(   N(   t   ListR	   R   (   R	   R   (    (    R   t   set_export_list$   s    c         C   sJ   | d j o |  i |  _ n* | |  i j o | g |  _ n
 t | ‚ d  S(   Nt   all(   t   exportR	   R   R   t   InvalidArgument(   R	   R   (    (    R   t
   set_export(   s
    c         C   sG   | |  i j o* | |  i j o |  i | g 7_ qC n
 t | ‚ d  S(   N(   R   R	   R   R   R   (   R	   R   (    (    R   t
   add_export2   s    c         C   s   | |  _ d  S(   N(   t	   file_nameR	   R   (   R	   R    (    (    R   t   set_output_file_name:   s    c      	   C   sê  xã|  i D]Ø} | d j o- d G|  i d d Gd G|  i d d GHq
 | |  i d g j o|yat i d d ƒ } | i d ƒ | i d	 ƒ | d
 t	 |  i
 d d d ƒ d t	 |  i
 d d d ƒ d ƒ | i d ƒ | |  i j o/ | d | ƒ | d |  i d | d ƒ n | i |  i
 t i t	 |  i d d ƒ d t	 |  i d d ƒ ƒ t i t	 |  i d d ƒ d t	 |  i d d ƒ ƒ ƒ | d j o t d ƒ n | i ƒ  Wqâd | d GHqâXq
 d GHq
 Wd  S(   NR   s   The fractal dimensions are : i    t   andi   R   t   debugs   Result of interpolations   ln(size_of_boxes)s   set yrange [iÿÿÿÿt   :f0.5t   ]s$   ln(number_of_covering_contour_boxes)s   set terminal s   set output "t   .t   "s   *x+s#   Please press return to continue...
s   The t   faileds
   no output!(   R	   R   R   R   R   t   Gnuplott   graphict   titlet   xlabelt   strR   t   ylabelR
   R   R   t   Funct	   raw_inputt   reset(   R	   R*   R   (    (    R   R   @   s*    
 -D!|c         C   sÆ   x¿ |  i D]´ } | |  i j ož t i i |  i d | ƒ } t i i | ƒ o+ t i	 | t i
 ƒ p d | GHt Sqº q¾ t i	 t i i | ƒ t i
 ƒ p d t i i | ƒ GHt Sq¾ q
 q
 Wt S(   NR&   s   You can't write on s   You can't write in (   R	   R   R   R
   t   ost   patht   abspathR   t   existst   accesst   W_OKt   Falset   dirnamet   True(   R	   R   R3   (    (    R   t   check_rightX   s    
 	"(   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   R   R   R!   R   R;   (    (    (    R   R      s    						
			(   t   my_exceptionst   NumericR)   t   Gnuplot.funcutilsR2   R   (   R   R2   R)   (    (    R   t   ?   s   	
