U
    pd a                     @   s4  d Z ddlZddlZddlZddlmZ dddddd	d
dddddddddddddddddgZeZ	G dd deZ
G dd deZdZdZdd d!d d"d d"d d d"d d"d gZG d#d$ d$ZG d%d& d&Zed'Zed(Zed)Zed*Zed+\ZZZZZZZd,d Zd-d	 Zd.d
 Zd/d Z d0d1 Z!d2d3 Z"d4d5 Z#G d6d de$Z%G d7d de%Z&G d8d de%Z'G d9d: d:Z(G d;d de&Z)G d<d de'Z*e& Z+e+j,Z-d=d Z.e+j/Z0e+j1Z1e+j2Z3e+j4Z5e+j6Z6e+j7Z8e+j9Z:e+j;Z<d>Z=d?Z>e=e>fd@dAZ?e=e>fdBdCZ@dDZAeBeAddC ZDdEd ZEdFdG ZFeGdHkr0eFejH dS )Ia$  Calendar printing functions

Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday).    N)repeatIllegalMonthErrorIllegalWeekdayErrorsetfirstweekdayfirstweekdayisleapleapdaysweekday
monthrangemonthcalendarprmonthmonthprcalcalendartimegm
month_name
month_abbrday_nameday_abbrCalendarTextCalendarHTMLCalendarLocaleTextCalendarLocaleHTMLCalendar
weekheaderc                   @   s   e Zd Zdd Zdd ZdS )r   c                 C   s
   || _ d S Nr   )selfr    r   /usr/lib/python3.8/calendar.py__init__   s    zIllegalMonthError.__init__c                 C   s
   d| j  S )Nz!bad month number %r; must be 1-12r   r   r   r   r   __str__   s    zIllegalMonthError.__str__N__name__
__module____qualname__r    r"   r   r   r   r   r      s   c                   @   s   e Zd Zdd Zdd ZdS )r   c                 C   s
   || _ d S r   r	   )r   r	   r   r   r   r        s    zIllegalWeekdayError.__init__c                 C   s
   d| j  S )Nz7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)r'   r!   r   r   r   r"   "   s    zIllegalWeekdayError.__str__Nr#   r   r   r   r   r      s                  c                   @   sF   e Zd Zdd edD Zeddd  dd Zd	d
 Zdd ZdS )_localized_monthc                 C   s    g | ]}t d |d djqS i  r(   datetimedatestrftime.0ir   r   r   
<listcomp>4   s     z_localized_month.<listcomp>   r   c                 C   s   dS )N r   )xr   r   r   <lambda>5       z_localized_month.<lambda>c                 C   s
   || _ d S r   formatr   r=   r   r   r   r    7   s    z_localized_month.__init__c                    s4    j | }t|tr& fdd|D S | jS d S )Nc                    s   g | ]}| j qS r   r<   r4   fr!   r   r   r6   =   s     z0_localized_month.__getitem__.<locals>.<listcomp>)_months
isinstanceslicer=   r   r5   Zfuncsr   r!   r   __getitem__:   s    

z_localized_month.__getitem__c                 C   s   dS )N   r   r!   r   r   r   __len__A   s    z_localized_month.__len__N)	r$   r%   r&   rangerA   insertr    rE   rG   r   r   r   r   r-   2   s
   r-   c                   @   s6   e Zd Zdd edD Zdd Zdd Zdd	 Zd
S )_localized_dayc                 C   s    g | ]}t d d|d jqS r.   r/   r3   r   r   r   r6   H   s     z_localized_day.<listcomp>   c                 C   s
   || _ d S r   r<   r>   r   r   r   r    J   s    z_localized_day.__init__c                    s4    j | }t|tr& fdd|D S | jS d S )Nc                    s   g | ]}| j qS r   r<   r?   r!   r   r   r6   P   s     z._localized_day.__getitem__.<locals>.<listcomp>)_daysrB   rC   r=   rD   r   r!   r   rE   M   s    

