ó
©%�Tc           @   s   d  „  Z  d „  Z d S(   c          C   s  t  ƒ  t j j t ƒ sJ d t d }  t s3 d n d } t | |  ƒ n¶ t t ƒ } | sd d GHnœ d t d g } | d t	 | ƒ } t
 | ƒ } | s¼ d	 t d
 d d } t | ƒ nD t | t ƒ t r t j ƒ  r t d ƒ } t | d d „  ƒ q n  d  S(   Ns   jligand java jar file: s
    not founds+   Environment variable JLIGAND_HOME not set

t    s   BL INFO:: no java founds   -jars   -versiont    s   Sorry, your JLigand:

 s   

s%   is not new enough to work with Coot!
s   Please download a new one!t   JLigands'   Send Link to JLigand (click 2 monomers)c         S   s   t  ƒ  S(   N(   t!   click_select_residues_for_jligand(   t   func(    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/jligand_gui.pyt   <lambda>3   s    (   t   start_jligand_listenert   ost   patht   isfilet   jligand_jart   jligand_home_envt   info_dialogt   find_exet   java_commandt   string_append_with_spacest   shell_command_to_stringt   run_concurrentlyt   jligand_argst   have_coot_pythont   coot_pythont   main_menubart   coot_menubar_menut   add_simple_coot_menu_menuitem(   t   st   env_messaget   java_exet   jligand_versiont   cmdt   rest   messaget   jligand_menu(    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/jligand_gui.pyt   launch_jligand_function   s.    c          C   s   d „  }  t  d |  ƒ d  S(   Nc          W   s¼  d G|  GHt  |  ƒ d k r¸|  d } |  d } d G| GHd G| GHt  | ƒ d k r¸t  | ƒ d k r¸t | d | d | d | d	 ƒ } t | d | d | d | d	 ƒ } | d } | d } | d } | d } | d }	 | d }
 t | t ƒ ot | t ƒ sd
 | | f GHqµ| | k sNd | | f d } t | ƒ t } qµ| | k r�|	 |
 k r�d | |	 f d } t | ƒ t } qµ| } t t | ƒ | t | ƒ | ƒ q¸n  d  S(   Ns   we received these clicksi   i    i   s   click_1:s   click_2:i   i   i   s   Bad resnames: %s and %ss,   Two different molecules %s and %s selected.
s2   Make sure to select residues in the same molecule.s   Same residue %s %s selected.
s'   Make sure to select different residues.(   t   lent   residue_namet
   isinstancet   strR   t   Falset   write_file_for_jligandt   click2res_spec(   t   argst   click_1t   click_2t	   resname_1t	   resname_2t   imol_click_1t   imol_click_2t   chain_click_1t   chain_click_2t   resno_click_1t   resno_click_2t   msgt   imol_jligand_link(    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/jligand_gui.pyt   link_em>   sR    	

		









	

	i   (   t   user_defined_click(   R5   (    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/jligand_gui.pyR   :   s    	.N(   R    R   (    (    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/jligand_gui.pyt   <module>   s   	5