refactor: upgrade code to >=python3.7 (pre-commit)
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2189>
This commit is contained in:
parent
7768ea77a4
commit
8d9946d35a
143 changed files with 454 additions and 582 deletions
|
|
@ -28,7 +28,7 @@ _filters = {}
|
|||
_hooks = {}
|
||||
|
||||
|
||||
class PluginCache(object):
|
||||
class PluginCache:
|
||||
def __init__(self, prefix):
|
||||
self.prefix = prefix
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ def load_settings(name, settings):
|
|||
"text": django_settings.ENV,
|
||||
}
|
||||
values = {}
|
||||
prefix = "FUNKWHALE_PLUGIN_{}".format(name.upper())
|
||||
prefix = f"FUNKWHALE_PLUGIN_{name.upper()}"
|
||||
for s in settings:
|
||||
key = "_".join([prefix, s["name"].upper()])
|
||||
value = mapping[s["type"]](key, default=s.get("default", None))
|
||||
|
|
@ -262,7 +262,7 @@ def get_serializer_from_conf_template(conf, source=False, user=None):
|
|||
self.fields["library"] = LibraryField(actor=user.actor)
|
||||
|
||||
for vname, v in validators.items():
|
||||
setattr(Serializer, "validate_{}".format(vname), v)
|
||||
setattr(Serializer, f"validate_{vname}", v)
|
||||
return Serializer
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import logging.config
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
|
|
@ -170,7 +167,7 @@ else:
|
|||
|
||||
FUNKWHALE_PROTOCOL = FUNKWHALE_PROTOCOL.lower()
|
||||
FUNKWHALE_HOSTNAME = FUNKWHALE_HOSTNAME.lower()
|
||||
FUNKWHALE_URL = "{}://{}".format(FUNKWHALE_PROTOCOL, FUNKWHALE_HOSTNAME)
|
||||
FUNKWHALE_URL = f"{FUNKWHALE_PROTOCOL}://{FUNKWHALE_HOSTNAME}"
|
||||
FUNKWHALE_SPA_HTML_ROOT = env(
|
||||
"FUNKWHALE_SPA_HTML_ROOT", default=FUNKWHALE_URL + "/front/"
|
||||
)
|
||||
|
|
@ -336,7 +333,7 @@ FIXTURE_DIRS = (str(APPS_DIR.path("fixtures")),)
|
|||
# EMAIL
|
||||
# ------------------------------------------------------------------------------
|
||||
DEFAULT_FROM_EMAIL = env(
|
||||
"DEFAULT_FROM_EMAIL", default="Funkwhale <noreply@{}>".format(FUNKWHALE_HOSTNAME)
|
||||
"DEFAULT_FROM_EMAIL", default=f"Funkwhale <noreply@{FUNKWHALE_HOSTNAME}>"
|
||||
)
|
||||
"""
|
||||
The name and email address used to send system emails.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Local settings
|
||||
|
||||
|
|
@ -102,7 +101,7 @@ CSRF_TRUSTED_ORIGINS = [o for o in ALLOWED_HOSTS]
|
|||
REST_FRAMEWORK["DEFAULT_SCHEMA_CLASS"] = "funkwhale_api.schema.CustomAutoSchema"
|
||||
SPECTACULAR_SETTINGS = {
|
||||
"TITLE": "Funkwhale API",
|
||||
"DESCRIPTION": open("Readme.md", "r").read(),
|
||||
"DESCRIPTION": open("Readme.md").read(),
|
||||
"VERSION": funkwhale_version,
|
||||
"SCHEMA_PATH_PREFIX": "/api/(v[0-9])?",
|
||||
"OAUTH_FLOWS": ["authorizationCode"],
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Production Configurations
|
||||
|
||||
|
|
@ -9,7 +8,6 @@ Production Configurations
|
|||
|
||||
|
||||
"""
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from .common import * # noqa
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url
|
||||
from django.conf.urls.static import static
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue