
    Mg                     :    S SK J r   \ " S5       " S S5      5       rg)    )plugintimeconvc                   n    \ rS rSrSr/ SQrSSSSSS	S
SSSSS.rSSSSSSSSSSS.
rS rS r	S r
S rSrg)r      a  
timeconv Documentation.
timeconv is a time converter.
Supports: picosecond, nanosecond, microsecond, millisecond, second, minute, hour, day, week, month, year
Usage: The input time measurement units are:
    ps : picosecond,
    ns : nanosecond,
    mum : microsecond,
    mm : millisecond,
    s : second,
    min : minute,
    h : hour,
    d : day,
    wk : week,
    mon : month,
    yr : year

    First you will be asked to enter the amount you want to convert.
    Second you will be asked to enter the time measurement unit of the amount.
    And then you will be asked to enter to which time measurement unit you want to convert.
)yrmonwkdhminsmsmusnsps
picosecond
nanosecondmicrosecondmillisecondsecondminutehourdayweekmonthyear)r   r   r   r   r   r   r   r
   r	   r   r      g[yd@      <   i  )
yr2monmon2wkwk2dd2hh2minmin2ss2msms2musmus2nsns2psc                     UR                  S5      nU R                  US5      nU R                  US5      nXE:w  a  OUR                  S5        MN  U R                  XXE5      nSnUR	                  5       SL aA  UR                  S5      n UR	                  5       (       a  US::  a  OUR                  S	5      nM/  [        U[        U5      5      nU R                  X6XE5      nUR                  U5        g )
NzEnter an amount: zEnter from which unit: zEnter to which unit: zPlease enter different unitsr   Fz!Please enter precision (max:12): r   z"Please enter an integer (max:12): )input_number	get_unitssaytime_convert
is_integerroundint	txt_build)	selfjarvisr   amount	from_unitto_unit
convamount	precision
outputTexts	            >/Users/admin/workspace/ai/Jarvis/jarviscli/plugins/timeconv.py__call__timeconv.__call__;   s    (()<=Fv/HIInnV-DEG$

9:  &&vyJ
	!!#u,++,OPI((**yB & 3 34X YI	  :s9~6
^^F	K


:    c                    [        [        U R                  5      5       H/  nU R                  U   U:X  a  UnU R                  U   U:X  d  M-  UnM1     WW-
  S:  a  SnXv-
  S:  a  SnUn	UnU	nSn
U
n[        XgS5       HE  nU R                  U   S-   U R                  US-      -   nXR                  R	                  U5      -  n
MG     [        U
S5      nW(       a	  SU
-  U-  nOX-  n[        US5      nU$ )Nr   FT   2   r   )rangelen
time_units
units_datagetr1   )r4   r5   r6   frtoistartendreversetmp
multiplierr9   kbuild
mulitpliers                 r<   r/   timeconv.time_convertW   s   s4??+,A"b("b( - 5[AG[AGCEC

u1%A__Q'#-A0FFF#oo&9&9&&AAJ & :r*
j.F2J#,J:r*
r?   c                 l     UR                  U5      R                  5       nX0R                  ;   a  U$ SnM5  )NzPlease enter a valid unit: )inputlowerrF   )r4   r5   promptus       r<   r-   timeconv.get_units|   s3    V$**,AOO#6r?   c                 R   US:X  a  U R                   R                  U5      nOU R                   R                  U5      S-   nUS:X  a  U R                   R                  U5      nOU R                   R                  U5      S-   n[        U5      S-   U-   S-   [        U5      -   S-   U-   nU$ )NrA   r    z is equal to )unitsrH   str)r4   r6   r9   r7   r8   fromdisptodisptxts           r<   r3   timeconv.txt_build   s    aKzz~~i0Hzz~~i036H!OZZ^^G,FZZ^^G,s2F&kC(*_<s:NQTTW]]
r?    N)__name__
__module____qualname____firstlineno____doc__rF   r\   rG   r=   r/   r-   r3   __static_attributes__rb   r?   r<   r   r      st    ,J
 E J8#Jr?   N)r   r   rb   r?   r<   <module>ri      s)     
O O Or?   