OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 | 2 |
3 from .structures import LookupDict | 3 from .structures import LookupDict |
4 | 4 |
5 _codes = { | 5 _codes = { |
6 | 6 |
7 # Informational. | 7 # Informational. |
8 100: ('continue',), | 8 100: ('continue',), |
9 101: ('switching_protocols',), | 9 101: ('switching_protocols',), |
10 102: ('processing',), | 10 102: ('processing',), |
11 103: ('checkpoint',), | 11 103: ('checkpoint',), |
12 122: ('uri_too_long', 'request_uri_too_long'), | 12 122: ('uri_too_long', 'request_uri_too_long'), |
13 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/', '✓'), | 13 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/', '✓'), |
14 201: ('created',), | 14 201: ('created',), |
15 202: ('accepted',), | 15 202: ('accepted',), |
16 203: ('non_authoritative_info', 'non_authoritative_information'), | 16 203: ('non_authoritative_info', 'non_authoritative_information'), |
17 204: ('no_content',), | 17 204: ('no_content',), |
18 205: ('reset_content', 'reset'), | 18 205: ('reset_content', 'reset'), |
19 206: ('partial_content', 'partial'), | 19 206: ('partial_content', 'partial'), |
20 207: ('multi_status', 'multiple_status', 'multi_stati', 'multiple_stati'), | 20 207: ('multi_status', 'multiple_status', 'multi_stati', 'multiple_stati'), |
21 208: ('im_used',), | 21 208: ('already_reported',), |
| 22 226: ('im_used',), |
22 | 23 |
23 # Redirection. | 24 # Redirection. |
24 300: ('multiple_choices',), | 25 300: ('multiple_choices',), |
25 301: ('moved_permanently', 'moved', '\\o-'), | 26 301: ('moved_permanently', 'moved', '\\o-'), |
26 302: ('found',), | 27 302: ('found',), |
27 303: ('see_other', 'other'), | 28 303: ('see_other', 'other'), |
28 304: ('not_modified',), | 29 304: ('not_modified',), |
29 305: ('use_proxy',), | 30 305: ('use_proxy',), |
30 306: ('switch_proxy',), | 31 306: ('switch_proxy',), |
31 307: ('temporary_redirect', 'temporary_moved', 'temporary'), | 32 307: ('temporary_redirect', 'temporary_moved', 'temporary'), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 510: ('not_extended',), | 79 510: ('not_extended',), |
79 } | 80 } |
80 | 81 |
81 codes = LookupDict(name='status_codes') | 82 codes = LookupDict(name='status_codes') |
82 | 83 |
83 for (code, titles) in list(_codes.items()): | 84 for (code, titles) in list(_codes.items()): |
84 for title in titles: | 85 for title in titles: |
85 setattr(codes, title, code) | 86 setattr(codes, title, code) |
86 if not title.startswith('\\'): | 87 if not title.startswith('\\'): |
87 setattr(codes, title.upper(), code) | 88 setattr(codes, title.upper(), code) |
OLD | NEW |