
    Mg.	                     >    S SK r S SKrS SKJr  S SKJr  SSKJr  S rg)    N)Fore)WeekDay   )mappsc           	      *  ^ / SQmUR                  5       R                  5       nSR                  [        U4S jU5      5      R                  5       n[        R
                  " 5       nU(       d  SR                  US   US   5      nUS   nSS	S
.nUS:X  a  SSS
.nSR                  USUS   5      n[        R                  " U5      n[        R                  " UR                  5      n	[        5       R                  5       n
 U R                  SR                  U	S   S   R                  5       5      [         R"                  5        [%        U 5        U R                  S5        ['        U	S   5       H  u  pU R                  SR                  X   5      [         R"                  5        U R                  SR                  US   S   S   5      [         R"                  5        U R                  SR                  [)        US   S   S5      US   5      [         R"                  5        U R                  SR                  [)        US   S    S5      US   5      [         R"                  5        M     g ! [*         a#    U R                  S![         R,                  5         g f = f)"N)checkweatherforecastinforaweek c                 *   > U R                  5       T;  $ )N)lower)wordcmd_key_wordss    ?/Users/admin/workspace/ai/Jarvis/jarviscli/packages/forecast.py<lambda>main.<locals>.<lambda>   s    DJJL&3-4    z{},{}citycountry_codecountry_namemetricu   ºC)	url_units	str_unitszUnited Statesimperialu   ºFzthttp://api.openweathermap.org/data/2.5/forecast/daily?q={0}&cnt={1}&APPID=ab6ec687d641ced80cc0c935f9dd8ac9&units={2}7r   z+Weather forecast in {} for the next 7 days.nameTESTlistz{}:z	Weather: {}r	   r   mainz	Max temperature: {} {}tempmaxr   r   z	Min temperature: {} {}
minz,The forecast information could not be found.)stripsplitjoinfilterr   get_locationformatrequestsgetjsonloadstextr   get_week_from_todaysaytitler   BLUEprint	enumerateroundKeyErrorRED)jarviss	cmd_wordslocationcurrent_locationcountryunitssend_urlrjweek_from_todaycntday_dictr   s                @r   r#   r#      sV   NM	!Ixx  45>@ AAF  ))+ >>V$&6~&FH~.G E
 /!#
	<<BFc5-=/  	XA

166Ai335OM

9@@&	&!'') II		
 	f

6&qy1MCJJu||O$89499EJJ--#A&v.015<JJ*11(6*5115u[7IK		
 JJ,33(6*5115u[7IK 			 2  M

A488LMs   ?E%I% %*JJ)	r/   r-   coloramar   utilities.dateTimer    r   r#    r   r   <module>rL      s       & ?Mr   