z_localized_day.__getitem__c                 C   s   dS NrK   r   r!   r   r   r   rG   T   s    z_localized_day.__len__N)r$   r%   r&   rH   rL   r    rE   rG   r   r   r   r   rJ   E   s   rJ   z%Az%az%Bz%brK   c                 C   s$   | d dko"| d dkp"| d dkS )z5Return True for leap years, False for non-leap years.   r   d     r   )yearr   r   r   r   d   s    c                 C   s@   | d8 } |d8 }|d | d  |d | d   |d | d   S )zFReturn number of leap years in range [y1, y2).
       Assume y1 <= y2.r(   rN   rO   rP   r   )Zy1Zy2r   r   r   r   i   s    c                 C   s8   t j|   krt jks&n d| d  } t | || S )zBReturn weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).i  rP   )r0   ZMINYEARZMAXYEARr1   r	   )rQ   r   dayr   r   r   r	   q   s    c                 C   sJ   d|  krdksn t |t| |d}t| |tko>t|  }||fS )zQReturn weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
       year, month.r(   r7   )r   r	   mdaysFebruaryr   )rQ   r   day1ndaysr   r   r   r
   x   s
    c                 C   s   t | |tkot|  S r   )rS   rT   r   rQ   r   r   r   r   	_monthlen   s    rX   c                 C   s$   |dkr| d dfS | |d fS d S )Nr(   r7   r   rW   r   r   r   
_prevmonth   s    rY   c                 C   s$   |dkr| d dfS | |d fS d S )Nr7   r(   r   rW   r   r   r   
_nextmonth   s    rZ   c                   @   s   e Zd ZdZd#ddZdd Zdd ZeeeZd	d
 Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zd$ddZd%ddZd&d d!Zd"S )'r   zo
    Base calendar class. This class doesn't do any formatting. It simply
    provides data to subclasses.
    r   c                 C   s
   || _ d S r   r   r   r   r   r   r   r       s    zCalendar.__init__c                 C   s
   | j d S rM   Z_firstweekdayr!   r   r   r   getfirstweekday   s    zCalendar.getfirstweekdayc                 C   s
   || _ d S r   r]   r\   r   r   r   r      s    zCalendar.setfirstweekdayc                 c   s&   t | j| jd D ]}|d V  qdS )zt
        Return an iterator for one week of weekday numbers starting with the
        configured first one.
        rK   N)rH   r   )r   r5   r   r   r   iterweekdays   s    zCalendar.iterweekdaysc                 c   s,   |  ||D ]\}}}t|||V  qdS )z
        Return an iterator for one month. The iterator will yield datetime.date
        values and will always iterate through complete weeks, so it will yield
        dates outside the specified month.
        N)itermonthdays3r0   r1   )r   rQ   r   ymdr   r   r   itermonthdates   s    zCalendar.itermonthdatesc                 c   sf   t ||\}}|| j d }td|E dH  td|d E dH  | j| | d }td|E dH  dS )z
        Like itermonthdates(), but will yield day numbers. For days outside
        the specified month the day number is 0.
        rK   r   Nr(   )r
   r   r   rH   )r   rQ   r   rU   rV   days_before
days_afterr   r   r   itermonthdays   s    zCalendar.itermonthdaysc                 c   s0   t | ||| jD ]\}}||d fV  qdS )z
        Like itermonthdates(), but will yield (day number, weekday number)
        tuples. For days outside the specified month the day number is 0.
        rK   N)	enumeraterg   r   )r   rQ   r   r5   rc   r   r   r   itermonthdays2   s    zCalendar.itermonthdays2c                 c   s   t ||\}}|| j d }| j| | d }t||\}}t||d }	t|	| |	D ]}
