1
0
mirror of https://github.com/django/django.git synced 2025-08-20 16:59:12 +00:00

Refs #36500 -- Corrected rewrapped long lines fixed via a script.

Manually reformatted some comments and docstrings where autofix_w505.py
changed the meaning of the formatting.
This commit is contained in:
Mike Edmunds 2025-07-22 20:44:22 -07:00 committed by nessita
parent 69a93a88ed
commit 78298b5162
14 changed files with 47 additions and 39 deletions

View File

@ -343,8 +343,7 @@ FORMAT_MODULE_PATH = None
DATE_FORMAT = "N j, Y"
# Default formatting for datetime objects. See all available format strings
# here:
# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
# here: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATETIME_FORMAT = "N j, Y, P"
# Default formatting for time objects. See all available format strings here:
@ -362,8 +361,7 @@ YEAR_MONTH_FORMAT = "F Y"
MONTH_DAY_FORMAT = "F j"
# Default short formatting for date objects. See all available format strings
# here:
# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
# here: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
SHORT_DATE_FORMAT = "m/d/Y"
# Default short formatting for datetime objects.

View File

@ -181,8 +181,7 @@ class GEOSCoordSeq(GEOSBase):
def kml(self):
"Return the KML representation for the coordinates."
# Getting the substitution string depending on whether the coordinates
# have
# a Z dimension.
# have a Z dimension.
if self.hasz:
substr = "%s,%s,%s "
else:

View File

@ -58,8 +58,7 @@ def load_geos():
# Getting the GEOS C library. The C interface (CDLL) is used for
# both *NIX and Windows.
# See the GEOS C API source code for more details on the library function
# calls:
# https://libgeos.org/doxygen/geos__c_8h_source.html
# calls: https://libgeos.org/doxygen/geos__c_8h_source.html
_lgeos = CDLL(lib_path)
# Here we set up the prototypes for the initGEOS_r and finishGEOS_r
# routines. These functions aren't actually called until they are

View File

@ -215,8 +215,8 @@ def naturaltime(value):
class NaturalTimeFormatter:
time_strings = {
# Translators: delta will contain a string like '2 months' or '1 month,
# 2 weeks'
# Translators: delta will contain a string like '2 months' or
# '1 month, 2 weeks'
"past-day": gettext_lazy("%(delta)s ago"),
# Translators: please keep a non-breaking space (U+00A0) between count
# and time unit.
@ -248,8 +248,8 @@ class NaturalTimeFormatter:
"an hour from now", "%(count)s hours from now", "count",
),
# fmt: on
# Translators: delta will contain a string like '2 months' or '1 month,
# 2 weeks'
# Translators: delta will contain a string like '2 months' or
# '1 month, 2 weeks'
"future-day": gettext_lazy("%(delta)s from now"),
}
past_substrings = {

View File

@ -370,8 +370,8 @@ class TupleIn(TupleLookupMixin, In):
return super(TupleLookupMixin, self).as_sql(compiler, connection)
# e.g.: (a, b, c) in [(x1, y1, z1), (x2, y2, z2)] as SQL:
# WHERE (a = x1 AND b = y1 AND c = z1) OR (a = x2 AND b = y2 AND c =
# z2)
# WHERE (a = x1 AND b = y1 AND c = z1)
# OR (a = x2 AND b = y2 AND c = z2)
root = WhereNode([], connector=OR)
lhs = self.lhs

View File

@ -756,8 +756,8 @@ class QuerySet(AltersData):
save() on each of the instances, do not send any pre/post_save
signals, and do not set the primary key attribute if it is an
autoincrement field (except if
features.can_return_rows_from_bulk_insert=True). Multi-table models are
not supported.
features.can_return_rows_from_bulk_insert=True).
Multi-table models are not supported.
"""
# When you bulk insert you don't get the primary keys back (if it's an
# autoincrement, except if can_return_rows_from_bulk_insert=True), so
@ -2561,7 +2561,7 @@ def prefetch_one_level(instances, prefetcher, lookup, level):
# of instances, and returns a tuple:
# (queryset of instances of self.model that are related to passed in
# instances,
# instances,
# callable that gets value to be matched for returned instances,
# callable that gets value to be matched for passed in instances,
# boolean that is True for singly related objects,

View File

@ -76,8 +76,8 @@ class Join:
def as_sql(self, compiler, connection):
"""
Generate the full
LEFT OUTER JOIN sometable ON sometable.somecol =
othertable.othercol, params
LEFT OUTER JOIN sometable
ON sometable.somecol = othertable.othercol, params
clause for this join.
"""
join_conditions = []

View File

@ -2635,7 +2635,8 @@ class Query(BaseExpression):
Return a lookup usable for doing outerq.filter(lookup=self) and a
boolean indicating if the joins in the prefix contain a LEFT OUTER
join. _"""
join.
"""
all_paths = []
for _, paths in names_with_path:
all_paths.extend(paths)

View File

@ -1,8 +1,8 @@
"""Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD)
https://pypi.org/project/PyDispatcher/2.0.1/ See license.txt for original
license.
https://pypi.org/project/PyDispatcher/2.0.1/
See license.txt for original license.
Heavily modified for Django's purposes.
"""

View File

@ -29,8 +29,14 @@ class Signal:
Internal attributes:
receivers:
[((id(receiver), id(sender)), ref(receiver), ref(sender),
is_async)]
[
(
(id(receiver), id(sender)),
ref(receiver),
ref(sender),
is_async,
)
]
sender_receivers_cache:
WeakKeyDictionary[sender, list[receiver]]
"""

