diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-01-26 12:45:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-26 12:45:07 +0100 |
| commit | 305757aec19c9d5111e4d76095ae0acd66163e4b (patch) | |
| tree | 04aa017e66c06b3b19cb466ed4e1d73cd871523d /django/core | |
| parent | 3f6d939c62efd967f548c27a265748cc2cc47ca5 (diff) | |
Applied Black's 2024 stable style.
https://github.com/psf/black/releases/tag/24.1.0
Diffstat (limited to 'django/core')
| -rw-r--r-- | django/core/cache/__init__.py | 1 | ||||
| -rw-r--r-- | django/core/exceptions.py | 1 | ||||
| -rw-r--r-- | django/core/files/images.py | 1 | ||||
| -rw-r--r-- | django/core/files/locks.py | 1 | ||||
| -rw-r--r-- | django/core/files/uploadhandler.py | 1 | ||||
| -rw-r--r-- | django/core/mail/__init__.py | 1 | ||||
| -rw-r--r-- | django/core/mail/backends/console.py | 1 | ||||
| -rw-r--r-- | django/core/mail/backends/locmem.py | 1 | ||||
| -rw-r--r-- | django/core/mail/backends/smtp.py | 1 | ||||
| -rw-r--r-- | django/core/management/base.py | 23 | ||||
| -rw-r--r-- | django/core/serializers/base.py | 1 | ||||
| -rw-r--r-- | django/core/serializers/xml_serializer.py | 1 |
12 files changed, 26 insertions, 8 deletions
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py index eb7fa5b2e9..444d958e68 100644 --- a/django/core/cache/__init__.py +++ b/django/core/cache/__init__.py @@ -12,6 +12,7 @@ object. See docs/topics/cache.txt for information on the public API. """ + from django.core import signals from django.core.cache.backends.base import ( BaseCache, diff --git a/django/core/exceptions.py b/django/core/exceptions.py index 2a2288ff4d..31c18ee7e1 100644 --- a/django/core/exceptions.py +++ b/django/core/exceptions.py @@ -1,6 +1,7 @@ """ Global Django exception and warning classes. """ + import operator from django.utils.hashable import make_hashable diff --git a/django/core/files/images.py b/django/core/files/images.py index 6a603f24fc..7c1532ac8f 100644 --- a/django/core/files/images.py +++ b/django/core/files/images.py @@ -3,6 +3,7 @@ Utility functions for handling images. Requires Pillow as you might imagine. """ + import struct import zlib diff --git a/django/core/files/locks.py b/django/core/files/locks.py index c0f471f87d..a7a7a22dce 100644 --- a/django/core/files/locks.py +++ b/django/core/files/locks.py @@ -16,6 +16,7 @@ Example Usage:: ... locks.lock(f, locks.LOCK_EX) ... f.write('Django') """ + import os __all__ = ("LOCK_EX", "LOCK_SH", "LOCK_NB", "lock", "unlock") diff --git a/django/core/files/uploadhandler.py b/django/core/files/uploadhandler.py index b6c185e8fc..ab86f7fede 100644 --- a/django/core/files/uploadhandler.py +++ b/django/core/files/uploadhandler.py @@ -1,6 +1,7 @@ """ Base file upload handler classes, and the built-in concrete subclasses """ + import os from io import BytesIO diff --git a/django/core/mail/__init__.py b/django/core/mail/__init__.py index dc63e8702c..676326697b 100644 --- a/django/core/mail/__init__.py +++ b/django/core/mail/__init__.py @@ -1,6 +1,7 @@ """ Tools for sending email. """ + from django.conf import settings # Imported for backwards compatibility and for the sake diff --git a/django/core/mail/backends/console.py b/django/core/mail/backends/console.py index ee5dd28504..2d7c778cc1 100644 --- a/django/core/mail/backends/console.py +++ b/django/core/mail/backends/console.py @@ -1,6 +1,7 @@ """ Email backend that writes messages to console instead of sending them. """ + import sys import threading diff --git a/django/core/mail/backends/locmem.py b/django/core/mail/backends/locmem.py index 344350e891..f5473da952 100644 --- a/django/core/mail/backends/locmem.py +++ b/django/core/mail/backends/locmem.py @@ -1,6 +1,7 @@ """ Backend for test environment. """ + import copy from django.core import mail diff --git a/django/core/mail/backends/smtp.py b/django/core/mail/backends/smtp.py index 1ee48269ae..6820148ac1 100644 --- a/django/core/mail/backends/smtp.py +++ b/django/core/mail/backends/smtp.py @@ -1,4 +1,5 @@ """SMTP email backend class.""" + import smtplib import ssl import threading diff --git a/django/core/management/base.py b/django/core/management/base.py index 631c761c00..4c47e1c6e5 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -2,6 +2,7 @@ Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ + import argparse import os import sys @@ -528,9 +529,11 @@ class BaseCommand: if issues: visible_issue_count += len(issues) formatted = ( - self.style.ERROR(str(e)) - if e.is_serious() - else self.style.WARNING(str(e)) + ( + self.style.ERROR(str(e)) + if e.is_serious() + else self.style.WARNING(str(e)) + ) for e in issues ) formatted = "\n".join(sorted(formatted)) @@ -543,11 +546,15 @@ class BaseCommand: if visible_issue_count: footer += "\n" footer += "System check identified %s (%s silenced)." % ( - "no issues" - if visible_issue_count == 0 - else "1 issue" - if visible_issue_count == 1 - else "%s issues" % visible_issue_count, + ( + "no issues" + if visible_issue_count == 0 + else ( + "1 issue" + if visible_issue_count == 1 + else "%s issues" % visible_issue_count + ) + ), len(all_issues) - visible_issue_count, ) diff --git a/django/core/serializers/base.py b/django/core/serializers/base.py index 20dffac05f..1fbca9244b 100644 --- a/django/core/serializers/base.py +++ b/django/core/serializers/base.py @@ -1,6 +1,7 @@ """ Module for abstract serializer/unserializer base classes. """ + from io import StringIO from django.core.exceptions import ObjectDoesNotExist diff --git a/django/core/serializers/xml_serializer.py b/django/core/serializers/xml_serializer.py index 3f9955aa23..16b69770f6 100644 --- a/django/core/serializers/xml_serializer.py +++ b/django/core/serializers/xml_serializer.py @@ -1,6 +1,7 @@ """ XML serializer. """ + import json from xml.dom import pulldom from xml.sax import handler |
