MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / main

Function main

tools/python-3.11.9-amd64/Lib/calendar.py:663–764  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

661
662
663def main(args):
664 import argparse
665 parser = argparse.ArgumentParser()
666 textgroup = parser.add_argument_group('text only arguments')
667 htmlgroup = parser.add_argument_group('html only arguments')
668 textgroup.add_argument(
669 "-w", "--width",
670 type=int, default=2,
671 help="width of date column (default 2)"
672 )
673 textgroup.add_argument(
674 "-l", "--lines",
675 type=int, default=1,
676 help="number of lines for each week (default 1)"
677 )
678 textgroup.add_argument(
679 "-s", "--spacing",
680 type=int, default=6,
681 help="spacing between months (default 6)"
682 )
683 textgroup.add_argument(
684 "-m", "--months",
685 type=int, default=3,
686 help="months per row (default 3)"
687 )
688 htmlgroup.add_argument(
689 "-c", "--css",
690 default="calendar.css",
691 help="CSS to use for page"
692 )
693 parser.add_argument(
694 "-L", "--locale",
695 default=None,
696 help="locale to use for month and weekday names"
697 )
698 parser.add_argument(
699 "-e", "--encoding",
700 default=None,
701 help="encoding to use for output"
702 )
703 parser.add_argument(
704 "-t", "--type",
705 default="text",
706 choices=("text", "html"),
707 help="output type (text or html)"
708 )
709 parser.add_argument(
710 "year",
711 nargs='?', type=int,
712 help="year number"
713 )
714 parser.add_argument(
715 "month",
716 nargs='?', type=int,
717 help="month number (1-12, text only)"
718 )
719
720 options = parser.parse_args(args[1:])

Callers 1

calendar.pyFile · 0.70

Calls 15

parse_argsMethod · 0.95
errorMethod · 0.95
formatyearMethod · 0.95
formatmonthMethod · 0.95
LocaleHTMLCalendarClass · 0.85
HTMLCalendarClass · 0.85
LocaleTextCalendarClass · 0.85
TextCalendarClass · 0.85
formatyearpageMethod · 0.80
todayMethod · 0.80
writeFunction · 0.70
add_argument_groupMethod · 0.45

Tested by

no test coverage detected