3
g                 @   s   d dl Z d dlZd dlmZ d dlmZmZ d dlmZm	Z	 e	dde	dde	d	d
e	dde	dde	dddZ
d5Zd6dd Zd7d!d"ZdS )8    N)avoid_wrapping)is_awareutc)gettextngettext_lazyz%d yearz%d yearsz%d monthz	%d monthsz%d weekz%d weeksz%d dayz%d daysz%d hourz%d hoursz	%d minutez
%d minutes)yearmonthweekdayhourminute<      im  r      r      r	   r
   r   r   F   c             C   s  |dkrt }|dkrtdt| tjs<tj| j| j| j} |rbt|tj rbtj|j|j|j}|p|tjjt| rxt	nd}|r||  } }||  }t
j| j|j}|dkrt
j| jr|d8 }nt
j|jr|d7 }|tj|8 }|jd d d |j }|dkrt|d d S x>ttD ]"\}\}	}
||	 }|dkr P q W t|d d S g }d}xp|ttk r||k rt| \}	}
||	 }|dkrP |jt||
 |  ||	| 8 }|d7 }|d7 }q`W tdj|S )	a  
    Take two datetime objects and return the time between d and now as a nicely
    formatted string, e.g. "10 minutes". If d occurs after now, return
    "0 minutes".

    Units used are years, months, weeks, days, hours, and minutes.
    Seconds and microseconds are ignored. Up to `depth` adjacent units will be
    displayed.  For example, "2 weeks, 3 days" and "1 year, 3 months" are
    possible outputs, but "2 weeks, 3 hours" and "1 year, 5 days" are not.

    `time_strings` is an optional dict of strings to replace the default
    TIME_STRINGS dict.

    `depth` is an optional integer to control the number of adjacent time
    units returned.

    Adapted from
    https://web.archive.org/web/20060617175230/http://blog.natbat.co.uk/archive/2003/Jun/14/time_since
    Nr   zdepth must be greater than 0.   r   r   r   z, )TIME_STRINGS
ValueError
isinstancedatetimer   r   r
   nowr   r   calendarleapdaysisleap	timedeltadayssecondsr   	enumerateTIMESINCE_CHUNKSlenappendr   join)dr   reversedtime_stringsdepthdeltar   Zsinceir   namecountresultZcurrent_depth r,   T/var/www/tester-filtro-web/env/lib/python3.6/site-packages/django/utils/timesince.py	timesince   sN    




r.   c             C   s   t | |d||dS )zV
    Like timesince, but return a string measuring the time until the given time.
    T)r$   r%   r&   )r.   )r#   r   r%   r&   r,   r,   r-   	timeuntila   s    r/   i  iQ 3r0   r   i  iQ  ' r2   r   i  iQ :	 r4   r	   i  Q r6   r
     r8   r   r   r   )r1   r3   r5   r7   r9   r:   )NFNr   )NNr   )r   r   Zdjango.utils.htmlr   Zdjango.utils.timezoner   r   Zdjango.utils.translationr   r   r   r   r.   r/   r,   r,   r,   r-   <module>   s$        
F