ó
ÉÝ{Tc           @   sÃ   d  Z  d d l Z d d l Z d d l m Z m Z d d l Z d „  Z d e j f d „  ƒ  YZ	 d e j e	 f d „  ƒ  YZ
 d	 e j e	 f d
 „  ƒ  YZ d e j e	 f d „  ƒ  YZ d „  Z d S(   s—  
     qtgui/downloadPdb.py: CCP4MG Molecular Graphics Program
     Copyright (C) 2001-2008 University of York, CCLRC
     Copyright (C) 2009-2010 University of York
     Copyright (C) 2012 STFC

     This library is free software: you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public License
     version 3, modified in accordance with the provisions of the 
     license to address the requirements of UK law.
 
     You should have received a copy of the modified GNU Lesser General 
     Public License along with this library.  If not, copies may be 
     downloaded from http://www.ccp4.ac.uk/ccp4license.php
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU Lesser General Public License for more details.
iÿÿÿÿN(   t   QtGuit   QtCorec          C   sÑ   d d  l  }  d d l m } | d ƒ j d ƒ } | d ƒ j d ƒ } | d ƒ j d ƒ } | d k rk d  S|  j i | d 6ƒ } |  j ƒ  } | d k r» | j d  d	 | d
 | d | ƒn  |  j | | ƒ } | S(   Niÿÿÿÿ(   t   PMt   download_preferencest
   http_proxyt	   http_usert   http_passwordt    t   httpt   urit   usert   passwd(	   t   urllib2t   global_definitionsR   t   gett   Nonet   ProxyHandlert   HTTPBasicAuthHandlert   add_passwordt   build_opener(   R   R   t	   proxy_uriR
   R   t   proxyt   proxy_auth_handlert   opener(    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   setup_proxies   s    "t   downloadPdbCorec           B   s    e  Z d  „  Z d d d „ Z RS(   c         C   s   t  j j |  ƒ t |  _ d  S(   N(   R   t   QObjectt   __init__t   Falset   interrupt_dl(   t   self(    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR   2   s    t   DownloadFinishedc         C   s;  d d  l  } | s |  j } n  | sv |  j t j d ƒ d ƒ |  j t j d ƒ d d ƒ |  j t j d ƒ d ƒ d  Sd d  l } | j ƒ  |  _ y4 t ƒ  } | rµ | j	 | ƒ } n | j
 | ƒ } Wn| t j ƒ  d  \ } } }	 t j j t | ƒ d	 ƒ t j j t | ƒ d	 ƒ |  j t j d ƒ d
 t | ƒ d ƒ d  SXyK| j ƒ  }
 d } x´ |
 j D]© } | j d ƒ d k rc| j d ƒ d j ƒ  } y, t | ƒ } |  j t j d ƒ d d ƒ WnB |  j t j d ƒ d d ƒ |  j t j d ƒ d ƒ d } n XPqcqcWd } d } | j d ƒ } x¢ t | ƒ d k rÏ|  j rÏt j |  j d | ƒ | | } | t | ƒ } t t | ƒ | d ƒ } | d k r½|  j t j d ƒ | ƒ n  | j d ƒ } q.W| j ƒ  |  j s…|  j d } t j |  j d ƒ |  j t j d ƒ d d ƒ |  j t j d ƒ d ƒ d G| Gd Gt j j ƒ  GHt j j ƒ  |  j t j | ƒ | ƒ t  |  _ n  t  |  _ Wn¥ t  |  _ d G| GHt j ƒ  d  \ } } | GH| GHt j |  j d ƒ |  j t j d ƒ d t | ƒ ƒ |  j t j d ƒ d d ƒ |  j t j d ƒ d ƒ n Xd  S(   Niÿÿÿÿt   Errors   No pdb to downloadt   ProgressBarRangeChangedi    id   t   ProgressChangedi   s   
s   Error opening url sy   
Please check that you have internet connection.
and that the pdb id is valid.
Also the data may not exist on the server.s   Content-Length:t   :i   R   t   Emittingt   froms   Error getttingi   s   Error getting file(!   R   t   urlt   emitR   t   SIGNALt   tempfilet   mkstempt	   localFileR   t   opent   urlopent   syst   exc_infot   stderrt   writet   strt   infot   headerst   findt   splitt   stript   intt   readt   lenR   t   ost   floatt   closet   QThreadt   currentThreadt   stdoutt   flushR   (   R   R&   t   finishedSignalR   R)   R   t   dlt   exc_typet	   exc_valuet   exc_tbR3   t   contentLengtht   ht   clt	   readBytest   bufferR9   t   pct   fname(    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   downloadMain6   s†     	' 


	 		#N(   t   __name__t
   __module__R   R   RN   (    (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR   1   s   	t   downloadMultipleACsc           B   se   e  Z e j e ƒ Z e j ƒ  Z d  „  Z d d „ Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z RS(   c         C   s:   t  |  _ |  j j d d ƒ |  j j d ƒ |  j ƒ  d  S(   Ni    id   (   t   TrueR   t   progressBart   setRanget   setValuet   Close(   R   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   InterruptAndClose…   s    	c         C   sZ  t  j  j |  | ƒ t |  _ |  j |  j d ƒ ƒ t j ƒ  } t j ƒ  |  _	 |  j	 j
 d d ƒ |  j	 j d ƒ |  j |  t j d ƒ |  j	 j ƒ |  j |  t j d ƒ |  j	 j ƒ |  j |  t j d ƒ |  j ƒ |  j |  t j d ƒ |  j	 j
 ƒ t j ƒ  |  _ |  j |  t j d ƒ |  j j ƒ t j ƒ  } | j |  j d ƒ t j j ƒ } | j t j j ƒ } |  j | t j d ƒ |  j ƒ |  j | t j d	 ƒ |  j ƒ | j |  j	 ƒ | j |  j ƒ | j | ƒ |  j | ƒ d
 |  _ |  j ƒ  |  j ƒ  g  |  _ d  |  _  d d  l! } |  j" j |  j# ƒ |  j$ j |  j ƒ | j! |  j% ƒ |  _& d  S(   Ns!   Download multiple Accession Codesi    id   R"   R!   t   LabelTextChangedt   Downloads
   accepted()s	   clicked()s!   Download multiple accession codesiÿÿÿÿ('   t   MGSimpleDialogR   R   R   t   setWindowTitlet   trR    t   QVBoxLayoutt   QProgressBarRS   RT   RU   t   connectR   R(   t   updatet   QLabelt	   textLabelt   setTextt   QDialogButtonBoxt	   addButtont
   AcceptRolet   Cancelt   downloadRW   t	   addWidgett	   setLayoutt   titlet   CreateMenuEntryRV   t   filesR   t	   directoryt   UtilityThreadt	   FileSavedt   loadSavedFilet   DownloadedAllFilest   downloadFilest   downloadThread(   R   t   parentt   layoutt   dialog_buttonst	   ok_buttont   cancel_buttonRo   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR   ‹   s>    	""""!	

		c         C   sQ   d d l  m } d Gt | j ƒ  ƒ GH| ƒ  j t | j ƒ  ƒ d d d d ƒd  S(   Niÿÿÿÿ(   t
   MAINWINDOWt   Savedt   use_current_stylei   t   show_wizard_choicesi    (   R   Rz   R2   t   toUtf8t   openFile(   R   RM   Rz   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRq   ¬   s    c         C   s   | |  _  d  S(   N(   Rn   (   R   Rn   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   setDirectory±   s    c         C   s£   | |  _  t | ƒ d k  r/ |  j j d ƒ d  Sd } x  | d  D] } | | d } q@ W| | d } | d  } t | ƒ d k r� | d } n  |  j j | ƒ d  S(	   Ni   R   s   Download accession codes: iÿÿÿÿs   , id   t   100s   ...(   Rm   R:   Rb   Rc   (   R   Rm   t   textt   f(    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   setFiles´   s    	
c   
      C   s·  d d  l  } d d  l } d } d } d } xyt t t |  j ƒ ƒ |  j ƒ D]V\ } } |  j t j d ƒ d d ƒ |  j t j d ƒ d ƒ | d | | } |  j	 d	 | d
 t
 | d ƒ d t
 t |  j ƒ ƒ ƒ GH|  j t j d ƒ |  j	 d	 | d
 t
 | d ƒ d t
 t |  j ƒ ƒ ƒ ƒ |  j | ƒ |  j d }	 |  j d  k r‡| j |	 t j j t j j |  j | d ƒ ƒ ƒ n  | j |	 t j j | d ƒ ƒ t j |	 ƒ |  j	 d | d t
 | d ƒ d t
 t |  j ƒ ƒ ƒ GH|  j t j d ƒ |  j	 d | d t
 | d ƒ d t
 t |  j ƒ ƒ ƒ ƒ |  j d  k r‚|  j j t j j t j j |  j | d ƒ ƒ ƒ qL |  j j t j j | d ƒ ƒ qL W|  j j ƒ  d  S(   NiÿÿÿÿsC   http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccores   &id=34577062,24475906s   &rettype=fasta&retmode=textR!   i    R"   s   &id=s   Downloading s   . i   s    of RX   s   .fastas   Download of s    complete. (   t   ret   shutilt   zipt   rangeR:   Rm   R'   R   R(   R\   R2   RN   R+   Rn   R   t   copy2R;   t   patht   abspatht   joint   unlinkRp   Rr   (
   R   R…   R†   t   sitet   idt   site_suffixt   iRƒ   R&   RM   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRs   Â   s.    .;O5 ;O5$c         C   sJ   |  j  j ƒ  |  j  j d d ƒ |  j  j d ƒ t |  _ |  j j ƒ  d  S(   Ni    (   RS   t   resetRT   RU   R   R   Rt   t   start(   R   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRh   á   s
    	N(   RO   RP   R   t
   pyqtSignalR2   Rp   Rr   RW   R   R   Rq   R€   R„   Rs   Rh   (    (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRQ   ‚   s   	!				t   downloadMultiplePdbsc           B   se   e  Z e j e ƒ Z e j ƒ  Z d  „  Z d d „ Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z RS(   c         C   s:   t  |  _ |  j j d d ƒ |  j j d ƒ |  j ƒ  d  S(   Ni    id   (   RR   R   RS   RT   RU   RV   (   R   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRW   ë   s    	c         C   sZ  t  j  j |  | ƒ t |  _ |  j |  j d ƒ ƒ t j ƒ  } t j ƒ  |  _	 |  j	 j
 d d ƒ |  j	 j d ƒ |  j |  t j d ƒ |  j	 j ƒ |  j |  t j d ƒ |  j	 j ƒ |  j |  t j d ƒ |  j ƒ |  j |  t j d ƒ |  j	 j
 ƒ t j ƒ  |  _ |  j |  t j d ƒ |  j j ƒ t j ƒ  } | j |  j d ƒ t j j ƒ } | j t j j ƒ } |  j | t j d ƒ |  j ƒ |  j | t j d	 ƒ |  j ƒ | j |  j	 ƒ | j |  j ƒ | j | ƒ |  j | ƒ d |  _ |  j ƒ  |  j ƒ  g  |  _ d  |  _  d
 d  l! } |  j" j |  j# ƒ |  j$ j |  j ƒ | j! |  j% ƒ |  _& d  S(   Ns   Download multiple pdbsi    id   R"   R!   RX   RY   s
   accepted()s	   clicked()iÿÿÿÿ('   RZ   R   R   R   R[   R\   R    R]   R^   RS   RT   RU   R_   R   R(   R`   Ra   Rb   Rc   Rd   Re   Rf   Rg   Rh   RW   Ri   Rj   Rk   Rl   RV   Rm   R   Rn   Ro   Rp   Rq   Rr   Rs   Rt   (   R   Ru   Rv   Rw   Rx   Ry   Ro   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR   ñ   s>    	""""!	

		c         C   sQ   d d l  m } d Gt | j ƒ  ƒ GH| ƒ  j t | j ƒ  ƒ d d d d ƒd  S(   Niÿÿÿÿ(   Rz   R{   R|   i   R}   i    (   R   Rz   R2   R~   R   (   R   RM   Rz   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRq     s    c         C   s   | |  _  d  S(   N(   Rn   (   R   Rn   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR€     s    c         C   s£   | |  _  t | ƒ d k  r/ |  j j d ƒ d  Sd } x  | d  D] } | | d } q@ W| | d } | d  } t | ƒ d k r� | d } n  |  j j | ƒ d  S(	   Ni   R   s   Download pdbs: iÿÿÿÿs   , id   R�   s   ...(   Rm   R:   Rb   Rc   (   R   Rm   R‚   Rƒ   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR„     s    	
c   
      C   sv  d d  l  } d d  l } d d l m } | d ƒ j d ƒ } | d ƒ j | d ƒ } xt t t |  j ƒ ƒ |  j ƒ D]é\ } } |  j	 t
 j d ƒ d d ƒ |  j	 t
 j d ƒ d ƒ | j d	 | j ƒ  | ƒ } |  j	 t
 j d
 ƒ |  j d | d t | d ƒ d t t |  j ƒ ƒ ƒ ƒ |  j | ƒ |  j d }	 |  j d  k r�| j |	 t j j t j j |  j | d ƒ ƒ ƒ n  | j |	 t j j | d ƒ ƒ t j |	 ƒ |  j	 t
 j d
 ƒ |  j d | d t | d ƒ d t t |  j ƒ ƒ ƒ ƒ |  j d  k rA|  j j	 t j j t j j |  j | d ƒ ƒ ƒ qx |  j j	 t j j | d ƒ ƒ qx W|  j j	 ƒ  d  S(   Niÿÿÿÿ(   R   R   t   preferred_sitet   _Download_PDBR!   i    R"   t   PDBIDRX   s   Downloading s   . i   s    of s   .pdbs   Download of s    complete. (   R…   R†   R   R   R   R‡   Rˆ   R:   Rm   R'   R   R(   t   subt   lowerR\   R2   RN   R+   Rn   R   R‰   R;   RŠ   R‹   RŒ   R�   Rp   Rr   (
   R   R…   R†   R   RŽ   t   comR‘   Rƒ   R&   RM   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRs   (  s*    .O5 O5$c         C   sJ   |  j  j ƒ  |  j  j d d ƒ |  j  j d ƒ t |  _ |  j j ƒ  d  S(   Ni    (   RS   R’   RT   RU   R   R   Rt   R“   (   R   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRh   C  s
    	N(   RO   RP   R   R”   R2   Rp   Rr   RW   R   R   Rq   R€   R„   Rs   Rh   (    (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR•   è   s   	!				t   downloadPdbc           B   sn   e  Z d  d „ Z d  d „ Z d „  Z d „  Z d „  Z d d „ Z d „  Z	 d „  Z
 d  d	 „ Z d
 „  Z RS(   R   c         C   sÕ   d d  l  } d d  l } d d  l } d d l m } | j j | ƒ d sW | d } n  |  j d } | j | | ƒ t	 |  d ƒ r« t	 |  j
 d ƒ r« |  j
 j ƒ  |  `
 n  | ƒ  j | d d d d	 ƒ|  j ƒ  d  S(
   Niÿÿÿÿ(   Rz   i   s   .pdbt
   fileDialogR=   R|   R}   i    (   R;   R†   t   MGApplicationR   Rz   RŠ   t   splitextR+   R‰   t   hasattrR�   R=   R   RV   (   R   t   sfnameR;   R†   Rž   Rz   RM   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   saveFileL  s    $ !	c         C   s9  d GHt  j j ƒ  |  j t j d ƒ |  j d ƒ ƒ |  j j d ƒ d d  l	 } | j
 j | ƒ s‚ t | j | ƒ j ƒ d k rÀ |  j t j d ƒ d t |  j j ƒ  ƒ d	 ƒ |  j ƒ  d  St |  j j ƒ  ƒ d
 } d d  l } | j |  d d g d | ƒ|  _ |  j |  j t j d ƒ |  j ƒ |  j j ƒ  d  S(   Nt   saveDownloadedFileRX   s   Download  completei    iÿÿÿÿi
   R    s   No file downloaded for s%   
Is there a PDB entry with this name?s   .pdbt   filterss   Model coordinate files (*.pdb )t   defaultFileNamet   save(   R.   R@   RA   R'   R   R(   R\   t   dataIDt   setDisabledR;   RŠ   t   existsR8   t   statt   st_sizeR2   R‚   t   resetSelectiont	   mgWidgetst   MGSaveFileDialogR�   R_   R¢   t   show(   R   RM   R;   R¥   R­   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR£   `  s     "20
!"c         C   s8  d d  l  } d d l m } t |  j j ƒ  ƒ j ƒ  } t | ƒ d k  rM d  S|  j j d ƒ |  j	 j
 |  j d | ƒ ƒ | d ƒ j d ƒ } | d ƒ j | d ƒ } | j d	 | | ƒ |  _ d
 G|  j GH|  j j ƒ  |  j j d d ƒ |  j j d ƒ |  j t j d ƒ |  j d ƒ ƒ t |  _ |  j j ƒ  d  S(   Niÿÿÿÿ(   R   i   i   s   Preparing download of R   R–   R—   R˜   s   download urli    RX   s   Downloading (   R…   R   R   R2   R§   R‚   Rš   R:   R¨   Rb   Rc   R\   R   R™   R&   RS   R’   RT   RU   R'   R   R(   R   R   Rt   R“   (   R   R…   R   t   pdbidRŽ   R›   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRh   q  s"     "	c         C   sJ   t  |  _ |  j j d ƒ |  j j d d ƒ |  j j d ƒ |  j ƒ  d  S(   Ni    id   (   RR   R   R§   R¨   RS   RT   RU   RV   (   R   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRW   ƒ  s
    	c         C   s$   |  j  j d ƒ |  j j d ƒ d  S(   NR   i    (   Rb   Rc   RS   RU   (   R   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR¬   Š  s    c         C   sb  t  j  j |  | ƒ d d l m } t |  _ |  j |  j d ƒ ƒ t j	 ƒ  } t j
 |  j d ƒ ƒ } t j ƒ  |  _ |  j j |  j d ƒ ƒ | j | ƒ | j |  j ƒ t j ƒ  |  _ |  j j d d ƒ |  j j d ƒ t j
 ƒ  |  _ |  j |  t j d ƒ |  j j ƒ |  j |  t j d	 ƒ |  j j ƒ |  j |  t j d
 ƒ |  j j ƒ t j ƒ  } | j |  j d ƒ t j j ƒ } | j t j j ƒ } | j t j j ƒ } | j d | d ƒ j d ƒ d t j j ƒ |  _ |  j | t j d ƒ |  j  ƒ |  j | t j d ƒ |  j  ƒ |  j | t j d ƒ |  j! ƒ |  j | t j d ƒ |  j" ƒ |  j |  t j d ƒ |  j# ƒ |  j |  t j d ƒ |  j$ ƒ |  j |  j t j d ƒ |  j% ƒ |  j j d ƒ |  j j& d ƒ t j' ƒ  }	 |	 j( | ƒ |	 j |  j ƒ |	 j |  j ƒ |	 j | ƒ |  j) |	 ƒ d d  l* }
 |
 j* |  j+ ƒ |  _, |  j- t j. j/ ƒ d  S(   Niÿÿÿÿ(   R   s   Download coordinatess   PDB id:s&   Enter 4-letter pdb id and press returni    id   R"   R!   RX   RY   s   Search R   R–   s	    databases
   accepted()s	   clicked()R   R    s/   View database search tool in CCP4mg web browser(0   RZ   R   R   R   R   R   R[   R\   R    t   QHBoxLayoutRa   t	   QLineEditR§   t
   setToolTipRi   R^   RS   RT   RU   Rb   R_   R   R(   Rc   Rd   Re   Rf   Rg   t   HelpR   t
   ActionRolet   viewSiteRh   RW   t
   handleHelpR£   t   reportErrort   viewDatabaset   setAutoDefaultR]   t	   addLayoutRj   Ro   RN   Rt   t   setWindowModalityt   Qtt   ApplicationModal(   R   Ru   R   t
   codeLayoutt   pdbLabelRw   Rx   Ry   t   help_buttonRv   Ro   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR   Ž  sP    	"""!2"c         C   s$   d d l  m } | ƒ  j d ƒ d  S(   Niÿÿÿÿ(   t   HELPBROWSERs   atom_typing.html#downloading(   R   RÂ   t
   loadMgHelp(   R   RÂ   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR·   Â  s    c         C   s$   d d l  m } | ƒ  j d ƒ d  S(   Niÿÿÿÿ(   t   PREFERENCESWINDOWR   (   R   RÄ   t   loadNewWidget(   R   RÄ   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   detailsÆ  s    c         C   sZ   t  j j |  d | ƒ |  j j d ƒ |  j j ƒ  |  j j d d ƒ |  j j d ƒ d  S(   Ns   Error downloading PDBi    id   (	   R    t   QMessageBoxt   warningR§   R¨   RS   R’   RT   RU   (   R   t   message(    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR¸   Ê  s
    c         C   sR   d d l  m } m } | d ƒ j d ƒ } | ƒ  j | d ƒ j | d ƒ ƒ d  S(   Niÿÿÿÿ(   R   RÂ   R   R–   t   _Search(   R   R   RÂ   R   t   loadFile(   R   R   RÂ   RŽ   (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyR¹   Ñ  s    N(   RO   RP   R¢   R£   Rh   RW   R¬   R   R   R·   RÆ   R¸   R¹   (    (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyRœ   J  s   			4		c          C   s  d d  l  }  |  j d d d d d d d d	 d
 d d d d d d d d g d i
 d d 6d d
 6d d 6d d 6d d	 6d d 6d d 6d d 6d d 6d d 6d i t d t d d d  d! d" d d# d$ g d% d d# d$ g ƒ d 6t d t d d& d  d' ƒ d
 6t d t d d( d  d' ƒ d 6t d t d d) d  d' ƒ d 6t d t d d* d  d' ƒ d	 6t d t d d+ d  d' ƒ d 6t d t d d, d  d' ƒ d 6t d t d d- d  d ƒ d 6t d t d d. d  d ƒ d 6t d t d d/ d  d' ƒ d 6t d t d d0 d  d' ƒ d 6t d t d d1 d  d' ƒ d 6d2 d3 ƒ } | S(4   Niÿÿÿÿt   nameR   Rk   s   Download optionst   guit
   pdb_headerR–   t   EBI_Download_PDBt
   EBI_Searcht   RCSB_Searcht   RCSB_Download_PDBt   PDBJapan_Download_PDBt   PDBJapan_Searcht   proxy_headerR   R   R   t   defaultt   EBIs(   www.ebi.ac.uk/msd-srv/msdlite/index.htmls   www.rcsb.org/pdbsc   http://www.rcsb.org/pdb/cgi/export.cgi/PDBID.pdb?job=download;pdbId=PDBID;opt=show;format=PDB;pre=1sC   ftp://ftp.ebi.ac.uk/pub/databases/msd/pdb_uncompressed/pdbPDBID.ents&   ftp://www.pdbj.org/pdb_nc/pdbPDBID.entR   s-   pdbjs3.protein.osaka-u.ac.jp/xPSSS/index.htmlt
   definitiont   typet   labels   Preferred download sitet   stylet   comboboxt   menut   RCSBt   PDBJapant   aliass   EBI search paget   lineedits   RCSB search pages   RSCB PDB download commands   EBI PDB download commands   PDBJapan download commands    PDBJapan search pages   <b>PDB download options</b>s   <b>HTTP proxy options</b>s
   HTTP proxys   HTTP usernames   HTTP passwordt   helps   web.html(   t   servicest   ParamsManagert   dictR2   (   Rã   t   pm(    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   createDownloadPM×  s>    	*
:	(   t   __doc__R.   R;   t   PyQt4R    R   RZ   R   R   R   RQ   R•   Rœ   Rç   (    (    (    s>   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/qtgui/downloadPdb.pyt   <module>   s   	Qfb