Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-69714: Makecalendar module fully tested#93655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from26 commits
cb0523e78935da0dd632169c8f4fa96786c636b4e1238c527b850c92ab069a4f1febfce9e8825827e664d28e2e4bbdc3938914cdc68adf6940e0da32b6f1f964cb0292b2c8ef8b7bc06de21a51ab5a50815588450aa0cafe73fc9e5b094ae87feac081d09b2File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -555,8 +555,6 @@ def __enter__(self): | ||
| _locale.setlocale(_locale.LC_TIME, self.locale) | ||
| def __exit__(self, *args): | ||
bxsx marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| _locale.setlocale(_locale.LC_TIME, self.oldlocale) | ||
| @@ -660,7 +658,7 @@ def timegm(tuple): | ||
| return seconds | ||
| def main(args=None): | ||
bxsx marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| import argparse | ||
| parser = argparse.ArgumentParser() | ||
| textgroup = parser.add_argument_group('text only arguments') | ||
| @@ -717,7 +715,7 @@ def main(args): | ||
| help="month number (1-12, text only)" | ||
| ) | ||
| options = parser.parse_args(args) | ||
| if options.locale and not options.encoding: | ||
| parser.error("if --locale is specified --encoding is required") | ||
| @@ -726,6 +724,9 @@ def main(args): | ||
| locale = options.locale, options.encoding | ||
| if options.type == "html": | ||
| if options.month: | ||
StanFromIreland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| parser.error("incorrect number of arguments") | ||
bxsx marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| sys.exit(1) | ||
bxsx marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| if options.locale: | ||
| cal = LocaleHTMLCalendar(locale=locale) | ||
| else: | ||
| @@ -737,11 +738,8 @@ def main(args): | ||
| write = sys.stdout.buffer.write | ||
| if options.year is None: | ||
| write(cal.formatyearpage(datetime.date.today().year, **optdict)) | ||
| else: | ||
| write(cal.formatyearpage(options.year, **optdict)) | ||
| else: | ||
| if options.locale: | ||
| cal = LocaleTextCalendar(locale=locale) | ||
| @@ -765,4 +763,4 @@ def main(args): | ||
| if __name__ == "__main__": | ||
| main() | ||
Uh oh!
There was an error while loading.Please reload this page.