MCPcopy Index your code
hub / github.com/RustPython/RustPython / formatyear

Method formatyear

Lib/calendar.py:539–561  ·  view source on GitHub ↗

Return a formatted year as a table of tables.

(self, theyear, width=3)

Source from the content-addressed store, hash-verified

537 return ''.join(v)
538
539 def formatyear(self, theyear, width=3):
540 """
541 Return a formatted year as a table of tables.
542 """
543 v = []
544 a = v.append
545 width = max(width, 1)
546 a('<table border="0" cellpadding="0" cellspacing="0" class="%s">' %
547 self.cssclass_year)
548 a('\n')
549 a('<tr><th colspan="%d" class="%s">%s</th></tr>' % (
550 width, self.cssclass_year_head, theyear))
551 for i in range(JANUARY, JANUARY+12, width):
552 # months in this row
553 months = range(i, min(i+width, 13))
554 a('<tr>')
555 for m in months:
556 a('<td>')
557 a(self.formatmonth(theyear, m, withyear=False))
558 a('</td>')
559 a('</tr>')
560 a('</table>')
561 return ''.join(v)
562
563 def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None):
564 """

Callers 2

formatyearpageMethod · 0.95
mainFunction · 0.95

Calls 5

formatmonthMethod · 0.95
maxFunction · 0.85
minFunction · 0.85
aClass · 0.50
joinMethod · 0.45

Tested by

no test coverage detected