|||
fV  qXtd|d D ]}
|||
fV  qxt||\}}td|d D ]}
|||
fV  qdS )z
        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
        used for dates outside of datetime.date range.
        rK   r(   N)r
   r   rY   rX   rH   rZ   )r   rQ   r   rU   rV   re   rf   ra   rb   endrc   r   r   r   r`      s    zCalendar.itermonthdays3c                 c   s<   t | ||D ]&\}\}}}|||| j| d fV  qdS )z
        Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.
        Can be used for dates outside of datetime.date range.
        rK   N)rh   r`   r   )r   rQ   r   r5   ra   rb   rc   r   r   r   itermonthdays4   s    zCalendar.itermonthdays4c                    s.   t | ||  fddtdt dD S )z
        Return a matrix (list of lists) representing a month's calendar.
        Each row represents a week; week entries are datetime.date values.
        c                    s   g | ]} ||d   qS rK   r   r3   Zdatesr   r   r6      s     z/Calendar.monthdatescalendar.<locals>.<listcomp>r   rK   )listrd   rH   lenr   rQ   r   r   rm   r   monthdatescalendar   s    zCalendar.monthdatescalendarc                    s.   t | ||  fddtdt dD S )z
        Return a matrix representing a month's calendar.
        Each row represents a week; week entries are
        (day number, weekday number) tuples. Day numbers outside this month
        are zero.
        c                    s   g | ]} ||d   qS rl   r   r3   daysr   r   r6      s     z/Calendar.monthdays2calendar.<locals>.<listcomp>r   rK   )rn   ri   rH   ro   rp   r   rr   r   monthdays2calendar   s    zCalendar.monthdays2calendarc                    s.   t | ||  fddtdt dD S )z
        Return a matrix representing a month's calendar.
        Each row represents a week; days outside this month are zero.
        c                    s   g | ]} ||d   qS rl   r   r3   rr   r   r   r6      s     z.Calendar.monthdayscalendar.<locals>.<listcomp>r   rK   )rn   rg   rH   ro   rp   r   rr   r   monthdayscalendar   s    zCalendar.monthdayscalendar   c                    s>   fddt ttd D   fddt dt D S )a'  
        Return the data for the specified year ready for formatting. The return
        value is a list of month rows. Each month row contains up to width months.
        Each month contains between 4 and 6 weeks and each week contains 1-7
        days. Days are datetime.date objects.
        c                    s   g | ]}  |qS r   )rq   r3   r   rQ   r   r   r6     s   z.Calendar.yeardatescalendar.<locals>.<listcomp>r7   c                    s   g | ]} ||  qS r   r   r3   monthswidthr   r   r6   	  s     r   rH   Januaryro   r   rQ   rz   r   ry   r   rz   rQ   r   yeardatescalendar   s    zCalendar.yeardatescalendarc                    s>   fddt ttd D   fddt dt D S )z
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are
        (day number, weekday number) tuples. Day numbers outside this month are
        zero.
        c                    s   g | ]}  |qS r   )rt   r3   rw   r   r   r6     s   z.Calendar.yeardays2calendar.<locals>.<listcomp>r7   c                    s   g | ]} ||  qS r   r   r3   rx   r   r   r6     s     r   r{   r}   r   r~   r   yeardays2calendar  s    zCalendar.yeardays2calendarc                    s>   fddt ttd D   fddt dt D S )z
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are day numbers.
        Day numbers outside this month are zero.
        c                    s   g | ]}  |qS r   )ru   r3   rw   r   r   r6     s   z-Calendar.yeardayscalendar.<locals>.<listcomp>r7   c                    s   g | ]} ||  qS r   r   r3   rx   r   r   r6   "  s     r   r{   r}   r   r~   r   yeardayscalendar  s    zCalendar.yeardayscalendarN)r   )rv   )rv   )rv   )r$   r%   r&   __doc__r    r^   r   propertyr   r_   rd   rg   ri   r`   rk   rq   rt   ru   r   r   r   r   r   r   r   r      s"   

	


c                   @   sj   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d ZdddZ	dddZ
dddZd ddZd!ddZdS )"r   zr
    Subclass of Calendar that outputs a calendar as a simple plain text
    similar to the UNIX program cal.
    c                 C   s   t | ||dd dS )z3
        Print a single week (no newline).
        r8   rj   N)print
