
    Mgj	                     ~    S SK r S SKJrJrJr  S SKJr  \" SS9\" S5      \" S5       " S S	5      5       5       5       rg)
    N)pluginaliasrequire)ForeT)networkforecastzweather reportc                   B    \ rS rSrSrSSS\SS4S jrSS	 jrSS
 jrSr	g)WeatherReport   zThe user will input a location as a string, and the WeatherDB database will be used to make a GET request and
fetch data. Then, the user can see the weather forecast for the upcoming week if they wish. jarvis	JarvisAPIsreturnNc                 &    U R                  U5        g )N)print_weather)selfr   r   s      D/Users/admin/workspace/ai/Jarvis/jarviscli/plugins/weather_report.py__call__WeatherReport.__call__   s    6"    c                 `   UR                  S5        UR                  S5        UR                  S5      nUR                  5       n[        R                  " SU-   5      nUR                  5       nSU;   a(  US   S:X  a  UR                  S[        R                  S9  g UR                  S	[        R                  5        UR                  US
   S-   5        UR                  S[        R                  5        UR                  US   S   S-   5        UR                  S[        R                  5        UR                  [        US   S   S   5      S-   5        UR                  S[        R                  5        UR                  [        US   S   5      S-   5        UR                  S[        R                  5        UR                  [        US   S   5      S-   5        UR                  S[        R                  5        UR                  [        US   S   S   5      S-   5        U R                  X5        g )NzWhat city are you located in?z6(Only type the city name, not country/province/state.)zEnter city name: z.https://weatherdbi.herokuapp.com/data/weather/statusfailzInvalid location entered!colorz
Location: regionz, zApprox.time: currentConditionsdayhourzTemperature: tempcz	 deg. C, zPrecipitation: precipz
Humidity: humidityzWind: windkmz km/h)sayinputlowerrequestsgetjsonr   REDBLUEstrask_for_forecast)r   r   locxys        r   r   WeatherReport.print_weather   s   

23

KLll./iikLLICOPFFHq=Qx[F2JJ2$((JCJJ|TYY/JJq{T)*JJ		2JJq,-i84?@JJ		2JJs101&9#>?+MNJJ($))4JJs101(;<tCDJJ|TYY/JJs101*=>EFJJx+JJs101&9$?@7JK!!&,r   c                    UR                  S5      nUR                  5       nUS:X  at  US    Hj  nUR                  US   S-   [        R                  5        UR                  US   S-   [        US   S	   5      -   S
-   [        US   S	   5      -   S-   5        Ml     g US:X  a  UR                  S5        g UR                  S[        R                  S9  g )NzBWould you like to see the weather forecast for the next week? Y/N r1   	next_daysdayz: commentz, with a min. temp. of min_tempr    z deg. C and a max.temp. of max_tempz deg. C.nzThank you! Goodbye.zInvalid input.r   )r&   r'   r%   r   r,   r-   r+   )r   r   jasonselected_daysps        r   r.   WeatherReport.ask_for_forecast(   s    %ij%++-C;'

1U8d?DII6

1Y<*CCc!J-X[J\F]]89;>q}S?Q;RSU_` a ( c!JJ,-JJ'txxJ8r    )r   r   )
__name__
__module____qualname____firstlineno____doc__r-   r   r   r.   __static_attributes__r>   r   r   r
   r
      s,    d#{ #s #t #-09r   r
   )r(   r   r   r   coloramar   r
   r>   r   r   <module>rF      sJ     ) )  	z*9 *9   *9r   