
    Mg                     X    S SK r S SKJrJr  \" SS9\" S5       " S S5      5       5       rg)    N)requirepluginT)networksearchc                   0    \ rS rSrSrS rS rS rS rSr	g)	Search   ar  
The 'search' command launches a browser search
for the entered keywords.

To search in a new tab in an existing browser window, write:
'search new_tab <keywords>'
(If there is no existing window, new window is opened.)

{Just write the keywords as you would in the google search bar.}

Examples:
> search how to clone a github repository
> search new_tab linux distros
c                 ~    X l         SU l        U R                  5         U R                  5         U R	                  5         g )NT)commandnew_tabcheck_new_tabcreate_linkopen_browser)selfjarvisss      </Users/admin/workspace/ai/Jarvis/jarviscli/plugins/search.py__call__Search.__call__   s2        c                     SU R                   ;   a6  U R                   R                  SS5      U l        U R                  S   U l        g U R                   U l        SU l        g )Nr       F)r   splitinputskeyword_strr   r   s    r   r   Search.check_new_tab   sI    $,,,,S!4DK#{{1~D#||D DLr   c                     SU l         U R                  R                  SS5      R                  5       U l        U R                   U R                  -   U l        g )Nz https://www.google.com/search?q=r   +)defaultr   replacestripkeywordslinkr   s    r   r   Search.create_link&   s@    9((00c:@@BLL4==0	r   c                     U R                   SL a!  [        R                  " U R                  5        g [        R                  " U R                  5        g )NF)r   
webbrowseropen_newr%   open_new_tabr   s    r   r   Search.open_browser,   s4    <<5 		* ##DII.r   )r   r!   r   r   r$   r%   r   N)
__name__
__module____qualname____firstlineno____doc__r   r   r   r   __static_attributes__ r   r   r   r      s    !1/r   r   )r(   r   r   r   r2   r   r   <module>r3      s6     " 	+/ +/  +/r   