Mercurial > hg
comparison mercurial/hgweb/request.py @ 48946:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | f254fc73d956 |
children | fda5a4b853ab |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
19 from ..utils import ( | 19 from ..utils import ( |
20 urlutil, | 20 urlutil, |
21 ) | 21 ) |
22 | 22 |
23 | 23 |
24 class multidict(object): | 24 class multidict: |
25 """A dict like object that can store multiple values for a key. | 25 """A dict like object that can store multiple values for a key. |
26 | 26 |
27 Used to store parsed request parameters. | 27 Used to store parsed request parameters. |
28 | 28 |
29 This is inspired by WebOb's class of the same name. | 29 This is inspired by WebOb's class of the same name. |
79 def asdictoflists(self): | 79 def asdictoflists(self): |
80 return {k: list(v) for k, v in self._items.items()} | 80 return {k: list(v) for k, v in self._items.items()} |
81 | 81 |
82 | 82 |
83 @attr.s(frozen=True) | 83 @attr.s(frozen=True) |
84 class parsedrequest(object): | 84 class parsedrequest: |
85 """Represents a parsed WSGI request. | 85 """Represents a parsed WSGI request. |
86 | 86 |
87 Contains both parsed parameters as well as a handle on the input stream. | 87 Contains both parsed parameters as well as a handle on the input stream. |
88 """ | 88 """ |
89 | 89 |
353 bodyfh=bodyfh, | 353 bodyfh=bodyfh, |
354 rawenv=env, | 354 rawenv=env, |
355 ) | 355 ) |
356 | 356 |
357 | 357 |
358 class offsettrackingwriter(object): | 358 class offsettrackingwriter: |
359 """A file object like object that is append only and tracks write count. | 359 """A file object like object that is append only and tracks write count. |
360 | 360 |
361 Instances are bound to a callable. This callable is called with data | 361 Instances are bound to a callable. This callable is called with data |
362 whenever a ``write()`` is attempted. | 362 whenever a ``write()`` is attempted. |
363 | 363 |
386 | 386 |
387 def tell(self): | 387 def tell(self): |
388 return self._offset | 388 return self._offset |
389 | 389 |
390 | 390 |
391 class wsgiresponse(object): | 391 class wsgiresponse: |
392 """Represents a response to a WSGI request. | 392 """Represents a response to a WSGI request. |
393 | 393 |
394 A response consists of a status line, headers, and a body. | 394 A response consists of a status line, headers, and a body. |
395 | 395 |
396 Consumers must populate the ``status`` and ``headers`` fields and | 396 Consumers must populate the ``status`` and ``headers`` fields and |