View File

@ -114,8 +114,8 @@ class BoundField(RenderableFieldMixin):
def as_text(self, attrs=None, **kwargs):
"""
Return a string of HTML for representing this as an <input
type="text">.
Return a string of HTML for representing this as an
<input type="text">.
"""
return self.as_widget(TextInput(), attrs, **kwargs)
@ -125,8 +125,8 @@ class BoundField(RenderableFieldMixin):
def as_hidden(self, attrs=None, **kwargs):
"""
Return a string of HTML for representing this as an <input
type="hidden">.
Return a string of HTML for representing this as an
<input type="hidden">.
"""
return self.as_widget(self.field.hidden_widget(), attrs, **kwargs)

View File

@ -127,17 +127,16 @@ class Field:
# error_messages -- An optional dictionary to override the default
# messages that the field will raise.
# show_hidden_initial -- Boolean that specifies if it is needed to
# render a
# hidden widget with initial value after widget.
# render a hidden widget with initial value
# after widget.
# validators -- List of additional validators to use
# localize -- Boolean that specifies if the field should be localized.
# disabled -- Boolean that specifies whether the field is disabled,
# that
# is its widget is shown in the form but not editable.
# that is its widget is shown in the form but not editable.
# label_suffix -- Suffix to be added to the label. Overrides
# form's label_suffix.
# bound_field_class -- BoundField class to use in
# Field.get_bound_field.
# Field.get_bound_field.
self.required, self.label, self.initial = required, label, initial
self.show_hidden_initial = show_hidden_initial
self.help_text = help_text

View File

@ -2279,9 +2279,14 @@ class BaseEmailBackendTests(MailTestsMixin):
gettext_lazy("test@example.com"),
# RemovedInDjango70Warning: uncomment these cases when support for
# deprecated (name, address) tuples is removed.
# [("nobody", "nobody@example.com"), ("other",
# "other@example.com")], [["nobody", "nobody@example.com"],
# ["other", "other@example.com"]],
# [
# ("nobody", "nobody@example.com"),
# ("other", "other@example.com")
# ],
# [
# ["nobody", "nobody@example.com"],
# ["other", "other@example.com"]
# ],
[("name", "test", "example.com")],
[("Name <test@example.com",)],
[[]],

View File

@ -51,9 +51,10 @@ class ExtraAssertMixin:
:param method: The assertion method to test.
:param method_args: Positional arguments to pass to the method.
:param expected_msg: The expected base error message (required
keyword-only). :param msg_prefix: Optional prefix to be added to the
message in the second subTest. :param method_kwargs: Keyword arguments
to pass to the method.
keyword-only).
:param msg_prefix: Optional prefix to be added to the message in the
second subTest.
:param method_kwargs: Keyword arguments to pass to the method.
Used internally for testing Django's assertions.
"""