
    Mg@                     N    S SK r S SKJr  S SKJr  \" S5       " S S5      5       rg)    N)Fore)plugintempconvc                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
Tempconv   zn
Convert temperature from Fahrenheit to Celsius and vice versa
Examples: 32f, 18C, -20F, -8c, 105.4F, -10.21C
c                     U R                  U5      (       a  U R                  X5        g UR                  S[        R                  5        g )Nz@I'm sorry, invalid input. Please see "help tempconv" for syntax.)temp_valid_regextemp_convertsayr   RED)selfjarvisss      ?/Users/admin/workspace/ai/Jarvis/jarviscli/plugins/temp_conv.py__call__Tempconv.__call__   s9      ##f( JJT    c                 >    [         R                  " SU5      (       a  gg)zGValidate the input string using regex and return a boolean for validityz^-?\d+(\.\d+)?[FfCc]$TF)research)r   r   s     r   r
   Tempconv.temp_valid_regex   s    99/33r   c                    [        USS 5      nUS   R                  5       S:X  a#  U R                  U5      nSR                  X45      nO"U R	                  U5      nSR                  X45      nUR                  U[        R                  5        g)zIAssuming valid regex, handle the actual temperature conversion and outputNfu   {}° F is {}° Cu   {}° C is {}° F)floatlowerconvert_f_to_cformatconvert_c_to_fr   r   BLUE)r   r   r   starting_tempnew_tempoutputs         r   r   Tempconv.temp_convert    s{     af R5;;=C**=9H'..}GF**=9H'..}GF 	

6499%r   c                 ,    [        US-
  S-  S-  S5      $ )z"Convert from Fahrenheit to Celsius       	      roundr   r"   s     r   r   Tempconv.convert_f_to_c1   s    }r)Q.2Q77r   c                 ,    [        US-  S-  S-   S5      $ )z"Convert from Celsius to Fahrenheitr)   r(   r'   r*   r+   r-   s     r   r    Tempconv.convert_c_to_f5   s    ma'!+b0155r    N)__name__
__module____qualname____firstlineno____doc__r   r
   r   r   r    __static_attributes__r1   r   r   r   r      s     
	&"86r   r   )r   coloramar   r   r   r1   r   r   <module>r9      s,    	   
/6 /6 /6r   