formatweekr   theweekrz   r   r   r   prweek+  s    zTextCalendar.prweekc                 C   s    |dkrd}nd| }| |S )z*
        Returns a formatted day.
        r   r8   z%2icenter)r   rR   r	   rz   sr   r   r   	formatday1  s    zTextCalendar.formatdayc                    s   d  fdd|D S )zA
        Returns a single week in a string (no newline).
         c                 3   s    | ]\}}  ||V  qd S r   r   r4   rc   Zwdr   rz   r   r   	<genexpr>?  s     z*TextCalendar.formatweek.<locals>.<genexpr>joinr   r   r   r   r   ;  s    zTextCalendar.formatweekc                 C   s(   |dkrt }nt}|| d| |S )z4
        Returns a formatted week day name.
        	   N)r   r   r   )r   rR   rz   namesr   r   r   formatweekdayA  s    zTextCalendar.formatweekdayc                    s   d  fdd  D S )z-
        Return a header for a week.
        r   c                 3   s   | ]}  |V  qd S r   r   r3   r   r   r   r   O  s     z0TextCalendar.formatweekheader.<locals>.<genexpr>r   r_   r   r   r   r   formatweekheaderK  s    zTextCalendar.formatweekheaderTc                 C   s"   t | }|rd||f }||S )z0
        Return a formatted month name.
        %s %r)r   r   r   theyearthemonthrz   withyearr   r   r   r   formatmonthnameQ  s    zTextCalendar.formatmonthnamer   c                 C   s   t | ||||dd dS )z+
        Print a month's calendar.
        r8   r   N)r   formatmonth)r   r   r   wlr   r   r   r   Z  s    zTextCalendar.prmonthc                 C   s   t d|}t d|}| ||d|d  d }| }|d| 7 }|| | 7 }|d| 7 }| ||D ]$}|| || 7 }|d| 7 }ql|S )z@
        Return a month's calendar string (multi-line).
        r)   r(   rK   
)maxr   rstripr   rt   r   )r   r   r   r   r   r   weekr   r   r   r   `  s    

zTextCalendar.formatmonthr)   r(      rv   c              	      s  t d|}t d|}t d|}|d d d  g }|j}|t | ||d     |d|  |t|D ]"\}}	t|| d t	||d  d d}
|d|   fdd|
D }|t
| |  |d|  fdd|
D }|t
| |  |d|  t d	d |	D }t|D ]f}g }|	D ]6}|t|krj|d
 n||| | qL|t
| |  |d|  q@qd
|S )zC
        Returns a year's calendar as a multi-line string.
        r)   r(   rK   r   rF   c                 3   s   | ]} | d V  qdS )FN)r   r4   k)colwidthr   r   r   r   r     s   z*TextCalendar.formatyear.<locals>.<genexpr>c                 3   s   | ]
} V  qd S r   r   r   )headerr   r   r     s     c                 s   s   | ]}t |V  qd S r   )ro   )r4   calr   r   r   r     s     r8   )r   appendreprr   r   r   rh   r   rH   minformatstringro   r   r   )r   r   r   r   crb   var5   rowry   r   ZheadersZheightjZweeksr   r   )r   r   r   r   r   
formatyearp  s<    


&
$zTextCalendar.formatyearc                 C   s   t | |||||dd dS )zPrint a year's calendar.r8   r   N)r   r   )r   r   r   r   r   rb   r   r   r   pryear  s    zTextCalendar.pryearN)T)r   r   )r   r   )r)   r(   r   rv   )r   r   r   rv   )r$   r%   r&   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   %  s   


	


%c                   @   s   e Zd ZdZdddddddgZeZd	Zd
Zd
ZdZ	dZ
dd Zdd Zdd Zdd Zd ddZd!ddZd"ddZd#ddZdS )$r   z4
    This calendar returns complete HTML pages.
    ZmonZtueZwedZthuZfriZsatZsunZnodayr   rQ   c                 C   s(   |dkrd| j  S d| j| |f S dS )z/
        Return a day as a table cell.
        r   z<td class="%s">&nbsp;</td>z<td class="%s">%d</td>N)cssclass_noday
cssclasses)r   rR   r	   r   r   r   r     s    
zHTMLCalendar.formatdayc                    s    d  fdd|D }d| S )z8
        Return a complete week as a table row.
        r8   c                 3   s   | ]\}}  ||V  qd S r   r   r   r!   r   r   r     s     z*HTMLCalendar.formatweek.<locals>.<genexpr><tr>%s</tr>r   )r   r   r   r   r!   r   r     s    zHTMLCalendar.formatweekc                 C   s   d| j | t| f S )z:
        Return a weekday name as a table header.
        <th class="%s">%s</th>)cssclasses_weekday_headr   )r   rR   r   r   r   r     s     zHTMLCalendar.formatweekdayc                    s$   d  fdd  D }d| S )z<
        Return a header for a week as a table row.
        r8   c                 3   s   | ]}  |V  qd S r   r   r3   r!   r   r   r     s     z0HTMLCalendar.formatweekheader.<locals>.<genexpr>r   r   )r   r   r   r!   r   r     s    zHTMLCalendar.formatweekheaderTc                 C   s0   |rdt | |f }ndt |  }d| j|f S )z5
        Return a month name as a table row.
        %s %sz%sz+<tr><th colspan="7" class="%s">%s</th></tr>)r   cssclass_month_headr   r   r   r   r   r   r   r   r     s     zHTMLCalendar.formatmonthnamec                 C   s   g }|j }|d| j  |d || j|||d |d ||   |d | ||D ]}|| | |d q\|d |d d|S )z6
        Return a formatted month as a table.
        =<table border="0" cellpadding="0" cellspacing="0" class="%s">r   r   </table>r8   )r   cssclass_monthr   r   rt   r   r   )r   r   r   r   r   r   r   r   r   r   r     s     
zHTMLCalendar.formatmonthrv   c                 C   s   g }|j }t|d}|d| j  |d |d|| j|f  tttd |D ]V}t|t|| d}|d |D ](}|d || j||d	d
 |d qr|d qN|d d|S )z?
        Return a formatted year as a table of tables.
        r(   r   r   z,<tr><th colspan="%d" class="%s">%s</th></tr>r7   rF   z<tr>z<td>Fr   z</td>z</tr>r   r8   )	r   r   cssclass_yearcssclass_year_headrH   r|   r   r   r   )r   r   rz   r   r   r5   ry   rb   r   r   r   r     s,    
  

zHTMLCalendar.formatyearcalendar.cssNc                 C   s   |dkrt  }g }|j}|d|  |d |d |d |d|  |dk	r^|d|  |d|  |d	 |d
 || || |d |d d||dS )zB
        Return a formatted year as a complete HTML page.
        Nz$<?xml version="1.0" encoding="%s"?>
zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
z<html>
z<head>
zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />
z4<link rel="stylesheet" type="text/css" href="%s" />
z<title>Calendar for %d</title>
z</head>
z<body>
z</body>
z</html>
r8   xmlcharrefreplace)sysgetdefaultencodingr   r   r   encode)r   r   rz   cssencodingr   r   r   r   r   formatyearpage
  s$    zHTMLCalendar.formatyearpage)T)T)rv   )rv   r   N)r$   r%   r&   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s    



c                   @   s$   e Zd Zdd Zdd Zdd ZdS )different_localec                 C   s
   || _ d S r   locale)r   r   r   r   r   r    #  s    zdifferent_locale.__init__c                 C   s"   t t j| _t t j| j d S r   )_localeZ	getlocaleLC_TIME	oldlocale	setlocaler   r!   r   r   r   	__enter__&  s    zdifferent_locale.__enter__c                 G   s   t t j| j d S r   )r   r   r   r   )r   argsr   r   r   __exit__*  s    zdifferent_locale.__exit__N)r$   r%   r&   r    r   r   r   r   r   r   r   "  s   r   c                   @   s,   e Zd ZdZdddZdd Zdd	d
ZdS )r      
    This class can be passed a locale name in the constructor and will return
    month and weekday names in the specified locale. If this locale includes
    an encoding all strings containing month and weekday names will be returned
    as unicode.
    r   Nc                 C   s&   t | | |d krt }|| _d S r   )r   r    r   getdefaultlocaler   r   r   r   r   r   r   r    6  s    zLocaleTextCalendar.__init__c              
   C   sN   t | j: |dkrt}nt}|| }|d | |W  5 Q R  S Q R X d S )Nr   )r   r   r   r   r   )r   rR   rz   r   namer   r   r   r   <  s    z LocaleTextCalendar.formatweekdayTc              
   C   sD   t | j0 t| }|r$d||f }||W  5 Q R  S Q R X d S )Nr   )r   r   r   r   r   r   r   r   r   E  s
    z"LocaleTextCalendar.formatmonthname)r   N)Tr$   r%   r&   r   r    r   r   r   r   r   r   r   .  s   
	c                   @   s,   e Zd ZdZdddZdd Zdd	d
ZdS )r   r   r   Nc                 C   s&   t | | |d krt }|| _d S r   )r   r    r   r   r   r   r   r   r   r    T  s    zLocaleHTMLCalendar.__init__c              
   C   s<   t | j( t| }d| j| |f W  5 Q R  S Q R X d S )Nr   )r   r   r   r   )r   rR   r   r   r   r   r   Z  s    z LocaleHTMLCalendar.formatweekdayTc              
   C   sB   t | j. t| }|r$d||f }d| W  5 Q R  S Q R X d S )Nr   z.<tr><th colspan="7" class="month">%s</th></tr>)r   r   r   r   r   r   r   r   _  s
    z"LocaleHTMLCalendar.formatmonthname)r   N)Tr   r   r   r   r   r   M  s   
c                 C   s(   t |   krtksn t| | t_d S r   )MONDAYSUNDAYr   r   r   r[   r   r   r   r   l  s       r   c                 C   s   t t| || dS )z1Prints multi-column formatting for year calendarsN)r   r   Zcolsr   spacingr   r   r   r=     s    r=   c                    s    |d9 }|  fdd| D S )zEReturns a string formatted from n strings, centered within n columns.r   c                 3   s   | ]}|  V  qd S r   r   )r4   r   r   r   r   r     s     zformatstring.<locals>.<genexpr>r   r   r   r   r   r     s    r   i  c                 C   s^   | dd \}}}}}}t ||d t | d }|d | }|d | }	|	d | }
|
S )zBUnrelated but handy function to calculate Unix timestamp from GMT.Nr   r(      <   )r0   r1   	toordinal
_EPOCH_ORD)tuplerQ   r   rR   ZhourZminutesecondrs   ZhoursZminutesZsecondsr   r   r   r     s    c                 C   s  dd l }| }|d}|d}|jddtddd |jd	d
tddd |jddtddd |jddtddd |jddddd |jddd dd |jddd dd |jd d!d"d#d$d% |jd&d'td(d) |jd*d'td+d) || dd  }|jr|js|d, t	
d |j|jf}|jd-kr|jrDt|d.}nt }|j}|d krbt	 }t||jd/}	t	jjj}
|jd kr|
|jtj jf|	 n6|jd kr|
|j|jf|	 n|d0 t	
d n|jrt|d.}nt }t|j|jd1}	|jd kr$|j|	d2< |j|	d3< |jd krH|j tj jf|	}n2|jd krf|j |jf|	}n|j!|j|jf|	}t	jj}
|jr|"|j}t	jjj}
|
| d S )4Nr   ztext only argumentszhtml only argumentsz-wz--widthr)   z width of date column (default 2))typedefaulthelpz-lz--linesr(   z)number of lines for each week (default 1)z-sz	--spacingr   z"spacing between months (default 6)z-mz--monthsrv   zmonths per row (default 3)z-cz--cssr   zCSS to use for page)r   r   z-Lz--localez.locale to be used from month and weekday namesz-ez
--encodingzencoding to use for outputz-tz--typetext)r   htmlzoutput type (text or html))r   choicesr   rQ   ?zyear number (1-9999))nargsr   r   r   zmonth number (1-12, text only)z/if --locale is specified --encoding is requiredr   r   )r   r   zincorrect number of arguments)r   r   r   rb   )#argparseArgumentParserZadd_argument_groupadd_argumentint
parse_argsr   r   errorr   exitr   r   r   r   dictr   stdoutbufferwriterQ   r   r0   r1   Ztodayr   r   r   rz   linesr   ry   r   r   r   )r   r   parserZ	textgroupZ	htmlgroupZoptionsr   r   r   Zoptdictr   resultr   r   r   main  s    

              







r   __main__)Ir   r   r0   r   r   	itertoolsr   __all__
ValueErrorr   r   r   r|   rT   rS   r-   rJ   r   r   r   r   rH   r   ZTUESDAYZ	WEDNESDAYZTHURSDAYZFRIDAYZSATURDAYr   r   r   r	   r
   rX   rY   rZ   objectr   r   r   r   r   r   r   r^   r   r   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   Z	_colwidthZ_spacingr=   r   ZEPOCHr1   r   r   r   r   r$   argvr   r   r   r   <module>   s                   
 u 	
h
