From 2aabadfb2aad0a08acefe9eec1bd34ab9c5ac081 Mon Sep 17 00:00:00 2001 From: apurvakhatri Date: Thu, 24 Aug 2023 22:12:04 -0400 Subject: [PATCH 1/3] Document TextCalendar prweek and mdays attribute Signed-off-by: apurvakhatri --- Doc/library/calendar.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 07d04a1c7b582a..87d27e18e5769b 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -190,6 +190,10 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is :class:`TextCalendar` instances have the following methods: + .. method:: prweek(theweek, width) + + Print a week's calendar as returned by :meth:`formatweek`. + .. method:: formatmonth(theyear, themonth, w=0, l=0) Return a month's calendar in a multi-line string. If *w* is provided, it @@ -436,6 +440,11 @@ For simple text calendars this module provides the following functions. The :mod:`calendar` module exports the following data attributes: +.. data:: mdays + + An array that represents the number of days in each month. + + .. data:: day_name An array that represents the days of the week in the current locale. From ef61b8cdfd345566774315b1eb334ded30426825 Mon Sep 17 00:00:00 2001 From: apurvakhatri Date: Tue, 29 Aug 2023 21:46:34 -0400 Subject: [PATCH 2/3] Documented TextCalendar methods Signed-off-by: apurvakhatri --- Doc/library/calendar.rst | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 87d27e18e5769b..7f94fb1806c67e 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -192,7 +192,29 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. method:: prweek(theweek, width) - Print a week's calendar as returned by :meth:`formatweek`. + Print a week's calendar as returned by :meth:`formatweek` and sets the + end parameter to an empty string to prevent adding a newline character. + + .. method:: formatday(day, weekday, width) + + Return a string containing the formatted day. + + .. method:: formatweek(theweek, width) + + Return a single formatted week, with each day formatted using :meth:`formatday` + + .. method:: formatweekday(theweek, width) + + Return a formatted week day name. + + .. method:: formatweekheader(width) + + Return the formatted header for a week, containing the weekday names, with + each day formatted using :meth:`formatweekday`. + + .. method:: formatmonthname(theyear, themonth, width, withyear) + + Return a formatted month name, optinally including the year. .. method:: formatmonth(theyear, themonth, w=0, l=0) @@ -440,11 +462,6 @@ For simple text calendars this module provides the following functions. The :mod:`calendar` module exports the following data attributes: -.. data:: mdays - - An array that represents the number of days in each month. - - .. data:: day_name An array that represents the days of the week in the current locale. From c012f5ee3b8f84f31774ae9b9c9cd7c66e6452c4 Mon Sep 17 00:00:00 2001 From: apurvakhatri Date: Wed, 30 Aug 2023 15:44:42 -0400 Subject: [PATCH 3/3] Documented TextCalendar prweek Signed-off-by: apurvakhatri --- Doc/library/calendar.rst | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 7f94fb1806c67e..6d72eb8d7ca2bf 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -195,27 +195,6 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is Print a week's calendar as returned by :meth:`formatweek` and sets the end parameter to an empty string to prevent adding a newline character. - .. method:: formatday(day, weekday, width) - - Return a string containing the formatted day. - - .. method:: formatweek(theweek, width) - - Return a single formatted week, with each day formatted using :meth:`formatday` - - .. method:: formatweekday(theweek, width) - - Return a formatted week day name. - - .. method:: formatweekheader(width) - - Return the formatted header for a week, containing the weekday names, with - each day formatted using :meth:`formatweekday`. - - .. method:: formatmonthname(theyear, themonth, width, withyear) - - Return a formatted month name, optinally including the year. - .. method:: formatmonth(theyear, themonth, w=0, l=0) Return a month's calendar in a multi-line string. If *w* is provided, it