
    Mg                     J    S SK JrJr  S SKJr  \" S5       " S S5      5       rg)    )BackStyle)pluginbmic                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
Bmi   a  
Welcome to the Body Mass Index plugin documentation! Here you can find all the functionalitites
of this plugin.
Usage: Type bmi, press enter and follow the instructions
Functionalities: You can calculate your BMI both on metric and imperial system.
For metric system: Type your height in centimetres and the your weight in kilos,
    they should be both Integers!
For imperial system: Type your height in feets and inches and then your weight in lbs
    all measurements should be Integers!
Find out your BMI number and your body state.
c                    UR                  S5        U R                  U5      nUS:X  a$  U R                  " S/U R                  US5      Q76 nO+US:X  a$  U R                  " S/U R                  US5      Q76 nOg U R	                  X5        g )NzWelcome. Lets check your BMImetricmimperiali)say
get_systemcalc_bmiask_measurementsprint_body_state)selfjarvisssystemr   s        9/Users/admin/workspace/ai/Jarvis/jarviscli/plugins/bmi.py__call__Bmi.__call__   s~    

12(X--Id&;&;FC&HICz!--Id&;&;FC&HICf*    c                 p   SSS.nUR                  S5        UR                  S5        UR                  S5        [        5         SnSnU(       dN   [        U5        [        [        S	5      5      n[        5         US
:w  a  UR	                  US5      $ SnU(       d  MM  gg! [
         a    [        S5         N"f = f)z3
Asks user to choose which system they want to use
r   r   )      z;Metric system: Type your height in centimeter, weight in kgzAImperial system: Type your height in ft and inches, weight in lbsz=All measurements should be Integers. Default is Metric systemzaPlease choose the system you would like to use. 
 1: Metric system 
 2: Imperial system 
 3: ExitFzYour choice:    Tz&Invalid Input. Please Enter the numberN)r   printintinputget
ValueError)r   r   systpromptvalid_inputcs         r   r   Bmi.get_system   s     
+

PQ

VW

RSw@fo./688Ax00" +  @>?@s   A B B B54B5c                 t    US:X  a  US-  nSU-  US-  -  nOUS:X  a  SU-  US-  -  S-  n[        WS5      nU$ )zD
Calculates the bmi for metric system using the common bmi function
r   g      Y@g      ?r   r   i  r   )round)r   r   heightweightr   s        r   r   Bmi.calc_bmi5   sT     S=e^F,1,Cs],1,s2CCm
r   c                    [        S[        U5      5        US:  a;  [        [        R                  S[        R
                  5        UR                  S5        gUS:  a;  [        [        R                  S[        R
                  5        UR                  S5        gUS:  a;  [        [        R                  S[        R
                  5        UR                  S5        gUS	:  a;  [        [        R                  S[        R
                  5        UR                  S
5        g[        [        R                  S[        R
                  5        UR                  S5        g)zf
According the bmi number, print_body_state finds out the state of the body
and prints it to the user
zBMI:   z  zSevere thinnessg     2@zMild thinness   Healthy   z	Pre-obeseObeseN)	r    strr   REDr   	RESET_ALLr   YELLOWGREEN)r   r   r   s      r   r   Bmi.print_body_stateA   s    
 	fc#h8$((GU__5JJ()4Z$++w8JJ'2X$**gu7JJy!2X$++w8JJ{#$((GU__5JJwr   c                    US:X  a  UR                  S5        UR                  5       n  [        U5      nUS::  a  [        S5      e UR                  S5        UR                  5       n  [        U5      nUS::  a  [        S5      e X44$ UR                  S5        UR                  5       n  [        U5      nUS:  a  [        S	5      e UR                  S5        UR                  5       n  [        U5      nUS:  a  [        S5      e UR                  S5        UR                  5       n  [        U5      nUS:  a  [        S5      e [        U5      S-  [        U5      -   n[        U5      nX44$ ! [         a    [	        S5        UR                  5       n Of = fGMw  ! [         a    [	        S5        UR                  5       n Of = fGMe  ! [         a    [	        S
5        UR                  5       n Of = fGMP  ! [         a    [	        S5        UR                  5       n Of = fGM>  ! [         a    [	        S5        UR                  5       n Of = fGM,  )zA
Asks user to input their measurements according to their units.
r   z)Please insert your height in centimeter: r   zPlease only positive numbersz#Please, insert a positive integer: z!Please insert your weight in kg: z:Error on input type for weight, please insert an integer: z!Please insert your height in ft: zPlease only positive numbers!z8Error on input type for feet, please insert an integer: z%Please insert your height in inches: z:Error on input type for inches, please insert an integer: z"Please insert your weight in lbs:    )r   r"   r!   r$   r    )r   r   r   r,   r-   feetinchess          r   r   Bmi.ask_measurementsW   sV    8JJBC\\^F, [F{()GHH JJ:;\\^F, [F{()GHHP ~G JJ:;<<>D*t9Dax()HII JJ>?\\^F, [Fz()GHH JJ;<\\^F, [Fz()GHH Y^c&k1F[F~e " ,?@#\\^F, " " ,VW#\\^F, $ " *TU!<<>D* " " ,VW#\\^F, " " ,VW#\\^F, sY   E2 *F  -G -G< -H* 2%FF %GG%G65G6<%H$#H$*%II N)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   __static_attributes__r@   r   r   r   r      s!    
	+@,
 ,?r   r   N)coloramar   r   r   r   r@   r   r   <module>rH      s+       O O Or   