
:\c           @ s0  d  Z  d d l m Z m Z m Z m Z d d l Z d d l Z d d l m	 Z	 m
 Z
 m Z m Z m Z d d l m Z m Z d d l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z d d l m Z d d l m  Z  d d	 l! m" Z" m# Z# d d
 l$ m% Z% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ m, Z, d d l- m. Z. d e) f d     YZ/ d e) f d     YZ0 d e( f d     YZ1 d e% f d     YZ2 d d  d     YZ3 d e* f d     YZ4 d e f d     YZ5 d e f d     YZ6 d e. f d     YZ7 d   Z8 e9 d k r,e8   n  d S(!   s   Conda channel selector dialog.i    (   t   absolute_importt   divisiont   print_functiont   with_statementN(   t   QEventt   QRegExpt   QSizet   Qtt   Signal(   t   QKeySequencet   QRegExpValidator(   t   QAbstractItemViewt   QActiont   QApplicationt   QFramet   QHBoxLayoutt   QListWidgett   QListWidgetItemt   QMenut   QProgressBart   QSizePolicyt   QVBoxLayout(   t   AnacondaAPI(   t   path_is_writable(   t   SASS_VARIABLESt   load_style_sheet(   t   ButtonDangert   ButtonNormalt   ButtonPrimaryt	   FrameBaset	   LabelBaset   LineEditBaset   SpacerHorizontalt   SpacerVertical(   t
   DialogBaset   LabelConfigLocationc           B s   e  Z d  Z RS(   s,   Label displaying the configuration location.(   t   __name__t
   __module__t   __doc__(    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR#   *   s   t   LabelChannelInfoc           B s   e  Z d  Z RS(   s%   Label displaying channel information.(   R$   R%   R&   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR'   .   s   t   FrameChannelsc           B s   e  Z d  Z RS(   s   Frame used in CSS styling.(   R$   R%   R&   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR(   2   s   t   ButtonRemoveChannelc           B s    e  Z d  Z e   Z d   Z RS(   s"   Button that emits signal on focus.c         C s'   t  t |   j |  |  j j   d S(   s   Override Qt method.N(   t   superR)   t   focusInEventt   sig_focusedt   emit(   t   selft   event(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR+   ;   s    (   R$   R%   R&   R   R,   R+   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR)   6   s   	t
   WorkerMockc           B s    e  Z d  Z d d d d  Z RS(   s6   Worker mock to handle `defaults` channel special case.c         C s   | |  _  | |  _ | |  _ d S(   s6   Worker mock to handle `defaults` channel special case.N(   t   itemt   urlt   repodata_url(   R.   R1   R2   R3   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   __init__F   s    		N(   R$   R%   R&   t   NoneR4   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR0   C   s   t   LineEditChannelc           B sb   e  Z d  Z e d  Z e   Z e   Z e   Z d   Z	 d   Z
 d   Z d   Z d   Z RS(   s  
    Custom line edit that uses different validators for text and url.

    More info:
    http://conda.pydata.org/docs/config.html#channel-locations-channels

    Valid entries:
    - defaults  <- Special case
    - <some-channel-name>
    - https://conda.anaconda.org/<channel>/<package>
    - https://conda.anaconda.org/t/<token>/<package>
    - http://<some.custom.url>/<channel>
    - https://<some.custom.url>/<channel>
    - file:///<some-local-directory>
    s1   ^[A-Za-z][A-Za-z0-9_-]+$|^https?://.*|^file:///.*c         O sg   t  t |   j | |   t |  j  |  _ t d |   |  _ |  j |  j  |  j	 t
 j t
 j  d S(   sA   Custom line edit that uses different validators for text and url.t   parentN(   R*   R6   R4   R
   t   VALID_REt
   _validatorR   t   menut   setValidatort   setSizePolicyR   t	   Expanding(   R.   t   argst   kwargs(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR4   h   s
    c         C sf   | j    t j k rL | j   t j @rL |  j   rL |  j | j    t	 St
 t |   j |  Sd S(   s   Override Qt method.N(   t   typeR   t   MouseButtonPresst   buttonsR   t   RightButtont	   isEnabledt	   show_menut   post   TrueR*   R6   R/   (   R.   R/   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR/   p   s
    c         C s   | j    } | j t j  r\ t j   } | j   } |  j j |  r |  j	 |  d SnJ | t
 j t
 j g k r |  j j   n" | t
 j g k r |  j j   n  t t |   j |  d S(   s   Override Qt method.N(   t   keyt   matchesR	   t   PasteR   t	   clipboardt   textR8   t
   exactMatcht   setTextR   t
   Key_Returnt	   Key_Entert   sig_return_pressedR-   t
   Key_Escapet   sig_escape_pressedR*   R6   t   keyPressEvent(   R.   R/   RH   RK   RL   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyRT   y   s    c         C so   |  j  j   t d |  j   } | j j |  j  |  j  j |  |  j  j t  |  j  j	 |  j
 |   d S(   s    Show copy menu for channel item.s   &CopyN(   R:   t   clearR   t	   triggeredt   connectt	   copy_textt	   addActiont
   setEnabledRG   t   exec_t   mapToGlobal(   R.   RF   t   copy(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyRE      s    c         C s0   t  j   } | j |  j    |  j j   d S(   s   Copy channel text to clipboard.N(   R   RK   RN   RL   t
   sig_copiedR-   (   R.   RK   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyRX      s    (   R$   R%   R&   R   R8   R   RQ   RS   R^   R4   R/   RT   RE   RX   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR6   M   s   										t   ListWidgetItemChannelc           B s5   e  Z d  Z d d d  Z d   Z e d    Z RS(   s4   Conda channels list widget item used in CSS styling.c         C sB  t  t |   j   | r | n d |  _ | r4 | n d |  _ t   |  _ t |  |  _ t	   |  _
 t   |  _ t   |  _ |  j j t |   |  j
 j |  t   } | j |  j
  | j |  j  |  j j |  t   } | j |  | j   | j |  j  | j |  j  |  j j |  |  j |  j    d S(   s4   Conda channels list widget item used in CSS styling.t    N(   R*   R_   R4   t   channelt   locationR(   t   widgetR#   t   label_locationR6   t   text_channelR'   t
   label_infoR)   t   button_removet
   setVisibleR   RN   R   t	   addWidgett
   setToolTipR   t	   addLayoutt
   addStretcht	   setLayoutt   setSizeHintt   widget_size(   R.   Ra   Rb   t   layout_namet   layout_frame(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR4      s*    		
c         C s!   |  j  j |  |  j  j   d S(   s/   Set the editable status of the channel textbox.N(   Re   RZ   t   setFocus(   R.   t   value(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   set_editable   s    c           C s   t  t j t j  S(   s)   Return the size defined in the SASS file.(   R   R   t   WIDGET_CHANNEL_TOTAL_WIDTHt   WIDGET_CHANNEL_TOTAL_HEIGHT(    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyRo      s    N(   R$   R%   R&   R5   R4   Rt   t   staticmethodRo   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR_      s   	t   ListWidgetChannelsc           B s   e  Z d  Z e e  Z e e  Z e e  Z e   Z	 e e e e e  Z
 e   Z d d d d d d  Z d   Z d   Z d   Z d d  Z d	   Z d
   Z e d d   Z d   Z d   Z e d    Z RS(   s   Conda channels list widget.s   https://anaconda.orgs   https://api.anaconda.orgs   https://conda.anaconda.orgc         C s   t  t |   j |  g  |  _ | |  _ | |  _ | |  _ | |  _ d |  _	 t
 |  _ |  j d  |  j t j  |  j t j  |  j t j  |  j t j  |  j t j  |  j t j  |  j t  d S(   s   Conda channels list widget.Rx   N(   R*   Rx   R4   t   _itemst   apit   api_urlt   main_urlt	   conda_urlR5   t   style_sheett   Falset   repeat_errort   setObjectNamet   setResizeModeR   t   Adjustt   setMovementt   Statict   setFrameStylet   Plaint   setSelectionModeR   t   NoSelectiont   setViewModet   ListModet   setFocusPolicyR   t   NoFocust   setUniformItemSizesRG   (   R.   R7   Rz   R|   R{   R}   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR4      s     								c          sF  t  t   j     j     j    j j j    f d      j j j    f d      j	 j
 j    f d      j	 j j d    f d     j j   j   st  _  j     j t    j j j  j    j	 j t  n t  _  j j      j j   j    j j t  d S(   sN   
        Override Qt method.

        Add a content item to the list.
        c            s    j     S(   N(   t   validate_channel(    (   R1   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   <lambda>   R`   c            s    j     S(   N(   t   escape_pressed(    (   R1   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     R`   c            s    j     S(   N(   t   remove_channel(    (   R1   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     R`   c          s    j     S(   N(   t	   fix_focus(   t   v(   R1   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     R`   N(   R*   Rx   t   addItemt   setItemWidgetRc   Re   RQ   RW   RS   Rg   t   clickedR,   R5   Ra   t   stript   lowerRG   t
   is_editingt   scrollToBottomRt   t
   textEditedt   check_repeatRh   R   Ry   t   appendRj   Rf   t   setDisabled(   R.   R1   (    (   R1   R.   sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR      s&    	
	c         C s   |  j  |  j   d  d S(   s2   Handle cancelation of ongoing new channel editing.i   N(   t   takeItemt   count(   R.   R1   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     s    c         C s0   |  j  j |  } |  j |  |  j j   d S(   s4   Set the current row based on focus of child widgets.N(   Ry   t   indext   setCurrentRowt   sig_focus_fixedR-   (   R.   R1   t   row(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     s    c         C s   | d k r t   |  _ n	 | |  _ xq |  j D]f } yL |  j |  } | j |  j  | j j j |  j  | j | j	    Wq. t
 k
 r q. Xq. W|  j   |  j   d S(   s   Update custom CSS style sheet.N(   R5   R   R~   Ry   t
   itemWidgett   setStyleSheetRe   R:   Rn   Ro   t	   Exceptiont   updatet   repaint(   R.   R~   R1   t   item_widget(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   update_style_sheet!  s    	
c         C sX   | |  j  k rT |  j  j |  } |  j |  |  j  j |  |  j j | j  n  d S(   s   Remove the selected channel.N(   Ry   R   R   t   removet   sig_channel_removedR-   Ra   (   R.   R1   R   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   5  s
    c         C sC  |  j  t  | j } | r | j t  | j | _ | j j | j  | j j | j  | j j	 t
  |  j |  |  j j |  |  j j | j  |  j j t
  |  j |  j  |  j j d d d d  n[ d j | j  } |  j j d d d d  | j t
  |  j | d | |  j j t  |  j j   d S(   s$   Callback for channel url validation.R`   s(   <b>{0}</b> is not a valid conda channel.s   Invalid channelRL   N(   R   R   R1   Rt   Ra   Re   RN   Rj   Rg   Rh   RG   t   show_tool_tipRy   R   t   sig_channel_addedR-   t   sig_channel_statusR   R~   t   sig_status_updatedR5   t   formatR2   t   sig_channel_checked(   R.   t   workert   validt   errorR1   RL   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   _channel_url_validated=  s*    	R`   c         C s-   |  j  } | j |  | j t |   d S(   s"   Set the tooltip in case of errors.N(   Rf   Rj   RZ   t   bool(   R1   RL   Rc   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   Y  s    	c         C s   g  } xM |  j  j   D]< \ } } x- | D]% } | j   } | j | | f  q) Wq W| j   j   } |  j j j | f } | | k |  _ d S(   s:   Check that given channel (text) and source is not in list.N(	   t   sourcest   itemsR   R   R   Rz   t
   _conda_apit   user_rc_pathR   (   R.   RL   t   comparet   sourcet   channelsRa   t   lower_channelt   current_compare(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   `  s    c   	      C s  | j  j   j   } |  j j d d d d  | | _ |  j r |  j | d d j |  t	 d | d d d d  } | | _ |  j
 | t d  nP| r| d	 k r g  } t	 d | d | d |  } | | _ |  j
 | t d  S| j d  r0| j |  j  r'| j |  j |  j  } | } q| } n | j d  rg  } t	 d | d | d |  } | | _ t j d k r| j d d  } n | j d d  } t j j |  } |  j
 | | d  Sd j |  j |  } | d d k r| d  n | } |  j j   } d j | | d  } |  j j |  } | j j |  j
  | | _ | | _ | | _ | | _ |  j t  |  j |  nc |  j | d d |  j j d d d d  t	 d | d d d d  } | | _ |  j
 | t d  d S(   s.   Validate entered channel with current api url.s   Validating channel...R`   i    RL   s&   Channel <b>{0}</b> is in list already.R1   R2   R3   t   defaultss   https://s   http://s   file:///t   nts   file://s   {0}/{1}it   /s   {0}/{1}/{2}s   repodata.jsons   Channel cannot be empty.s   Channel cannot be emptyN(   s   https://s   http://(   Re   RL   R   R   R-   Ra   R   R   R   R0   R   R   R5   RG   t
   startswithR|   t   replaceR}   t   ost   namet   patht   isdirRz   t   conda_platformt   download_is_valid_urlt   sig_finishedRW   R1   R2   R3   R   (	   R.   R1   Ra   R   R2   R   R   t   platR3   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   l  sf    		
					 						c         C s   g  |  j  D] } | j ^ q
 } i  } x' | D] } | | k r, g  | | <q, q, Wx4 |  j  D]) } | j } | j } | | j |  qY W| S(   s   Return the channels.(   Ry   Rb   Ra   R   (   R.   R1   R   t   config_sourcesR   Rb   Ra   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     s    		N(   R$   R%   R&   R   t   objectR   R   R   R   R   R   R   R5   R4   R   R   R   R   R   R   Rw   R   R   R   t   propertyR   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyRx      s.   			"						Gt   DialogChannelsc           B s   e  Z d  Z e e e  Z e   Z e   Z d Z d d  Z
 e d    Z d   Z d d  Z d   Z d   Z d   Z d	   Z d
   Z e d  Z d d d d d  Z e d    Z RS(   s>   Dialog to add delete and select active conda package channels.i&  c          s  t  t    j |  |   _ d   _ t     _ d   _ d   _	 d   _
 t   _ t   _ t d   d   j    _ t d    _ t d    _ t      _ t d    _ t d    _ t d    _   j j t    j j t j    j j t j    j    j!   t" j# B   j$ d	    j% d
    j&   j'    j( t)  t*   } | j+   j  | j,   | j+   j  t*   } | j+   j  | j+ t-    | j+   j  | j+ t-    | j,   | j+   j  | j+ t-    | j+   j  t.   } | j/ |  | j+ t0    | j+   j  | j+ t0    | j+ t0    | j/ |    j1 |    j j2 j3   j4    j j2 j3   j5    j j2 j3   j6    j j7 j3   j8    j j9 j3 d   f d     j j9 j3 d   f d     j j: j3 d   f d     j j: j3 d   f d     j j; j3   j<    j j= j3   j>    j j? t)    j j? t)    j j? t)    j8 d d d d d d  d S(   s?   Dialog to add delete and select active conda pacakge channels .s   https://conda.anaconda.orgR7   Rz   s.   Manage channels you want Navigator to include.s   Collecting sources...s   Add...t   Cancels   Update channelsgQ?i,  c          s
     j    S(   N(   t   set_tab_order(   R   (   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     R`   c          s     j  j   S(   N(   t	   button_okRr   (   R   (   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     R`   c          s
     j    S(   N(   R   (   R   (   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     R`   c          s     j  j   S(   N(   R   Rr   (   R   (   R.   (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     R`   t   actionRs   i    t	   max_valueN(@   R*   R   R4   t   _parentt
   _conda_urlR   Rz   R5   t   initial_sourcesR   R~   R   t   _setup_readyt   _conda_url_setup_readyRx   t   listR   Rf   t   label_statusR   t   progress_barR   t
   button_addt   button_cancelR   R   t   frame_title_barRh   R   R   t   NoFramet   setFrameShapet   setWindowFlagst   windowFlagsR   t   Popupt   setWindowOpacityt   setMinimumHeightt   setMinimumWidtht   WIDTHt   setModalRG   R   Ri   Rl   R    R   Rk   R!   Rm   R   RW   t   add_channelt   update_channelst   rejectR   t   update_statusR   R   R   t   sig_check_readyR   t   refreshR   (   R.   R7   t   layout_buttont	   layout_okt   layout(    (   R.   sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR4     s    								
	
		c         C sK   g  } x> |  j    D]0 \ } } x! | D] } | j | | f  q& Wq W| S(   s   
        Flatten sources and channels dictionary to list of tuples.

        [(source, channel), (source, channel)...]
        (   R   R   (   R   t   groupedR   R   Ra   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   _group_sources_and_channels   s
    c         C sT   | j    } | t j g k rP |  j j rC |  j   t |  j _ qP |  j   n  d S(   s   Override Qt method.N(   RH   R   RR   R   R   R   R   R   (   R.   R/   RH   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyRT   -  s    
c         C sp   | d k r t   |  _ n	 | |  _ |  j |  j  |  j t j  y |  j j |  Wn t	 k
 rk n Xd S(   s   Update custom css style sheets.N(
   R5   R   R~   R   R   R   t   WIDGET_CHANNEL_DIALOG_WIDTHR   R   R   (   R.   R~   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   9  s    	c         C s;   | j  d d  |  _ t |  _ |  j r7 |  j j   n  d S(   s   Update api info.R}   s   https://conda.anaconda.orgN(   t   getR   RG   R   R   t   sig_setup_readyR-   (   R.   R   t   api_infoR   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt
   update_apiH  s
    		c   	      C s  | j  d  |  _ |  j j t  xr |  j j   D]a \ } } | j  d g   } x@ | D]8 } t d | d |  } | j t  |  j j	 |  qW Wq2 W|  j
   |  j j   |  j j t  |  j j t  |  j j j   |  _ |  j   t |  _ |  j r|  j j   n  d S(   s   Setup the channels widget.R   R   Ra   Rb   N(   R   R   R   R   R   R   R_   Rt   R   R   R   Rr   R   t
   setDefaultRG   R   RZ   R   R]   R   R   R   R   R   R-   (	   R.   R   t   conda_config_dataR   R   t   dataR   Ra   R1   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   setupR  s"    

		c         C ss   |  j  j rO |  j |  j |  j  j d j  |  j |  j  j d j |  j  n  |  j |  j |  j  |  j   d S(   s!   Fix the tab ordering in the list.i    iN(   R   Ry   t   setTabOrderR   Rg   R   R   R   (   R.   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   j  s    c         C sE   |  j  j j } t d d d |  } |  j j |  |  j t  d S(   s   Add new conda channel.Ra   R`   Rb   N(   Rz   R   R   R_   R   R   R   R   (   R.   R   R1   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   w  s    c         C ss   |  j  j } |  j |  j  } |  j |  } t |  t |  k re |  j j |  j   |  j   n
 |  j   d S(   s    Update channels list and status.N(	   R   R   R   R   t   sortedt   sig_channels_updatedR-   t   acceptR   (   R.   R   t   originalt   updated(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR   ~  s    c         C s~   |  j  j | o t |  j j   |  j j |  |  j j t  |  j j   d k rz |  j  j t  |  j j t  n  d S(   s1   Update enable/disable status based on item count.i    N(	   R   RZ   R   R   R   R   R   RG   R   (   R.   t   channel_status(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     s    "R`   c         C s   t  |  } |  j j |  |  j j |  | d k	 rz | d k	 rz |  j j t  |  j j d |  |  j j |  n |  j j t	  d S(   s1   Update the status and progress bar of the widget.i    N(
   R   R   RN   Rh   R5   R   RG   t   setRanget   setValueR   (   R.   R   t   messageRs   R   t   visible(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     s    c         C s]   |  j  |  j  } |  j  |  j j  } t |  } t |  } | | } | | } | | f S(   s-   Return sources to add and remove from config.(   R   R   R   R   t   set(   R.   R  R  t   addR   (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     s    

N(   R$   R%   R&   R   R   R  R   R   R   R5   R4   Rw   R   RT   R   R   R  R   R   R   RG   R   R   R   R   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyR     s"   		U		
				
c          C s   d d l  m }  d d l m } |    } t   } t d  } | j |    | j   | j	   } | j
   } | j j | j  | j j | j  t j | j    d S(   s   Run local test.i    (   t   qapplication(   R   N(   t"   anaconda_navigator.utils.qthelpersR  t   anaconda_navigator.utils.stylesR   R   R   R5   R   t   showt   conda_config_sourcest   api_urlst   sig_chain_finishedRW   R  R   t   syst   exitR[   (   R  R   t   appRz   Rc   R   t   worker_2(    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt
   local_test  s    		
t   __main__(    (:   R&   t
   __future__R    R   R   R   R   R  t   qtpy.QtCoreR   R   R   R   R   t
   qtpy.QtGuiR	   R
   t   qtpy.QtWidgetsR   R   R   R   R   R   R   R   R   R   R   t#   anaconda_navigator.api.anaconda_apiR   t   anaconda_navigator.utils.miscR   R  R   R   t   anaconda_navigator.widgetsR   R   R   R   R   R   R    R!   t"   anaconda_navigator.widgets.dialogsR"   R#   R'   R(   R)   R0   R6   R_   Rx   R   R  R$   (    (    (    sJ   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/channels.pyt   <module>   s.   "(L:
P0	