
    S`
              
           d Z ddlZdZdZdZdZdZdZd	 Zd
j                   ee       ee       ee       ee       ee       ee            Z
dddddddZd Zd Zy)z
timeparse.py
(c) Will Roberts <wildwilhelm@gmail.com>  1 February, 2014

This is a vendored and modified copy of:
github.com/wroberts/pytimeparse @ cc0550d

It has been modified to mimic the behaviour of
https://golang.org/pkg/time/#ParseDuration
    Nz(?P<hours>[\d.]+)hz(?P<mins>[\d.]+)mz(?P<secs>[\d.]+)sz(?P<milli>[\d.]+)msu   (?P<micro>[\d.]+)(?:us|µs)z(?P<nano>[\d.]+)nsc                 &    dj                  |       S )Nz(?:{x})?x)formatr   s    3/usr/lib/python3/dist-packages/compose/timeparse.pyoptr   +   s    ""    z'{HOURS}{MINS}{SECS}{MILLI}{MICRO}{NANO})HOURSMINSSECSMILLIMICRONANOi  <      gMbP?gư>g&.>)hoursminssecsmillimicronanoc                    t        j                  dt        z   dz   | t         j                        }|r|j	                  d      j                         sy|j                         }t        d |j                         D              S )a  Parse a time expression, returning it as a number of seconds.  If
    possible, the return value will be an `int`; if this is not
    possible, the return will be a `float`.  Returns `None` if a time
    expression cannot be parsed from the given string.

    Arguments:
    - `sval`: the string value to parse

    >>> timeparse('1m24s')
    84
    >>> timeparse('1.2 minutes')
    72
    >>> timeparse('1.2 seconds')
    1.2
    z\s*z\s*$r   Nc              3   R   K   | ]  \  }}|	t         |   t        |      z   ! y wN)MULTIPLIERScast).0kvs      r   	<genexpr>ztimeparse.<locals>.<genexpr>W   s,      O%+aAa Os   
'')	rematch
TIMEFORMATIgroupstrip	groupdictsumitems)svalr"   mdicts      r   	timeparser,   B   sm      HHVj(72D"$$?EA,,.OOE O/4{{}O O Or	   c                 N    | j                         rt        |       S t        |       S r   )isdigitintfloat)values    r   r   r   [   s    3u::eEl:r	   )__doc__r!   r
   r   r   r   r   r   r   r   r#   r   r,   r    r	   r   <module>r4      s   	> 
&# 8>>
e*	T	T
e*
e*	T ? 
 "-O2;r	   