Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
calendar.cpython-314.pyc365 linesDownload Raw Back to __pycache__
1+
2��i�t��L�Rt^RIt^RIt^RIHtHt^RIt^RIH	t	.RNRNRNRNRNR	NR3NRNRNR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0Nt4]t!R1R]]
4t!R2R]4tR3t]!R4R]44t]!R5R]44t.RYOt!R6R74t!R8R94t]!R:4t]!R;4t]!R<4t]!R=4tR>tR?tR@tRAtRBtRCtRDt REt!!RFR]"4t#!RGR]#4t$!RHR]#4t%!RIRJ4t&RKt'!RLR]$4t(!RMR]%4t)!RNRO]$4t*!RPRQ](]*4t+]$!4t,],PZt.RRt/],P`t1],Pdt2],Pft4],Pjt6],Pnt7],Ppt9],Ptt;],Pxt=^t>^t?]>]?3RSlt@]>]?3RTltARUtB]P�!]B^^4P�4tERVtFRZRWltG]HRX8Xd5]G!4R#R#)[a$Calendar printing functions6 7Note when comparing these calendars to the ones printed by cal(1): By8default, these calendars have Monday as the first day of the week, and9Sunday as the last (the European convention). Use setfirstweekday() to10set the first day of the week (0=Monday, 6=Sunday).N)�IntEnum�global_enum)�repeat�IllegalMonthError�IllegalWeekdayError�setfirstweekday�firstweekday�isleap�leapdays�weekday�11monthrange�
monthcalendar�prmonth�month�prcal�calendar�timegm�12month_name�13month_abbr�day_name�day_abbr�Calendar�TextCalendar�HTMLCalendar�LocaleTextCalendar�LocaleHTMLCalendar�14weekheader�Day�Month�JANUARY�FEBRUARY�MARCH�APRIL�MAY�JUNE�JULY�AUGUST�	SEPTEMBER�OCTOBER�NOVEMBER�DECEMBER�MONDAY�TUESDAY�	WEDNESDAY�THURSDAY�FRIDAY�SATURDAY�SUNDAYc�,a�]tRt^ toRtRtRtVtR#)rc��WnR#�N�r)�selfrs&&�Lib\calendar.py�__init__�IllegalMonthError.__init__!s���15�c�(�RVP,#)z!bad month number %r; must be 1-12r5�r6s&r7�__str__�IllegalMonthError.__str__#s��2�T�Z�Z�?�?r:r5N��__name__�16__module__�__qualname__�__firstlineno__r8r=�__static_attributes__�__classdictcell__��
__classdict__s@r7rr s�����@�@r:c�,a�]tRt^'toRtRtRtVtR#)rc��WnR#r4�r)r6rs&&r7r8�IllegalWeekdayError.__init__(s���r:c�(�RVP,#)z7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)rJr<s&r7r=�IllegalWeekdayError.__str__*s��H�4�<�<�W�Wr:rJNr?rFs@r7rr's�����X�Xr:c��VR	9d=^RIpVPRVRVP4R2\^R7VR8Xd^#^#\	R\17RVR24h)18�JanuaryNzThe 'z ' attribute is deprecated, use 'z	' instead)�19stacklevelzmodule 'z' has no attribute '�')rO�February)�warnings�warn�upper�DeprecationWarning�AttributeErrorr@)�namerSs& r7�__getattr__rY.sf���&�&���
�
��d�V�#C�D�J�J�L�>�QZ�[�(�Q�	�	8��9����20�8�H�:�-A�$��q�I�21J�Jr:c�F�]tRt^<t^t^t^t^t^t^t	^t22^t^	t^23t
^t^tRtR#)r�N)r@rArBrCrr r!r"r#r$r%r&r'r(r)r*rDr[r:r7rr<s>���G��H�
�E�
�E�24�C��D��D�
�F��I��G��H��Hr:c�2�]tRt^Mt^t^t^t^t^t^t	^t25RtR#)rr[N)r@rArBrCr+r,r-r.r/r0r1rDr[r:r7rrMs%��
�F��G��I��H�
�F��H�
�Fr:c��a�]tRt^`to]!^4Uu.uF,p\26P!RV^,^4PNK.	upt]P^R4Rt27RtRtRt
VtR#uupi)�_localized_month��c��R#)�r[)�xs&r7�<lambda>�_localized_month.<lambda>cs��r:c��WnR#r4��format�r6rgs&&r7r8�_localized_month.__init__e����r:c���VPV,p\V\4'd"VUu.uFq3!VP4NK	up#V!VP4#uupir4)�_months�28isinstance�slicerg�r6�i�funcs�fs&&  r7�__getitem__�_localized_month.__getitem__hsM�����Q����a����,1�2�E�q�A�d�k�k�N�E�2�2�����%�%��3��Ac��^
#)�
r[r<s&r7�__len__�_localized_month.__len__os��r:rfN)r@rArBrC�range�datetime�date�strftimerl�insertr8rsrxrDrE�rprGs0@r7r^r^`s\����=B�2�Y�G�Y��x�}�}�T�1�Q�3��*�3�3�Y�G�G��N�N�1�l�#��&����Hs�2A+r^c	�a�]tRt^sto]!^4Uu.uF,p\29P!R^V^,4PNK.	uptRt	Rt30RtRtVt
R#uupi)�_localized_dayr_c��WnR#r4rfrhs&&r7r8�_localized_day.__init__xrjr:c���VPV,p\V\4'd"VUu.uFq3!VP4NK	up#V!VP4#uupir4)�_daysrmrnrgros&&  r7rs�_localized_day.__getitem__{sM���31�32�1�
���a����,1�2�E�q�A�d�k�k�N�E�2�2�����%�%��3ruc��^#��r[r<s&r7rx�_localized_day.__len__�s��r:rfN)r@rArBrCrzr{r|r}r�r8rsrxrDrErs0@r7r�r�ssQ����<A��8�D�8�a�X�]�]�4��A�a�C�
(�
1�
1�8�D�E��&����
Es�2Ar�z%Az%az%Bz%bc�j�V^,^8H;'d!V^d,^8g;'g
VR,^8H#)z5Return True for leap years, False for non-leap years.�r[)�years&r7r	r	�s0���!�8�q�=�A�A�d�S�j�A�o�@�@����q��Ar:c���V^,pV^,pV^,V^,,33V^d,V^d,,34,35VR,VR,,36,#)z?Return number of leap years in range [y1, y2).37Assume y1 <= y2.r�r[)�y1�y2s&&r7r38r39�sL���!�G�B��!�G�B���E�B��E�M�b�#�g��C��/�0�B��G�b�#�g�4E�F�Fr:c���\PTu;8:d\P8:gMRVR,,p\\P!WV4P44#)zBReturn weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).i�r�)r{�MINYEAR�MAXYEARrr|r)r�r�days&&&r7rr�sH�����t�7�x�'7�'7�7��d�S�j� ���x�}�}�T�#�.�6�6�8�9�9r:c�>�^Tu;8:d^8:gM\V4hR#)�N)rr5s&r7�_validate_monthr��s���������&�&�r:c��\V4\W^4p\V,V\8H;'d\	V4,pW#3#)z`Return weekday of first day of month (0-6 ~ Mon-Sun)40and number of days (28-31) for year, month.)r�r�mdaysr r	)r�r�day1�ndayss&&  r7rr�s?���E���4��"�D��%�L�E�X�-�>�>�&��,�?�E��;�r:c�^�\V,V\8H;'d\V4,#r4)r�r r	�r�rs&&r7�	_monthlenr��s"����<�5�H�,�=�=����>�>r:c�:�V^8XdV^,41^3#W^,423#)r�r[r�s&&r7�43_prevmonthr��s#����z��A�v�r�z���1�W�}�r:c�:�V^8XdV^,^3#W^,3#)�r[r�s&&r7�44_nextmonthr��s#����{��A�v�q�y���1�W�}�r:c�a�]tRt^�toRtRRltRtRt]!]]4t	Rt45RtRtRt
R	tR46tRtRtR
tRRltRRltRRltRtVtR#)rzc47Base calendar class. This class doesn't do any formatting. It simply48provides data to subclasses.49c��WnR#r4�r�r6rs&&r7r8�Calendar.__init__�s��(�r:c�(�VP^,#r���
_firstweekdayr<s&r7�getfirstweekday�Calendar.getfirstweekday�s���!�!�A�%�%r:c��WnR#r4r�r�s&&r7r�Calendar.setfirstweekday�s��)�r:c#�"�\VPVP^,4FpV^,x�K	R#5i)z\50Return an iterator for one week of weekday numbers starting with the51configured first one.52N)rzr)r6rps& r7�iterweekdays�Calendar.iterweekdays�s3���53�t�(�(�$�*;�*;�a�*?�@�A��A�#�I�A�s�<>c#�v"�VPW4Fwr4p\P!W4V4x�K!	R#5i)z�54Return an iterator for one month. The iterator will yield datetime.date55values and will always iterate through complete weeks, so it will yield56dates outside the specified month.57N)�itermonthdays3r{r|)r6r�r�y�m�ds&&&   r7�itermonthdates�Calendar.itermonthdates�s1����*�*�4�7�G�A�!��-�-��a�(�(�8�s�79c#�."�\W4wr4W0P,58^,p\^V4Rjx�L59\^V^,4Rjx�L60VPV,61V,62^,p\^V4Rjx�L63R#LVL=L645i)zn65Like itermonthdates(), but will yield day numbers. For days outside66the specified month the day number is 0.67N)rrrrz)r6r�rr�r��days_before�68days_afters&&&    r7�
itermonthdays�Calendar.itermonthdays�s���69!��-����/�/�/�1�4���!�[�)�)�)���E�A�I�&�&�&��'�'�$�.��6�!�;�70��!�Z�(�(�(�	*�&�(�s3�6B�B�B�B�4B�B�	B�B�Bc#�"�\VPW4VP4Fwr4WC^,3x�K	R#5i)z�71Like itermonthdates(), but will yield (day number, weekday number)72tuples. For days outside the specified month the day number is 0.73N)�	enumerater�r)r6r�rrpr�s&&&  r7�itermonthdays2�Calendar.itermonthdays2�s7���74�d�0�0��=�t�?P�?P�Q�D�A���U�(�N�R�s�=?c#�"�\W4wr4W0P,75^,pVPV,76V,77^,p\W4wrx\Wx4^,p	\	W�,78V	4F	p79WxV803x�K	\	^V^,4F	p81WV823x�K	\W4wrx\	^V^,4F	p83WxV843x�K	R#5i)zy85Like itermonthdates(), but will yield (year, month, day) tuples.  Can be86used for dates outside of datetime.date range.87N)rrr�r�rzr�)r6r�rr�r�r�r�r�r��endr�s&&&        r7r��Calendar.itermonthdays3�s����88!��-����/�/�/�1�4���'�'�$�.��6�!�;�89��$�&�����o��!���s���,�A���'�M�-��q�%�!�)�$�A��q�.� �%��$�&����q�*�q�.�)�A���'�M�*�s�CCc#�"�\VPW44F'wpwrEpWEW`PV,^,3x�K)	R#5i)z�90Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.91Can be used for dates outside of datetime.date range.92N)r�r�r)r6r�rrpr�r�r�s&&&    r7�itermonthdays4�Calendar.itermonthdays493sE���94&�d�&9�&9�$�&F�G�L�A�y��a���-�-��1�Q�6�6�6�H�s�AA95c��\VPW44p\^\V4^4Uu.uF
qCWD^,NK	up#uupi)z�96Return a matrix (list of lists) representing a month's calendar.97Each row represents a week; week entries are datetime.date values.98)�listr�rz�len)r6r�r�datesrps&&&  r7�monthdatescalendar�Calendar.monthdatescalendarsF��99�T�(�(��5�6��',�Q��E�100�A�'>�@�'>�!�q�1���'>�@�@��@��A	c��\VPW44p\^\V4^4Uu.uF
qCWD^,NK	up#uupi)z�101Return a matrix representing a month's calendar.102Each row represents a week; week entries are103(day number, weekday number) tuples. Day numbers outside this month104are zero.105)r�r�rzr��r6r�r�daysrps&&&  r7�monthdays2calendar�Calendar.monthdays2calendarsF���D�'�'��4�5��&+�A�s�4�y�!�&<�>�&<��a�!���&<�>�>��>r�c��\VPW44p\^\V4^4Uu.uF
qCWD^,NK	up#uupi)zp106Return a matrix representing a month's calendar.107Each row represents a week; days outside this month are zero.108)r�r�rzr�r�s&&&  r7�monthdayscalendar�Calendar.monthdayscalendar$sF��109�D�&�&�t�3�4��&+�A�s�4�y�!�&<�>�&<��a�!���&<�>�>��>r�c��\Uu.uFq0PW4NK	pp\^\V4V4Uu.uF
qTWUV,NK	up#uupiuupi)z�110Return the data for the specified year ready for formatting. The return111value is a list of month rows. Each month row contains up to width months.112Each month contains between 4 and 6 weeks and each week contains 1-7113days. Days are datetime.date objects.114)rr�rzr��r6r��widthr��monthsrps&&&   r7�yeardatescalendar�Calendar.yeardatescalendar,�V��=B�B�E�q�)�)�$�2�E��B�+0��C��K��+G�I�+G�a�q�5��!�+G�I�I��C��I�115�A�Ac��\Uu.uFq0PW4NK	pp\^\V4V4Uu.uF
qTWUV,NK	up#uupiuupi)z�116Return the data for the specified year ready for formatting (similar to117yeardatescalendar()). Entries in the week lists are118(day number, weekday number) tuples. Day numbers outside this month are119zero.120)rr�rzr�r�s&&&   r7�yeardays2calendar�Calendar.yeardays2calendar6r�r�c��\Uu.uFq0PW4NK	pp\^\V4V4Uu.uF
qTWUV,NK	up#uupiuupi)z�121Return the data for the specified year ready for formatting (similar to122yeardatescalendar()). Entries in the week lists are day numbers.123Day numbers outside this month are zero.124)rr�rzr�r�s&&&   r7�yeardayscalendar�Calendar.yeardayscalendar@sV��<A�A�5�a�(�(��1�5��A�+0��C��K��+G�I�+G�a�q�5��!�+G�I�I��B��Ir�)r�rN)���)r@rArBrC�__doc__r8r�r�propertyrr�r�r�r�r�r�r�r�r�r�r�r�rDrErFs@r7rr�sm�����125)�&�*��O�_�=�L��)�126)���$7�A�?�?�J�J�J�Jr:c�ta�]tRtRtoRtRtRtRtRtRt	RRlt127RR	ltRR128ltRRlt
RRltR
tVtR#)riJzf129Subclass of Calendar that outputs a calendar as a simple plain text130similar to the UNIX program cal.131c�>�\VPW4RR7R#)z#132Print a single week (no newline).133ra�r�N)�print�134formatweek�r6�theweekr�s&&&r7�prweek�TextCalendar.prweekPs��	�d�o�o�g�-�2�6r:c�J�V^8XdRpM	RV,pVPV4#)z135Returns a formatted day.136raz%2i��center)r6r�rr��ss&&&& r7�	formatday�TextCalendar.formatdayVs'���!�8��A����A��x�x���r:c�>aa�RPVV3RlV44#)�1137Returns a single week in a string (no newline).138� c3�L<"�TFwrSPWS4x�K	R#5ir4�r�)�.0r��wdr6r�s&  ��r7�	<genexpr>�*TextCalendar.formatweek.<locals>.<genexpr>ds!����L�G��!����q�e�4�4�G���!$��joinr�sf&fr7r��TextCalendar.formatweek`s����x�x�L�G�L�L�Lr:c�^�V^	8�d\pM\pW1,RVPV4#)z$139Returns a formatted week day name.140N)rrr�)r6r�r��namess&&& r7�
formatweekday�TextCalendar.formatweekdayfs/���A�:��E��E��z�&�5�!�(�(��/�/r:c�Zaa�RPVV3RlSP444#)z141Return a header for a week.142r�c3�H<"�TFpSPVS4x�K	R#5ir4�r	)r�rpr6r�s& ��r7r�0TextCalendar.formatweekheader.<locals>.<genexpr>ts#����R�>Q���*�*�1�e�4�4�>Q�s�"�rr�)r6r�sffr7�formatweekheader�TextCalendar.formatweekheaderps#����x�x�R�d�>O�>O�>Q�R�R�Rr:c�v�\V4\V,pV'd143V:RV:2pVPV4#)z 144Return a formatted month name.145r�)r�rr�)r6�theyear�themonthr��withyearr�s&&&&& r7�formatmonthname�TextCalendar.formatmonthnamevs1��	��!��x� ����g�&�A��x�x���r:c�@�\VPWW44RR7R#)z146Print a month's calendar.147rar�N)r��formatmonth)r6rr�w�ls&&&&&r7r�TextCalendar.prmonth�s��	�d���w�!�7�R�@r:c���\^V4p\^V4pVPW^V^,,^,1484pVP4pVRV,,
pWPPV4P4,
pVRV,,
pVP	W4F8pWPPWc4P4,
pVRV,,
pK:	V#)�0149Return a month's calendar string (multi-line).150�151)�maxr�rstriprr�r�)r6rrrrr��weeks&&&&&  r7r�TextCalendar.formatmonth�s���
��1�I����1�I��� � ��A��Q��K�!�O�D��
�H�H�J��	�T�A�X�
��	�
"�
"�1�
%�
,�
,�
.�.��	�T�A�X�
���+�+�G�>�D�
����)�0�0�2�2�A�
����M�A�?��r:c	�aaaa�\^V4p\^V4p\^V4pV^,^,^,152o.pVPpV!\S4PSV,WE^,153,,4P	44V!RV,4SPV4o\
SPSV44EFpwr�\WX,^,\WX^,,^,^
44p154V!RV,4VVV3RlV1554pV!\VSV4P	44V!RV,4V3RlV1564pV!\VSV4P	44V!RV,4\RV	44p
\V
4F�p.pV	FNpV\V48�dVPR4K&VPSPVV,V44KP	V!\VSV4P	44V!RV,4K�	EKs	RPV4#)�3157Returns a year's calendar as a multi-line string.158rc3�L<"�TFpSPSVSR4x�K	R#5i�FN�r�r��k�colwidthr6rs& ���r7r�*TextCalendar.formatyear.<locals>.<genexpr>��,����&�$���)�)�'�1�h��F�F�$�rc3�(<"�TFpSx�K		R#5ir4r[�r�r*�headers& �r7rr,������.�v�!�v�v���c3�8"�TFp\V4x�K	R#5ir4�r��r��cals& r7rr,�����1�S�c��S���S���ra)r �append�reprr�r!rr�r�rz�min�formatstringr�r�r)r6rrr�cr��v�arp�rowr�r�headers�height�j�weeksr6r+r0sff&&&&           @@r7�159formatyear�TextCalendar.formatyear�s����
��1�I����1�I����1�I����E�Q�;��?����
�H�H��	�$�w�-�160�161�x��z�!�q�S�'�1�1622�1639�1649�165;�<�	�$�q�&�	��&�&�q�)��!�$�"8�"8��!�"D�E�H�Q��1�3�q�5�#�a�1��g�a�i��"4�5�F�
�d�1�f�I�&�$�&�E�
�l�5�(�A�.�5�5�7�8�
�d�1�f�I�.�v�.�G�
�l�7�H�a�0�7�7�9�:�
�d�1�f�I��1�S�1�1�F��6�]�����C��C��H�}����R�(����T�_�_�S��V�Q�%?�@�	�166�,�u�h��2�9�9�;�<��$��(��#�F�.�w�w�q�z�r:c	�B�\VPWW4V4RR7R#)zPrint a year's calendar.rar�N)r�rE)r6rrrr=r�s&&&&&&r7�pryear�TextCalendar.pryear�s��
�d�o�o�g�!��2��;r:r[N�T�r�r���r��r�)r�r�rNr�)r@rArBrCr�r�r�r�r	rrrrrErHrDrErFs@r7rrJsE�����1677��M�0�S�	�A�� $�L<�<r:c�a�]tRtRtoRt.ROt]tRtRtRt	Rt168RtRtRt
RtR	tRR169ltRRltRRltRRltRtVtR
#)ri�z,170This calendar returns complete HTML pages.171�nodayrr�c�n�V^8XdRVP,#RVPV,V3,#)z172Return a day as a table cell.173z<td class="%s">&nbsp;</td>z<td class="%s">%d</td>)�cssclass_noday�174cssclasses)r6r�rs&&&r7r��HTMLCalendar.formatday�s5���!�8�/�$�2E�2E�E�E�+�t���w�/G��.M�M�Mr:c�La�RPV3RlV44pRV,#)z(175Return a complete week as a table row.176rac3�J<"�TFwrSPW4x�K	R#5ir4r�)r�r�rr6s&  �r7r�*HTMLCalendar.formatweek.<locals>.<genexpr>�s����A��g�q�D�N�N�1�)�)��s� #�<tr>%s</tr>r)r6r�r�sf& r7r��HTMLCalendar.formatweek�s$���
�G�G�A��A�A���q� � r:c�P�RVPV,:R\V,:R2#)z*177Return a weekday name as a table header.178z<th class="�">z</th>)�cssclasses_weekday_headr)r6r�s&&r7r	�HTMLCalendar.formatweekday�s'��179
�(�(��-�-�x��}�}�>�	>r:c�ha�RPV3RlSP444pRV,#)z,180Return a header for a week as a table row.181rac3�F<"�TFpSPV4x�K	R#5ir4r
)r�rpr6s& �r7r�0HTMLCalendar.formatweekheader.<locals>.<genexpr>�s!����G�3F�a�D�&�&�q�)�)�3F�s�!rXr)r6r�sf r7r�HTMLCalendar.formatweekheader�s-���
�G�G�G�4�3D�3D�3F�G�G���q� � r:c��\V4V'd\V,:RV:2pMR\V,,pRVP:RV:R2#)z%182Return a month name as a table row.183r�z%sz<tr><th colspan="7" class="r[z184</th></tr>)r�r�cssclass_month_head)r6rrrr�s&&&& r7r�HTMLCalendar.formatmonthname�sF��	��!��%�h�/�/��9�A��z�(�+�+�A���$�$�a�)�	)r:c��.pVPpV!RVP,4V!R4V!VPWVR74V!R4V!VP44V!R4VP	W4F"pV!VPV44V!R4K$	V!R4V!R4RP
V4#)z&185Return a formatted month as a table.186�=<table border="0" cellpadding="0" cellspacing="0" class="%s">r�r�</table>ra)r9�cssclass_monthrrr�r�r)r6rrrr>r?r"s&&&&   r7r�HTMLCalendar.formatmonths���
��
�H�H��	�187I����!�	"�	�$��	�$�188�189�w�8�190�191D�E�	�$��	�$�192�193�194!�"�	�$���+�+�G�>�D�
�d�o�o�d�#�$�
�d�G�?�	195�*�
�	�$���w�w�q�z�r:c196���.pVPp\V^4pV!RVP,4V!R4V!RW PV3,4\	\197\198^,V4Fap\	V\
WR,^
44pV!R4VF,pV!R4V!VPWRR74V!R4K.	V!R	4Kc	V!R1994RPV4#)z/200Return a formatted year as a table of tables.201rfrz,<tr><th colspan="%d" class="%s">%s</th></tr>z<tr>z<td>Frgz</td>z</tr>rhra)	r9r �
cssclass_year�cssclass_year_headrzrr;rr)r6rr�r>r?rpr�r�s&&&     r7rE�HTMLCalendar.formatyears���
��
�H�H���E�1�
��	�202I�203�204�205��	�	�$��	�2068��*�*�G�<5�5�	6��w���207�E�2�A��1�c�!�'�2�.�/�F�
�f�I����&�	��$�"�"�7��"�>�?��'�208��
�g�J�3�	209�*�
��w�w�q�z�r:Nc��Vf\P!4p.pVPpV!RV,4V!R4V!R4V!R4V!RV,4VeV!RV,4V!RV,4V!R4V!R	4V!VPW44V!R2104V!R4RP	V4PVR
4#)z2211Return a formatted year as a complete HTML page.212z$<?xml version="1.0" encoding="%s"?>213zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">214z<html>215z<head>216zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />217z4<link rel="stylesheet" type="text/css" href="%s" />218z<title>Calendar for %d</title>219z</head>220z<body>221z</body>222z</html>223ra�xmlcharrefreplace)�sys�getdefaultencodingr9rEr�encode)r6rr��css�encodingr>r?s&&&&&  r7�formatyearpage�HTMLCalendar.formatyearpage3s������-�-�/�H���
�H�H��	�2241�H�225<�=�	�226{�|�	�*�
�	�*�
�	�227P�S[�228[�\��?�
�E��K�L�	�229,�w�2306�7�	�+��	�*�
�	�$�/�/�'�231)�*�	�+��	�+���w�w�q�z� � ��+>�?�?r:r[)�mon�tue�wed�thu�fri�sat�sunrJr�)r��calendar.cssN)r@rArBrCr�rSr\rRrcrirmrlr�r�r	rrrrErvrDrErFs@r7rr�so�����232C�J�)���N�"���N� ���M�N�!�>�!�233)��(�0@�@r:c�2a�]tRtRtoRtRtRtRtVtR#)�different_localeiKc� �WnRVnR#r4��locale�	oldlocale)r6r�s&&r7r8�different_locale.__init__Ls������r:c��\P!\PR4Vn\P!\PVP4R#r4)�_locale�	setlocale�LC_TIMEr�r�r<s&r7�	__enter__�different_locale.__enter__Ps2�� �*�*�7�?�?�D�A������'�/�/�4�;�;�7r:c�d�\P!\PVP4R#r4)r�r�r�r�)r6�argss&*r7�__exit__�different_locale.__exit__Ts�����'�/�/�4�>�>�:r:r�N)	r@rArBrCr8r�r�rDrErFs@r7r�r�Ks�����8�;�;r:r�c��\P!\PR4pVR8XdD\R4;_uu_4\P!\PR4pRRR4V#V# +'giT#;i)N�Cra)r�r�r�r��r�s r7�_get_default_localer�Xsb��
�
�
�w����
5�F�
��}�
�b�
!�
!��&�&�w����=�F�"��M�6�M�	"�
!��M�s�&A2�2B	c�Paa�]tRtRtoRtRRltV3RltRV3RlltRtVt	V;t234#)	rib�|235This class can be passed a locale name in the constructor and will return236month and weekday names in the specified locale.237c�X�\PW4Vf\4pW nR#r4)rr8r�r��r6rr�s&&&r7r8�LocaleTextCalendar.__init__h�"�����d�1��>�(�*�F��r:c�<�\VP4;_uu_4\SV`
W4uuRRR4# +'giR#;ir4�r�r��superr	)r6r�r��	__class__s&&&�r7r	� LocaleTextCalendar.formatweekdayns.���
�d�k�k�
*�
*��7�(��4�+�
*�
*�
*��	�9�A238	c�<�\VP4;_uu_4\SV`
WW44uuRRR4# +'giR#;ir4�r�r�r�r)r6rrr�rr�s&&&&&�r7r�"LocaleTextCalendar.formatmonthnamers0���
�d�k�k�
*�
*��7�*�7�e�N�+�
*�
*�
*��	�:�A	r��r�NrJ�r@rArBrCr�r8r	rrDrE�
__classcell__�r�rGs@@r7rrbs �����239�5�O�Or:c�Paa�]tRtRtoRtRRltV3RltRV3RlltRtVt	V;t240#)	riwr�c�X�\PW4Vf\4pW nR#r4)rr8r�r�r�s&&&r7r8�LocaleHTMLCalendar.__init__|r�r:c�<�\VP4;_uu_4\SV`
V4uuRRR4# +'giR#;ir4r�)r6r�r�s&&�r7r	� LocaleHTMLCalendar.formatweekday�s.���
�d�k�k�
*�
*��7�(��-�+�
*�
*�
*�r�c�<�\VP4;_uu_4\SV`
WV4uuRRR4# +'giR#;ir4r�)r6rrrr�s&&&&�r7r�"LocaleHTMLCalendar.formatmonthname�s0���
�d�k�k�
*�
*��7�*�7�h�G�+�
*�
*�
*�r�r�r�rJr�r�s@@r7rrws ������.�H�Hr:c�Xaa�]tRtRtoR	V3RlltRR/RltR241RltRRltRtVt	V;t242#)�_CLIDemoCalendari�Nc�4<�\SV`!V/VBWnR#r4�r�r8�
highlight_day�r6r�r��kwargsr�s&&*,�r7r8�_CLIDemoCalendar.__init__�����
���$�)�&�)�*�r:r�c��aaaaa�S'd5^RIHpV!4pVPVP2oVPoMR;ooRPVVVVV3RlV44#)r�)�243get_colorsrar�c3�<"�TF8wrVS8XdSSPWS4S2MSPWS4x�K:	R#5ir4r�)r�r�r�	highlightr��resetr6r�s&  �����r7r�._CLIDemoCalendar.formatweek.<locals>.<genexpr>�sT����244�#����
�%��+�d�n�n�Q�E�:�;�E�7�C��^�^�A�5�1�2�#�s�AA)�	_colorizer��BLACK�BACKGROUND_YELLOW�RESETr)r6r�r�r�r��ansir�r�sf&fd  @@r7r��_CLIDemoCalendar.formatweek�sc����,��<�D��:�:�,�t�'=�'=�&>�?�I��J�J�E� "�"�I���x�x�245�246�#�
247�248�	249r:c��VP'dNVPPV8Xd3VPPV8XdVPPpMRp\	^V4p\	^V4pVPW^V^,,^,2504pVP
4pVRV,,
pW`PV4P
4,
pVRV,,
pVPW4F:pW`PWsVR7P
4,
pVRV,,
pK<	V#)rNr�r�)251r�r�rr�r rr!rr�r�)r6rrrrr�r�r"s&&&&&   r7r�_CLIDemoCalendar.formatmonth�s252��253
�����"�"�'�'�7�2��"�"�(�(�H�4� �.�.�2�2�M� �M���1�I����1�I��� � ��A��Q��K�!�O�D��
�H�H�J��	�T�A�X�
��	�
"�
"�1�
%�
,�
,�
.�.��	�T�A�X�
���+�+�G�>�D�
����
��F�M�M�O�O�A�
����M�A�?��r:c��aaaa�\^V4p\^V4p\^V4pV^,^,^,254o.pVPpV!\S4PSV,WE^,255,,4P	44V!RV,4SPV4o\
SPSV44EF
wr�\WX,^,\WX^,,^,^
44p256V!RV,4VVV3RlV2574pV!\VSV4P	44V!RV,4V3RlV2584pV!\VSV4P	44V!RV,4SP'd]SPPS8XdBSPPV2599d'V260PSPP4p
MRp
\RV	44p\V4F�p.p\
V	4FrwppV\V48�dVPR4K)VV
8XdSPP MRpVPSP#VV,VVR74Kt	V!\VSV4P	44V!RV,4K�	EK	RP%V4#)r%rc3�L<"�TFpSPSVSR4x�K	R#5ir'r(r)s& ���r7r�._CLIDemoCalendar.formatyear.<locals>.<genexpr>�r-rc3�(<"�TFpSx�K		R#5ir4r[r/s& �r7rr��r1r2Nc3�8"�TFp\V4x�K	R#5ir4r4r5s& r7rr��r7r8rar�)r r9r:r�r!rr�r�rzr;r<r�r�r�indexr�r�r�r)r6rrrr=r�r>r?rpr@r�rrA�	month_posrBrCrDr*r6r�r+r0sff&&&&              @@r7rE�_CLIDemoCalendar.formatyear�s\���
��1�I����1�I����1�I����E�Q�;��?����
�H�H��	�$�w�-�261�262�x��z�!�q�S�'�1�2632�2649�2659�266;�<�	�$�q�&�	��&�&�q�)��!�$�"8�"8��!�"D�E�H�Q��1�3�q�5�#�a�1��g�a�i��"4�5�F�
�d�1�f�I�&�$�&�E�
�l�5�(�A�.�5�5�7�8�
�d�1�f�I�.�v�.�G�
�l�7�H�a�0�7�7�9�:�
�d�1�f�I��"�"�"��&�&�+�+�w�6��&�&�,�,��6�"�L�L��);�);�)A�)A�B�	� �	��1�S�1�1�F��6�]����'��n�F�A�s��C��H�}����R�(�78�9�n�D�.�.�2�2�$����� �O�O�C��F�A�S�O�I��-��,�u�h��2�9�9�;�<��$��(��#�/F�J�w�w�q�z�r:r�r4rKrL)r@rArBrCr8r�rrErDrEr�r�s@@r7r�r��s%����+�267�$�268�,�02�2r:r�c�6aa�]tRtRtoRV3RlltRtVtV;t#)�_CLIDemoLocaleCalendari�c�4<�\SV`!V/VBWnR#r4r�r�s&&*,�r7r8�_CLIDemoLocaleCalendar.__init__�r�r:r�r4)r@rArBrCr8rDrEr�r�s@@r7r�r��s����+�+r:r�c�d�\Tu;8:d\8:gM\V4hV\nR#r4)r+r1rr=rr�s&r7rr�s!���\�+�V�+�!�,�/�/�!�A�Nr:c�0�\\WV44R#)z1Prints multi-column formatting for year calendarsN)r�r<��colsr+�spacings&&&r7rgrgs��	�,�t�w�269/�0r:c�La�VR,pVPV3RlV44#)zEReturns a string formatted from n strings, centered within n columns.r�c3�D<"�TFqPS4x�K	R#5ir4r�)r�r=r+s& �r7r�formatstring.<locals>.<genexpr>s����9�D�q����*�*�D�s� rr�s&f&r7r<r<s!����s�N�G��<�<�9�D�9�9�9r:i�c���VR,wrr4rV\P!W^4P4\,270V,^,271pV^,V,pV^<,V,p	V	^<,V,p272V273#)zBUnrelated but handy function to calculate Unix timestamp from GMT.:NrNN)r{r|�	toordinal�274_EPOCH_ORD)�tupler�rr��hour�minute�secondr��hours�minutes�secondss&          r7rr!sh��-2�2�Y�*�D��F��=�=��a�(�2�2�4�z�A�C�G�!�K�D���G�d�N�E��B�h���G��b�j�6�!�G��Nr:c�p	�^RIpVPRR7pVPR4pVPR4pVPRR\^RR	7VPR275R\^RR	7VPR
R\^RR	7VPRR\^RR	7VPRRRRR7VPRRRRR7VPRRRRR7VPRRR R6R"R#7VPR$R%\^R&R	7VPR'R(\R)R*7VPR+R(\R,R*7VPV4pVP'd:VP'g(VPR-4\P!^4VPVP3p\PP4pVPR!8XEd5VP'd(VPR.4\P!^4VP'd\!VR/7pM276\#4pVP%VP&4VPp	V	f\P(!4p	\+W�P,R07p277\P.P0P2pVP4f&V!VP6!VP43/V278B4R#V!VP6!VP43/V279B4R#VP'd\9WvR17pM\;VR27pVP%VP&4\+VP<VP>R37p280VPf VP@V281R4&VPBV282R5&M\EVP4VP4fVPF!VP43/V283BpMTVPfVPF!VP43/V284BpM(VPH!VP4VP3/V285Bp\P.P2pVP'd@VPKVP4p\P.P0P2pV!V4R#)7r�NT)�colorztext only argumentszhtml only argumentsz-wz--widthz width of date column (default 2))�type�default�helpz-lz--linesz)number of lines for each week (default 1)z-sz	--spacingz"spacing between months (default 6)z-mz--monthszmonths per row (default 3)z-cz--cssrzCSS to use for page)r�r�z-Lz--localez)locale to use for month and weekday namesz-ez286--encodingzencoding to use for outputz-tz--type�text�htmlzoutput type (text or html))r��choicesr�z-fz--first-weekdayzAweekday (0 is Monday, 6 is Sunday) to start each week (default 0)r��?zyear number)�nargsr�r�rzmonth number (1-12, text only)z/if --locale is specified --encoding is requiredzincorrect number of argumentsr�)rurt)r�r�r�)rrr=r�)r�r�)&�argparse�ArgumentParser�add_argument_group�add_argument�int�287parse_argsr�ru�errorrq�exitr{r|�todayr�rrrr�
first_weekdayrr�dictrt�stdout�buffer�writer�rvr�r�r��linesr�r�r�rErrs)
r�r��parser�	textgroup�	htmlgroup�optionsr�r�r6ru�optdictr��results
&            r7�mainr+s���
�
$�
$�4�
$�
0�F��)�)�*?�@�I��)�)�*?�@�I�
����i�
�!�
/���288����i�
�!�
8���289����k�
�!�
1���290����j�
�!�
)���291����g��
"���292����j��
8���293����l��
)���294����h�� �
)�	�������
�!�
P���295������
���296������
-�������%�G��~�~�~�g�.�.�.����F�G������
�^�^�W�-�-�
-�F��M�M���!�E��|�|�v���=�=�=��L�L�8�9��H�H�Q�K��>�>�>�$�F�3�C��.�C����G�1�1�2��#�#�����-�-�/�H���k�k�:���297�298�!�!�'�'���<�<���#�$�$�U�Z�Z�;�7�;�<��#�$�$�W�\�\�=�W�=�>��>�>�>�(�u�L�C�"��7�C����G�1�1�2�����'�-�-�8���=�=� �"�?�?�G�C�L�"�>�>�G�C�L��G�M�M�*��<�<���^�^�E�J�J�:�'�:�F�
�]�]�
"��^�^�G�L�L�<�G�<�F��_�_�W�\�\�7�=�=�L�G�L�F��299�300� � �������]�]�7�#3�#3�4�F��J�J�%�%�+�+�E�
�f�
r:�__main__)
r���r�rr	rrr	rr	rr4)Ir�rqr{�enumrrr�r��	itertoolsr�__all__�301ValueErrorr��302IndexErrorrrrYrrr�r^r�rrrrr	r303rr�rr�r�r��objectrrrr�r�rrr�r�r=r�rrr�r
r�r�r"rrrrrrErrHr�	_colwidth�_spacingrgr<�EPOCHr|r�r�rrr@r[r:r7�<module>rs���7���%���304!��305!� 5�306!�7H�307!��308!�#�309!�%/�310!�1:�311!�<H�312!��313!�%�314!�'.�315!�07�316!�9C�317!��318!�"�319!�$0�320!�2<�321!�>H�322!��	323!�&�	324!�(6�	325!�8L�	326!�327 �328!�329".�330!��
331!��
332!�%�
333!�'1�
334!�3:�
335!��336!��337!�"�338!�$*�339!��340!�!�341!�#,�342!�.8�343!�:D�344!��345!��346!�!,�347!�.8�348!�:B�349!��350!� �351!��	��352@�353�J�@�X�*�X�354K�
��G��
�� 
��'��
��	<����&��(�$����$����d�
#�355�
�d�
#�356�B�357G�:�'��?���EJ�v�EJ�Pu<�8�u<�pF@�8�F@�R358;�359;��O��O�*H��H�(e�|�e�P+�/�1A�+��N��� � ��"�360�#�#�
�	361�����|�|��
�
�
�362�363�)�)��	�
�
���<�<��	����
�	���$�X�1�364!*�8�:�	
��
�]�]�5�!�Q�
'�
1�
1�
3�365��o�d�z���F�r:
codekingpro/portable-devtools · Team Ai