diff --git a/config.py b/config.py index 0bb7add..556e594 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Configuration overrides for settings.py """ diff --git a/config_local_test.py b/config_local_test.py index 2c7d906..534b7c0 100644 --- a/config_local_test.py +++ b/config_local_test.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- # Test configuration to verify LOGS_DIR override LOGS_DIR = "/tmp/ivatar_test_logs" diff --git a/import_libravatar.py b/import_libravatar.py index 424850b..b14c8d8 100644 --- a/import_libravatar.py +++ b/import_libravatar.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """ Import the whole libravatar export """ diff --git a/ivatar/__init__.py b/ivatar/__init__.py index 0649992..2aaa3f8 100644 --- a/ivatar/__init__.py +++ b/ivatar/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Module init """ diff --git a/ivatar/context_processors.py b/ivatar/context_processors.py index 4add854..92457b8 100644 --- a/ivatar/context_processors.py +++ b/ivatar/context_processors.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Default: useful variables for the base page templates. """ diff --git a/ivatar/file_security.py b/ivatar/file_security.py index 0a486b5..0160566 100644 --- a/ivatar/file_security.py +++ b/ivatar/file_security.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ File upload security utilities for ivatar """ diff --git a/ivatar/ivataraccount/__init__.py b/ivatar/ivataraccount/__init__.py index a8a5815..2aaa3f8 100644 --- a/ivatar/ivataraccount/__init__.py +++ b/ivatar/ivataraccount/__init__.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- """ Module init """ + app_label = __name__ # pylint: disable=invalid-name diff --git a/ivatar/ivataraccount/admin.py b/ivatar/ivataraccount/admin.py index adc28cd..5816ec9 100644 --- a/ivatar/ivataraccount/admin.py +++ b/ivatar/ivataraccount/admin.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ Register models in admin """ + from django.contrib import admin from .models import Photo, ConfirmedEmail, UnconfirmedEmail diff --git a/ivatar/ivataraccount/auth.py b/ivatar/ivataraccount/auth.py index a54e579..a5667aa 100644 --- a/ivatar/ivataraccount/auth.py +++ b/ivatar/ivataraccount/auth.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from social_core.backends.open_id_connect import OpenIdConnectAuth from ivatar.ivataraccount.models import ConfirmedEmail, Photo diff --git a/ivatar/ivataraccount/forms.py b/ivatar/ivataraccount/forms.py index b5f686a..0bf2370 100644 --- a/ivatar/ivataraccount/forms.py +++ b/ivatar/ivataraccount/forms.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ Classes for our ivatar.ivataraccount.forms """ + from urllib.parse import urlsplit, urlunsplit from django import forms diff --git a/ivatar/ivataraccount/gravatar.py b/ivatar/ivataraccount/gravatar.py index 23c3703..0097e18 100644 --- a/ivatar/ivataraccount/gravatar.py +++ b/ivatar/ivataraccount/gravatar.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ Helper method to fetch Gravatar image """ + from ssl import SSLError from urllib.request import HTTPError, URLError from ivatar.utils import urlopen diff --git a/ivatar/ivataraccount/migrations/0001_initial.py b/ivatar/ivataraccount/migrations/0001_initial.py index 34bca35..919f7f3 100644 --- a/ivatar/ivataraccount/migrations/0001_initial.py +++ b/ivatar/ivataraccount/migrations/0001_initial.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.5 on 2018-05-07 07:13 from django.conf import settings diff --git a/ivatar/ivataraccount/migrations/0002_openidassociation_openidnonce.py b/ivatar/ivataraccount/migrations/0002_openidassociation_openidnonce.py index 25dbf39..c87c883 100644 --- a/ivatar/ivataraccount/migrations/0002_openidassociation_openidnonce.py +++ b/ivatar/ivataraccount/migrations/0002_openidassociation_openidnonce.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.5 on 2018-05-07 07:23 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0003_auto_20180508_0637.py b/ivatar/ivataraccount/migrations/0003_auto_20180508_0637.py index e27a8b3..ddb361c 100644 --- a/ivatar/ivataraccount/migrations/0003_auto_20180508_0637.py +++ b/ivatar/ivataraccount/migrations/0003_auto_20180508_0637.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.5 on 2018-05-08 06:37 import datetime diff --git a/ivatar/ivataraccount/migrations/0004_auto_20180508_0742.py b/ivatar/ivataraccount/migrations/0004_auto_20180508_0742.py index ca41b29..7b8aeed 100644 --- a/ivatar/ivataraccount/migrations/0004_auto_20180508_0742.py +++ b/ivatar/ivataraccount/migrations/0004_auto_20180508_0742.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.5 on 2018-05-08 07:42 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0005_auto_20180522_1155.py b/ivatar/ivataraccount/migrations/0005_auto_20180522_1155.py index 6db266b..d5aca65 100644 --- a/ivatar/ivataraccount/migrations/0005_auto_20180522_1155.py +++ b/ivatar/ivataraccount/migrations/0005_auto_20180522_1155.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.5 on 2018-05-22 11:55 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0006_auto_20180626_1445.py b/ivatar/ivataraccount/migrations/0006_auto_20180626_1445.py index b69780d..afd85d6 100644 --- a/ivatar/ivataraccount/migrations/0006_auto_20180626_1445.py +++ b/ivatar/ivataraccount/migrations/0006_auto_20180626_1445.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.6 on 2018-06-26 14:45 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0007_auto_20180627_0624.py b/ivatar/ivataraccount/migrations/0007_auto_20180627_0624.py index 1c157bc..eade4d4 100644 --- a/ivatar/ivataraccount/migrations/0007_auto_20180627_0624.py +++ b/ivatar/ivataraccount/migrations/0007_auto_20180627_0624.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.6 on 2018-06-27 06:24 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0008_userpreference.py b/ivatar/ivataraccount/migrations/0008_userpreference.py index d06a7bc..dbc9538 100644 --- a/ivatar/ivataraccount/migrations/0008_userpreference.py +++ b/ivatar/ivataraccount/migrations/0008_userpreference.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # pylint: disable=invalid-name,missing-docstring # Generated by Django 2.0.6 on 2018-07-04 12:32 diff --git a/ivatar/ivataraccount/migrations/0009_auto_20180705_1152.py b/ivatar/ivataraccount/migrations/0009_auto_20180705_1152.py index 32242a3..5568399 100644 --- a/ivatar/ivataraccount/migrations/0009_auto_20180705_1152.py +++ b/ivatar/ivataraccount/migrations/0009_auto_20180705_1152.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.6 on 2018-07-05 11:52 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0010_auto_20180705_1201.py b/ivatar/ivataraccount/migrations/0010_auto_20180705_1201.py index 3987825..07af7fd 100644 --- a/ivatar/ivataraccount/migrations/0010_auto_20180705_1201.py +++ b/ivatar/ivataraccount/migrations/0010_auto_20180705_1201.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.0.6 on 2018-07-05 12:01 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0011_auto_20181107_1550.py b/ivatar/ivataraccount/migrations/0011_auto_20181107_1550.py index f053437..2308c20 100644 --- a/ivatar/ivataraccount/migrations/0011_auto_20181107_1550.py +++ b/ivatar/ivataraccount/migrations/0011_auto_20181107_1550.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.1.3 on 2018-11-07 15:50 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0012_auto_20181107_1732.py b/ivatar/ivataraccount/migrations/0012_auto_20181107_1732.py index a6bd44c..5506f94 100644 --- a/ivatar/ivataraccount/migrations/0012_auto_20181107_1732.py +++ b/ivatar/ivataraccount/migrations/0012_auto_20181107_1732.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.1.3 on 2018-11-07 17:32 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0013_auto_20181203_1421.py b/ivatar/ivataraccount/migrations/0013_auto_20181203_1421.py index 38641bd..af9b522 100644 --- a/ivatar/ivataraccount/migrations/0013_auto_20181203_1421.py +++ b/ivatar/ivataraccount/migrations/0013_auto_20181203_1421.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.1.3 on 2018-12-03 14:21 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0014_auto_20190218_1602.py b/ivatar/ivataraccount/migrations/0014_auto_20190218_1602.py index ca4c0c9..862bf90 100644 --- a/ivatar/ivataraccount/migrations/0014_auto_20190218_1602.py +++ b/ivatar/ivataraccount/migrations/0014_auto_20190218_1602.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 2.1.5 on 2019-02-18 16:02 from django.db import migrations diff --git a/ivatar/ivataraccount/migrations/0015_auto_20200225_0934.py b/ivatar/ivataraccount/migrations/0015_auto_20200225_0934.py index 3446758..5046b13 100644 --- a/ivatar/ivataraccount/migrations/0015_auto_20200225_0934.py +++ b/ivatar/ivataraccount/migrations/0015_auto_20200225_0934.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 3.0.3 on 2020-02-25 09:34 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0016_auto_20210413_0904.py b/ivatar/ivataraccount/migrations/0016_auto_20210413_0904.py index 654c92b..fb90c61 100644 --- a/ivatar/ivataraccount/migrations/0016_auto_20210413_0904.py +++ b/ivatar/ivataraccount/migrations/0016_auto_20210413_0904.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 3.1.7 on 2021-04-13 09:04 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0017_auto_20210528_1314.py b/ivatar/ivataraccount/migrations/0017_auto_20210528_1314.py index 2be8ad1..bfe8111 100644 --- a/ivatar/ivataraccount/migrations/0017_auto_20210528_1314.py +++ b/ivatar/ivataraccount/migrations/0017_auto_20210528_1314.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 3.2.3 on 2021-05-28 13:14 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0018_alter_photo_format.py b/ivatar/ivataraccount/migrations/0018_alter_photo_format.py index da24866..41d1d7e 100644 --- a/ivatar/ivataraccount/migrations/0018_alter_photo_format.py +++ b/ivatar/ivataraccount/migrations/0018_alter_photo_format.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 5.0 on 2024-05-31 15:00 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0019_confirmedemail_bluesky_handle.py b/ivatar/ivataraccount/migrations/0019_confirmedemail_bluesky_handle.py index 61a3083..cae028f 100644 --- a/ivatar/ivataraccount/migrations/0019_confirmedemail_bluesky_handle.py +++ b/ivatar/ivataraccount/migrations/0019_confirmedemail_bluesky_handle.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 5.1.5 on 2025-01-27 10:54 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0020_confirmedopenid_bluesky_handle.py b/ivatar/ivataraccount/migrations/0020_confirmedopenid_bluesky_handle.py index 888fcdd..1d6b75f 100644 --- a/ivatar/ivataraccount/migrations/0020_confirmedopenid_bluesky_handle.py +++ b/ivatar/ivataraccount/migrations/0020_confirmedopenid_bluesky_handle.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 5.1.5 on 2025-01-27 13:33 from django.db import migrations, models diff --git a/ivatar/ivataraccount/migrations/0021_add_performance_indexes.py b/ivatar/ivataraccount/migrations/0021_add_performance_indexes.py index dae5501..7b5a3a5 100644 --- a/ivatar/ivataraccount/migrations/0021_add_performance_indexes.py +++ b/ivatar/ivataraccount/migrations/0021_add_performance_indexes.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated manually for performance optimization from typing import Any, List, Tuple, Optional diff --git a/ivatar/ivataraccount/models.py b/ivatar/ivataraccount/models.py index 61a6487..f88a248 100644 --- a/ivatar/ivataraccount/models.py +++ b/ivatar/ivataraccount/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Our models for ivatar.ivataraccount """ @@ -404,7 +403,7 @@ class ConfirmedEmail(BaseAccountModel): logger.debug("Successfully cleaned up cached page: %s" % cache_key) except Exception as exc: logger.warning( - "Failed to clean up cached page %s: %s" % (cache_key, exc) + "Failed to clean up cached page {}: {}".format(cache_key, exc) ) # Invalidate Bluesky avatar URL cache if bluesky_handle changed @@ -455,9 +454,7 @@ class UnconfirmedEmail(BaseAccountModel): + self.user.username.encode("utf-8") # pylint: disable=no-member ) # pylint: disable=no-member self.verification_key = hash_object.hexdigest() - super(UnconfirmedEmail, self).save( - force_insert, force_update, using, update_fields - ) + super().save(force_insert, force_update, using, update_fields) def send_confirmation_mail(self, url=SECURE_BASE_URL): """ @@ -602,7 +599,7 @@ class ConfirmedOpenId(BaseAccountModel): logger.debug("Successfully cleaned up cached page: %s" % cache_key) except Exception as exc: logger.warning( - "Failed to clean up cached page %s: %s" % (cache_key, exc) + "Failed to clean up cached page {}: {}".format(cache_key, exc) ) # Invalidate Bluesky avatar URL cache if bluesky_handle exists diff --git a/ivatar/ivataraccount/read_libravatar_export.py b/ivatar/ivataraccount/read_libravatar_export.py index 71ff8fb..78de23b 100644 --- a/ivatar/ivataraccount/read_libravatar_export.py +++ b/ivatar/ivataraccount/read_libravatar_export.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Reading libravatar export """ diff --git a/ivatar/ivataraccount/test_auth.py b/ivatar/ivataraccount/test_auth.py index fc78e9f..2f59a45 100644 --- a/ivatar/ivataraccount/test_auth.py +++ b/ivatar/ivataraccount/test_auth.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from unittest import mock from django.test import TestCase diff --git a/ivatar/ivataraccount/test_views.py b/ivatar/ivataraccount/test_views.py index a3fc2b9..ca79849 100644 --- a/ivatar/ivataraccount/test_views.py +++ b/ivatar/ivataraccount/test_views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test our views in ivatar.ivataraccount.views and ivatar.views """ @@ -53,9 +52,9 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods user = None username = random_string() password = random_string() - email = "%s@%s.org" % (username, random_string()) + email = "{}@{}.org".format(username, random_string()) # Dunno why random tld doesn't work, but I'm too lazy now to investigate - openid = "http://%s.%s.%s/" % (username, random_string(), "org") + openid = "http://{}.{}.{}/".format(username, random_string(), "org") first_name = random_string() last_name = random_string() diff --git a/ivatar/ivataraccount/test_views_bluesky.py b/ivatar/ivataraccount/test_views_bluesky.py index 0011737..92aea62 100644 --- a/ivatar/ivataraccount/test_views_bluesky.py +++ b/ivatar/ivataraccount/test_views_bluesky.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test our views in ivatar.ivataraccount.views and ivatar.views """ @@ -37,9 +36,9 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods user = None username = random_string() password = random_string() - email = "%s@%s.%s" % (username, random_string(), random_string(2)) + email = "{}@{}.{}".format(username, random_string(), random_string(2)) # Dunno why random tld doesn't work, but I'm too lazy now to investigate - openid = "http://%s.%s.%s/" % (username, random_string(), "org") + openid = "http://{}.{}.{}/".format(username, random_string(), "org") first_name = random_string() last_name = random_string() bsky_test_account = "libravatar.org" diff --git a/ivatar/ivataraccount/urls.py b/ivatar/ivataraccount/urls.py index ae6a1c4..2163a04 100644 --- a/ivatar/ivataraccount/urls.py +++ b/ivatar/ivataraccount/urls.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ URLs for ivatar.ivataraccount """ + from django.urls import path, re_path from django.contrib.auth.views import LogoutView diff --git a/ivatar/ivataraccount/views.py b/ivatar/ivataraccount/views.py index 3178b86..b664e27 100644 --- a/ivatar/ivataraccount/views.py +++ b/ivatar/ivataraccount/views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ View classes for ivatar/ivataraccount/ """ @@ -140,7 +139,7 @@ class PasswordSetView(SuccessMessageMixin, FormView): success_url = reverse_lazy("profile") def get_form_kwargs(self): - kwargs = super(PasswordSetView, self).get_form_kwargs() + kwargs = super().get_form_kwargs() kwargs["user"] = self.request.user return kwargs @@ -712,7 +711,9 @@ class RemoveUnconfirmedOpenIDView(View): ) openid.delete() messages.success(request, _("ID removed")) - except self.model.DoesNotExist: # pragma: no cover pylint: disable=no-member,line-too-long + except ( + self.model.DoesNotExist + ): # pragma: no cover pylint: disable=no-member,line-too-long messages.error(request, _("ID does not exist")) return HttpResponseRedirect(reverse_lazy("profile")) @@ -766,7 +767,9 @@ class RedirectOpenIDView(View): unconfirmed = self.model.objects.get( # pylint: disable=no-member user=request.user, id=kwargs["openid_id"] ) - except self.model.DoesNotExist: # pragma: no cover pylint: disable=no-member,line-too-long + except ( + self.model.DoesNotExist + ): # pragma: no cover pylint: disable=no-member,line-too-long messages.error(request, _("ID does not exist")) return HttpResponseRedirect(reverse_lazy("profile")) @@ -1321,7 +1324,7 @@ class ExportView(SuccessMessageMixin, TemplateView): def xml_account(user): escaped_username = saxutils.quoteattr(user.username) escaped_password = saxutils.quoteattr(user.password) - return " \n" % ( + return " \n".format( escaped_username, escaped_password, ) @@ -1387,8 +1390,8 @@ class ExportView(SuccessMessageMixin, TemplateView): bytesobj.seek(0) response = HttpResponse(content_type="application/gzip") - response[ - "Content-Disposition" - ] = f'attachment; filename="libravatar-export_{user.username}.xml.gz"' + response["Content-Disposition"] = ( + f'attachment; filename="libravatar-export_{user.username}.xml.gz"' + ) response.write(bytesobj.read()) return response diff --git a/ivatar/middleware.py b/ivatar/middleware.py index ed1017e..86dcd6b 100644 --- a/ivatar/middleware.py +++ b/ivatar/middleware.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Middleware classes """ diff --git a/ivatar/opentelemetry_config.py b/ivatar/opentelemetry_config.py index a803f8f..1c290e7 100644 --- a/ivatar/opentelemetry_config.py +++ b/ivatar/opentelemetry_config.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ OpenTelemetry configuration for ivatar project. diff --git a/ivatar/opentelemetry_middleware.py b/ivatar/opentelemetry_middleware.py index 18fe01f..26d07a1 100644 --- a/ivatar/opentelemetry_middleware.py +++ b/ivatar/opentelemetry_middleware.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ OpenTelemetry middleware and custom instrumentation for ivatar. @@ -94,9 +93,9 @@ class OpenTelemetryMiddleware(MiddlewareMixin): span.set_attributes( { "http.status_code": response.status_code, - "http.response_size": len(response.content) - if hasattr(response, "content") - else 0, + "http.response_size": ( + len(response.content) if hasattr(response, "content") else 0 + ), "http.request.duration": duration, } ) diff --git a/ivatar/settings.py b/ivatar/settings.py index 3c28237..a6c843c 100644 --- a/ivatar/settings.py +++ b/ivatar/settings.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Django settings for ivatar project. """ diff --git a/ivatar/static/css/bootstrap.min.css b/ivatar/static/css/bootstrap.min.css index fcaded2..4980bbf 100644 --- a/ivatar/static/css/bootstrap.min.css +++ b/ivatar/static/css/bootstrap.min.css @@ -260,7 +260,8 @@ th { @font-face { font-family: "Glyphicons Halflings"; src: url(../fonts/glyphicons-halflings-regular.eot); - src: url(../fonts/glyphicons-halflings-regular.eot?#iefix) + src: + url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"), url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"), url(../fonts/glyphicons-halflings-regular.woff) format("woff"), @@ -2651,17 +2652,24 @@ output { border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -webkit-transition: border-color ease-in-out 0.15s, + -webkit-transition: + border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s; - -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; - transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + -o-transition: + border-color ease-in-out 0.15s, + box-shadow ease-in-out 0.15s; + transition: + border-color ease-in-out 0.15s, + box-shadow ease-in-out 0.15s; } .form-control:focus { border-color: #66afe9; outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), + -webkit-box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), + box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); } .form-control::-moz-placeholder { @@ -2923,8 +2931,12 @@ textarea.input-lg { } .has-success .form-control:focus { border-color: #2b542c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + -webkit-box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), + 0 0 6px #67b168; + box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), + 0 0 6px #67b168; } .has-success .input-group-addon { color: #3c763d; @@ -2953,8 +2965,12 @@ textarea.input-lg { } .has-warning .form-control:focus { border-color: #66512c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + -webkit-box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), + 0 0 6px #c0a16b; + box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), + 0 0 6px #c0a16b; } .has-warning .input-group-addon { color: #8a6d3b; @@ -2983,8 +2999,12 @@ textarea.input-lg { } .has-error .form-control:focus { border-color: #843534; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + -webkit-box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), + 0 0 6px #ce8483; + box-shadow: + inset 0 1px 1px rgba(0, 0, 0, 0.075), + 0 0 6px #ce8483; } .has-error .input-group-addon { color: #a94442; @@ -4470,9 +4490,11 @@ textarea.input-group-sm > .input-group-btn > .btn { margin-left: -15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), + -webkit-box-shadow: + inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), + box-shadow: + inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); } @media (min-width: 768px) { diff --git a/ivatar/static/css/libravatar_base.css b/ivatar/static/css/libravatar_base.css index ee98454..c522a3a 100644 --- a/ivatar/static/css/libravatar_base.css +++ b/ivatar/static/css/libravatar_base.css @@ -4,7 +4,9 @@ font-style: normal; font-weight: 300; src: url("../fonts/lato-v15-latin-300.eot"); /* IE9 Compat Modes */ - src: local("Lato Light"), local("Lato-Light"), + src: + local("Lato Light"), + local("Lato-Light"), url("../fonts/LatoLatin-Light.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ url("../fonts/LatoLatin-Light.woff2") format("woff2"), /* Super Modern Browsers */ url("../fonts/LatoLatin-Light.woff") @@ -19,7 +21,9 @@ font-style: normal; font-weight: 400; src: url("../fonts/lato-v15-latin-regular.eot"); /* IE9 Compat Modes */ - src: local("Lato Regular"), local("Lato-Regular"), + src: + local("Lato Regular"), + local("Lato-Regular"), url("../fonts/LatoLatin-Regular.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ url("../fonts/LatoLatin-Regular.woff2") format("woff2"), /* Super Modern Browsers */ url("../fonts/LatoLatin-Regular.woff") @@ -35,7 +39,9 @@ font-style: normal; font-weight: 700; src: url("../fonts/lato-v15-latin-700.eot"); /* IE9 Compat Modes */ - src: local("Lato Bold"), local("Lato-Bold"), + src: + local("Lato Bold"), + local("Lato-Bold"), url("../fonts/LatoLatin-Bold.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ url("../fonts/LatoLatin-Bold.woff2") format("woff2"), /* Super Modern Browsers */ url("../fonts/LatoLatin-Bold.woff") @@ -50,7 +56,9 @@ font-style: normal; font-weight: 400; src: url("../fonts/open-sans-v16-latin-regular.eot"); /* IE9 Compat Modes */ - src: local("Open Sans Regular"), local("OpenSans-Regular"), + src: + local("Open Sans Regular"), + local("OpenSans-Regular"), url("../fonts/open-sans-v16-latin-regular.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ url("../fonts/open-sans-v16-latin-regular.woff2") diff --git a/ivatar/static/js/bootstrap.min.js b/ivatar/static/js/bootstrap.min.js index a8ddadc..34f3b04 100644 --- a/ivatar/static/js/bootstrap.min.js +++ b/ivatar/static/js/bootstrap.min.js @@ -199,8 +199,8 @@ if ("undefined" == typeof jQuery) "number" == typeof b ? e.to(b) : g - ? e[g]() - : f.interval && e.pause().cycle(); + ? e[g]() + : f.interval && e.pause().cycle(); }); } var c = function (b, c) { @@ -278,8 +278,8 @@ if ("undefined" == typeof jQuery) b.to(a); }) : c == a - ? this.pause().cycle() - : this.slide(a > c ? "next" : "prev", this.$items.eq(a)); + ? this.pause().cycle() + : this.slide(a > c ? "next" : "prev", this.$items.eq(a)); }), (c.prototype.pause = function (b) { return ( @@ -1106,12 +1106,12 @@ if ("undefined" == typeof jQuery) "bottom" == h && k.bottom + m > o.bottom ? "top" : "top" == h && k.top - m < o.top - ? "bottom" - : "right" == h && k.right + l > o.width - ? "left" - : "left" == h && k.left - l < o.left - ? "right" - : h), + ? "bottom" + : "right" == h && k.right + l > o.width + ? "left" + : "left" == h && k.left - l < o.left + ? "right" + : h), f.removeClass(n).addClass(h); } var p = this.getCalculatedOffset(h, k, l, m); @@ -1233,10 +1233,10 @@ if ("undefined" == typeof jQuery) return "bottom" == a ? { top: b.top + b.height, left: b.left + b.width / 2 - c / 2 } : "top" == a - ? { top: b.top - d, left: b.left + b.width / 2 - c / 2 } - : "left" == a - ? { top: b.top + b.height / 2 - d / 2, left: b.left - c } - : { top: b.top + b.height / 2 - d / 2, left: b.left + b.width }; + ? { top: b.top - d, left: b.left + b.width / 2 - c / 2 } + : "left" == a + ? { top: b.top + b.height / 2 - d / 2, left: b.left - c } + : { top: b.top + b.height / 2 - d / 2, left: b.left + b.width }; }), (c.prototype.getViewportAdjustedDelta = function (a, b, c, d) { var e = { top: 0, left: 0 }; @@ -1308,8 +1308,8 @@ if ("undefined" == typeof jQuery) ? ((c.inState.click = !c.inState.click), c.isInStateTrue() ? c.enter(c) : c.leave(c)) : c.tip().hasClass("in") - ? c.leave(c) - : c.enter(c); + ? c.leave(c) + : c.enter(c); }), (c.prototype.destroy = function () { var a = this; diff --git a/ivatar/static/js/cropper.min.js b/ivatar/static/js/cropper.min.js index 6f5400c..cc8550d 100644 --- a/ivatar/static/js/cropper.min.js +++ b/ivatar/static/js/cropper.min.js @@ -11,9 +11,10 @@ "object" == typeof exports && "undefined" != typeof module ? (module.exports = e()) : "function" == typeof define && define.amd - ? define(e) - : ((t = "undefined" != typeof globalThis ? globalThis : t || self).Cropper = - e()); + ? define(e) + : ((t = + "undefined" != typeof globalThis ? globalThis : t || self).Cropper = + e()); })(this, function () { "use strict"; function C(e, t) { @@ -48,10 +49,14 @@ : (e[t] = i); }) : Object.getOwnPropertyDescriptors - ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) - : C(Object(n)).forEach(function (t) { - Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(n, t)); - }); + ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(n)) + : C(Object(n)).forEach(function (t) { + Object.defineProperty( + a, + t, + Object.getOwnPropertyDescriptor(n, t), + ); + }); } return a; } @@ -107,17 +112,17 @@ return "string" == typeof t ? a(t, e) : "Map" === - (i = - "Object" === - (i = Object.prototype.toString.call(t).slice(8, -1)) && - t.constructor - ? t.constructor.name - : i) || "Set" === i - ? Array.from(t) - : "Arguments" === i || - /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) - ? a(t, e) - : void 0; + (i = + "Object" === + (i = Object.prototype.toString.call(t).slice(8, -1)) && + t.constructor + ? t.constructor.name + : i) || "Set" === i + ? Array.from(t) + : "Arguments" === i || + /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) + ? a(t, e) + : void 0; })(t) || (function () { throw new TypeError( @@ -304,10 +309,10 @@ v(t, e); }) : t.classList - ? t.classList.add(e) - : (i = t.className.trim()) - ? i.indexOf(e) < 0 && (t.className = "".concat(i, " ").concat(e)) - : (t.className = e)); + ? t.classList.add(e) + : (i = t.className.trim()) + ? i.indexOf(e) < 0 && (t.className = "".concat(i, " ").concat(e)) + : (t.className = e)); } function X(t, e) { e && @@ -316,9 +321,9 @@ X(t, e); }) : t.classList - ? t.classList.remove(e) - : 0 <= t.className.indexOf(e) && - (t.className = t.className.replace(e, ""))); + ? t.classList.remove(e) + : 0 <= t.className.indexOf(e) && + (t.className = t.className.replace(e, ""))); } function r(t, e, i) { e && @@ -336,15 +341,15 @@ return o(t[e]) ? t[e] : t.dataset - ? t.dataset[e] - : t.getAttribute("data-".concat(Dt(e))); + ? t.dataset[e] + : t.getAttribute("data-".concat(Dt(e))); } function w(t, e, i) { o(i) ? (t[e] = i) : t.dataset - ? (t.dataset[e] = i) - : t.setAttribute("data-".concat(Dt(e)), i); + ? (t.dataset[e] = i) + : t.setAttribute("data-".concat(Dt(e)), i); } var kt, Ot, @@ -478,8 +483,8 @@ ? (n = t / a) : (t = n * a)) : o - ? (n = t / a) - : h && (t = n * a), + ? (n = t / a) + : h && (t = n * a), { width: t, height: n } ); } @@ -572,8 +577,8 @@ ? (o = t.height * e) : (h = t.width / e) : 3 === i - ? (h = t.width / e) - : (o = t.height * e), + ? (h = t.width / e) + : (o = t.height * e), { aspectRatio: e, naturalWidth: n, @@ -611,11 +616,11 @@ (t ? (t = Math.max(t, s ? o.width : 0)) : i - ? (i = Math.max(i, s ? o.height : 0)) - : s && - ((t = o.width) < (i = o.height) * r - ? (t = i * r) - : (i = t / r))), + ? (i = Math.max(i, s ? o.height : 0)) + : s && + ((t = o.width) < (i = o.height) * r + ? (t = i * r) + : (i = t / r))), (t = (r = R({ aspectRatio: r, width: t, height: i })).width), (i = r.height), (n.minWidth = t), @@ -770,8 +775,8 @@ ? (n = t / c) : (t = n * c) : t - ? (n = t / c) - : n && (t = n * c), + ? (n = t / c) + : n && (t = n * c), i < a * c ? (a = i / c) : (i = a * c)), (r.minWidth = Math.min(t, i)), (r.minHeight = Math.min(n, a)), @@ -1011,8 +1016,8 @@ t.deltaY ? (a = 0 < t.deltaY ? 1 : -1) : t.wheelDelta - ? (a = -t.wheelDelta / 120) - : t.detail && (a = 0 < t.detail ? 1 : -1), + ? (a = -t.wheelDelta / 120) + : t.detail && (a = 0 < t.detail ? 1 : -1), this.zoom(-a * i, t)); }, cropStart: function (t) { @@ -1176,8 +1181,8 @@ u < 0 && g < 0 ? ((d = N), (m -= g = -g), (p -= u = -u)) : u < 0 - ? ((d = W), (p -= u = -u)) - : g < 0 && ((d = H), (m -= g = -g)); + ? ((d = W), (p -= u = -u)) + : g < 0 && ((d = H), (m -= g = -g)); break; case W: if (l) { @@ -1196,8 +1201,8 @@ u < 0 && g < 0 ? ((d = H), (m -= g = -g), (p -= u = -u)) : u < 0 - ? ((d = E), (p -= u = -u)) - : g < 0 && ((d = N), (m -= g = -g)); + ? ((d = E), (p -= u = -u)) + : g < 0 && ((d = N), (m -= g = -g)); break; case N: if (l) { @@ -1216,8 +1221,8 @@ u < 0 && g < 0 ? ((d = E), (m -= g = -g), (p -= u = -u)) : u < 0 - ? ((d = H), (p -= u = -u)) - : g < 0 && ((d = W), (m -= g = -g)); + ? ((d = H), (p -= u = -u)) + : g < 0 && ((d = W), (m -= g = -g)); break; case H: if (l) { @@ -1236,8 +1241,8 @@ u < 0 && g < 0 ? ((d = W), (m -= g = -g), (p -= u = -u)) : u < 0 - ? ((d = N), (p -= u = -u)) - : g < 0 && ((d = E), (m -= g = -g)); + ? ((d = N), (p -= u = -u)) + : g < 0 && ((d = E), (m -= g = -g)); break; case q: this.move(D.x, D.y), (M = !1); @@ -1458,9 +1463,9 @@ (r.left -= (h - s) * ((t.pageX - d.left - r.left) / s)), (r.top -= (l - c) * ((t.pageY - d.top - r.top) / c))) : u(e) && p(e.x) && p(e.y) - ? ((r.left -= (h - s) * ((e.x - r.left) / s)), - (r.top -= (l - c) * ((e.y - r.top) / c))) - : ((r.left -= (h - s) / 2), (r.top -= (l - c) / 2)), + ? ((r.left -= (h - s) * ((e.x - r.left) / s)), + (r.top -= (l - c) * ((e.y - r.top) / c))) + : ((r.left -= (h - s) / 2), (r.top -= (l - c) / 2)), (r.width = h), (r.height = l), this.renderCanvas(!0); @@ -1777,13 +1782,13 @@ (v = e) <= -a || g < v ? (C = x = b = v = 0) : v <= 0 - ? ((x = -v), (v = 0), (C = b = Math.min(g, a + v))) - : v <= g && ((x = 0), (C = b = Math.min(a, g - v))), + ? ((x = -v), (v = 0), (C = b = Math.min(g, a + v))) + : v <= g && ((x = 0), (C = b = Math.min(a, g - v))), b <= 0 || w <= -n || f < w ? (D = M = y = w = 0) : w <= 0 - ? ((M = -w), (w = 0), (D = y = Math.min(f, n + w))) - : w <= f && ((M = 0), (D = y = Math.min(n, f - w))), + ? ((M = -w), (w = 0), (D = y = Math.min(f, n + w))) + : w <= f && ((M = 0), (D = y = Math.min(n, f - w))), (B = [v, w, b, y]), 0 < C && 0 < D && B.push(x * (k = c / a), M * k, C * k, D * k), p.drawImage.apply( @@ -2151,12 +2156,12 @@ this.ready ? (this.unbuild(), (this.ready = !1), (this.cropped = !1)) : this.sizing - ? ((this.sizingImage.onload = null), - (this.sizing = !1), - (this.sized = !1)) - : this.reloading - ? ((this.xhr.onabort = null), this.xhr.abort()) - : this.image && this.stop(); + ? ((this.sizingImage.onload = null), + (this.sizing = !1), + (this.sized = !1)) + : this.reloading + ? ((this.xhr.onabort = null), this.xhr.abort()) + : this.image && this.stop(); }, }, ]) && A(t.prototype, e), diff --git a/ivatar/static/js/jcrop.js b/ivatar/static/js/jcrop.js index b775957..6acf70a 100644 --- a/ivatar/static/js/jcrop.js +++ b/ivatar/static/js/jcrop.js @@ -115,13 +115,13 @@ return options.disabled ? !1 : "move" !== ord || options.allowMove - ? ((docOffset = getPos($img)), - (btndown = !0), - startDragMode(ord, mouseAbs(e)), - e.stopPropagation(), - e.preventDefault(), - !1) - : !1; + ? ((docOffset = getPos($img)), + (btndown = !0), + startDragMode(ord, mouseAbs(e)), + e.stopPropagation(), + e.preventDefault(), + !1) + : !1; }; } function presize($obj, w, h) { @@ -463,13 +463,13 @@ return options.disabled ? !1 : "move" !== ord || options.allowMove - ? ((docOffset = getPos($img)), - (btndown = !0), - startDragMode(ord, mouseAbs(Touch.cfilter(e)), !0), - e.stopPropagation(), - e.preventDefault(), - !1) - : !1; + ? ((docOffset = getPos($img)), + (btndown = !0), + startDragMode(ord, mouseAbs(Touch.cfilter(e)), !0), + e.stopPropagation(), + e.preventDefault(), + !1) + : !1; }; }, newSelection: function (e) { diff --git a/ivatar/static/js/jquery-3.7.1.min.js b/ivatar/static/js/jquery-3.7.1.min.js index 223228e..8a2f71f 100644 --- a/ivatar/static/js/jquery-3.7.1.min.js +++ b/ivatar/static/js/jquery-3.7.1.min.js @@ -56,8 +56,8 @@ return null == e ? e + "" : "object" == typeof e || "function" == typeof e - ? n[i.call(e)] || "object" - : typeof e; + ? n[i.call(e)] || "object" + : typeof e; } var t = "3.7.1", l = /HTML$/i, @@ -90,8 +90,8 @@ return null == e ? ae.call(this) : e < 0 - ? this[e + this.length] - : this[e]; + ? this[e + this.length] + : this[e]; }, pushStack: function (e) { var t = ce.merge(this.constructor(), e); @@ -172,8 +172,8 @@ i && !Array.isArray(n) ? [] : i || ce.isPlainObject(n) - ? n - : {}), + ? n + : {}), (i = !1), (a[t] = ce.extend(l, o, r))) : void 0 !== r && (a[t] = r)); @@ -222,10 +222,10 @@ return 1 === i || 11 === i ? e.textContent : 9 === i - ? e.documentElement.textContent - : 3 === i || 4 === i - ? e.nodeValue - : n; + ? e.documentElement.textContent + : 3 === i || 4 === i + ? e.nodeValue + : n; }, makeArray: function (e, t) { var n = t || []; @@ -666,13 +666,13 @@ ? e === T || (e.ownerDocument == ye && I.contains(ye, e)) ? -1 : t === T || (t.ownerDocument == ye && I.contains(ye, t)) - ? 1 - : o - ? se.call(o, e) - se.call(o, t) - : 0 + ? 1 + : o + ? se.call(o, e) - se.call(o, t) + : 0 : 4 & n - ? -1 - : 1) + ? -1 + : 1) ); })), T @@ -813,17 +813,19 @@ "=" === r ? t === i : "!=" === r - ? t !== i - : "^=" === r - ? i && 0 === t.indexOf(i) - : "*=" === r - ? i && -1 < t.indexOf(i) - : "$=" === r - ? i && t.slice(-i.length) === i - : "~=" === r - ? -1 < (" " + t.replace(v, " ") + " ").indexOf(i) - : "|=" === r && - (t === i || t.slice(0, i.length + 1) === i + "-")); + ? t !== i + : "^=" === r + ? i && 0 === t.indexOf(i) + : "*=" === r + ? i && -1 < t.indexOf(i) + : "$=" === r + ? i && t.slice(-i.length) === i + : "~=" === r + ? -1 < + (" " + t.replace(v, " ") + " ").indexOf(i) + : "|=" === r && + (t === i || + t.slice(0, i.length + 1) === i + "-")); }; }, CHILD: function (d, e, t, h, g) { @@ -894,18 +896,18 @@ return a[S] ? a(o) : 1 < a.length - ? ((t = [e, e, "", o]), - b.setFilters.hasOwnProperty(e.toLowerCase()) - ? F(function (e, t) { - var n, - r = a(e, o), - i = r.length; - while (i--) e[(n = se.call(e, r[i]))] = !(t[n] = r[i]); - }) - : function (e) { - return a(e, 0, t); - }) - : a; + ? ((t = [e, e, "", o]), + b.setFilters.hasOwnProperty(e.toLowerCase()) + ? F(function (e, t) { + var n, + r = a(e, o), + i = r.length; + while (i--) e[(n = se.call(e, r[i]))] = !(t[n] = r[i]); + }) + : function (e) { + return a(e, 0, t); + }) + : a; }, }, pseudos: { @@ -1372,14 +1374,14 @@ return !!n.call(e, t, e) !== r; }) : n.nodeType - ? ce.grep(e, function (e) { - return (e === n) !== r; - }) - : "string" != typeof n - ? ce.grep(e, function (e) { - return -1 < se.call(n, e) !== r; - }) - : ce.filter(n, e, r); + ? ce.grep(e, function (e) { + return (e === n) !== r; + }) + : "string" != typeof n + ? ce.grep(e, function (e) { + return -1 < se.call(n, e) !== r; + }) + : ce.filter(n, e, r); } (ce.filter = function (e, t, n) { var r = t[0]; @@ -1459,10 +1461,10 @@ return e.nodeType ? ((this[0] = e), (this.length = 1), this) : v(e) - ? void 0 !== n.ready - ? n.ready(e) - : e(ce) - : ce.makeArray(e, this); + ? void 0 !== n.ready + ? n.ready(e) + : e(ce) + : ce.makeArray(e, this); }).prototype = ce.fn), (k = ce(C)); var E = /^(?:parents|prev(?:Until|All))/, @@ -1505,8 +1507,8 @@ ? se.call(ce(e), this[0]) : se.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode - ? this.first().prevAll().length - : -1; + ? this.first().prevAll().length + : -1; }, add: function (e, t) { return this.pushStack(ce.uniqueSort(ce.merge(this.get(), ce(e, t)))); @@ -1584,8 +1586,8 @@ e && v((i = e.promise)) ? i.call(e).done(t).fail(n) : e && v((i = e.then)) - ? i.call(e, t, n) - : t.apply(void 0, [e].slice(r)); + ? i.call(e, t, n) + : t.apply(void 0, [e].slice(r)); } catch (e) { n.apply(void 0, [e]); } @@ -1974,8 +1976,8 @@ n = (t = Array.isArray(t) ? t.map(F) : (t = F(t)) in r - ? [t] - : t.match(D) || []).length; + ? [t] + : t.match(D) || []).length; while (n--) delete r[t[n]]; } (void 0 === t || ce.isEmptyObject(r)) && @@ -2005,10 +2007,10 @@ ("null" === i ? null : i === +i + "" - ? +i - : X.test(i) - ? JSON.parse(i) - : i)); + ? +i + : X.test(i) + ? JSON.parse(i) + : i)); } catch (e) {} z.set(e, t, n); } else n = void 0; @@ -2064,8 +2066,8 @@ return void 0 !== (t = z.get(o, n)) ? t : void 0 !== (t = V(o, n)) - ? t - : void 0; + ? t + : void 0; this.each(function () { z.set(this, n, e); }); @@ -2136,12 +2138,12 @@ arguments.length < e ? ce.queue(this[0], t) : void 0 === n - ? this - : this.each(function () { - var e = ce.queue(this, t, n); - ce._queueHooks(this, t), - "fx" === t && "inprogress" !== e[0] && ce.dequeue(this, t); - }) + ? this + : this.each(function () { + var e = ce.queue(this, t, n); + ce._queueHooks(this, t), + "fx" === t && "inprogress" !== e[0] && ce.dequeue(this, t); + }) ); }, dequeue: function (e) { @@ -2293,8 +2295,8 @@ "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName(t || "*") : "undefined" != typeof e.querySelectorAll - ? e.querySelectorAll(t || "*") - : []), + ? e.querySelectorAll(t || "*") + : []), void 0 === t || (t && fe(e, t)) ? ce.merge([e], n) : n ); } @@ -3522,16 +3524,16 @@ (null != e.elem[e.prop] && null == e.elem.style[e.prop]) ? e.elem[e.prop] : (t = ce.css(e.elem, e.prop, "")) && "auto" !== t - ? t - : 0; + ? t + : 0; }, set: function (e) { ce.fx.step[e.prop] ? ce.fx.step[e.prop](e) : 1 !== e.elem.nodeType || - (!ce.cssHooks[e.prop] && null == e.elem.style[Ze(e.prop)]) - ? (e.elem[e.prop] = e.now) - : ce.style(e.elem, e.prop, e.now + e.unit); + (!ce.cssHooks[e.prop] && null == e.elem.style[Ze(e.prop)]) + ? (e.elem[e.prop] = e.now) + : ce.style(e.elem, e.prop, e.now + e.unit); }, }, }).scrollTop = at.propHooks.scrollLeft = @@ -3982,13 +3984,13 @@ ? null === n ? void ce.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) - ? r - : (e.setAttribute(t, n + ""), n) + ? r + : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (r = i.get(e, t)) - ? r - : null == (r = ce.find.attr(e, t)) - ? void 0 - : r); + ? r + : null == (r = ce.find.attr(e, t)) + ? void 0 + : r); }, attrHooks: { type: { @@ -4063,8 +4065,8 @@ ? r : (e[t] = n) : i && "get" in i && null !== (r = i.get(e, t)) - ? r - : e[t] + ? r + : e[t] ); }, propHooks: { @@ -4074,8 +4076,8 @@ return t ? parseInt(t, 10) : bt.test(e.nodeName) || (wt.test(e.nodeName) && e.href) - ? 0 - : -1; + ? 0 + : -1; }, }, }, @@ -4117,16 +4119,17 @@ ce(this).addClass(t.call(this, e, Ct(this))); }) : (e = kt(t)).length - ? this.each(function () { - if ( - ((r = Ct(this)), (n = 1 === this.nodeType && " " + Tt(r) + " ")) - ) { - for (o = 0; o < e.length; o++) - (i = e[o]), n.indexOf(" " + i + " ") < 0 && (n += i + " "); - (a = Tt(n)), r !== a && this.setAttribute("class", a); - } - }) - : this; + ? this.each(function () { + if ( + ((r = Ct(this)), + (n = 1 === this.nodeType && " " + Tt(r) + " ")) + ) { + for (o = 0; o < e.length; o++) + (i = e[o]), n.indexOf(" " + i + " ") < 0 && (n += i + " "); + (a = Tt(n)), r !== a && this.setAttribute("class", a); + } + }) + : this; }, removeClass: function (t) { var e, n, r, i, o, a; @@ -4135,22 +4138,22 @@ ce(this).removeClass(t.call(this, e, Ct(this))); }) : arguments.length - ? (e = kt(t)).length - ? this.each(function () { - if ( - ((r = Ct(this)), - (n = 1 === this.nodeType && " " + Tt(r) + " ")) - ) { - for (o = 0; o < e.length; o++) { - i = e[o]; - while (-1 < n.indexOf(" " + i + " ")) - n = n.replace(" " + i + " ", " "); + ? (e = kt(t)).length + ? this.each(function () { + if ( + ((r = Ct(this)), + (n = 1 === this.nodeType && " " + Tt(r) + " ")) + ) { + for (o = 0; o < e.length; o++) { + i = e[o]; + while (-1 < n.indexOf(" " + i + " ")) + n = n.replace(" " + i + " ", " "); + } + (a = Tt(n)), r !== a && this.setAttribute("class", a); } - (a = Tt(n)), r !== a && this.setAttribute("class", a); - } - }) - : this - : this.attr("class", ""); + }) + : this + : this.attr("class", ""); }, toggleClass: function (t, n) { var e, @@ -4164,23 +4167,24 @@ ce(this).toggleClass(t.call(this, e, Ct(this), n), n); }) : "boolean" == typeof n && s - ? n - ? this.addClass(t) - : this.removeClass(t) - : ((e = kt(t)), - this.each(function () { - if (s) - for (o = ce(this), i = 0; i < e.length; i++) - (r = e[i]), o.hasClass(r) ? o.removeClass(r) : o.addClass(r); - else - (void 0 !== t && "boolean" !== a) || - ((r = Ct(this)) && _.set(this, "__className__", r), - this.setAttribute && - this.setAttribute( - "class", - r || !1 === t ? "" : _.get(this, "__className__") || "", - )); - })); + ? n + ? this.addClass(t) + : this.removeClass(t) + : ((e = kt(t)), + this.each(function () { + if (s) + for (o = ce(this), i = 0; i < e.length; i++) + (r = e[i]), + o.hasClass(r) ? o.removeClass(r) : o.addClass(r); + else + (void 0 !== t && "boolean" !== a) || + ((r = Ct(this)) && _.set(this, "__className__", r), + this.setAttribute && + this.setAttribute( + "class", + r || !1 === t ? "" : _.get(this, "__className__") || "", + )); + })); }, hasClass: function (e) { var t, @@ -4208,11 +4212,11 @@ (null == (t = i ? n.call(this, e, ce(this).val()) : n) ? (t = "") : "number" == typeof t - ? (t += "") - : Array.isArray(t) && - (t = ce.map(t, function (e) { - return null == e ? "" : e + ""; - })), + ? (t += "") + : Array.isArray(t) && + (t = ce.map(t, function (e) { + return null == e ? "" : e + ""; + })), ((r = ce.valHooks[this.type] || ce.valHooks[this.nodeName.toLowerCase()]) && @@ -4221,16 +4225,17 @@ (this.value = t)); })) : t - ? (r = ce.valHooks[t.type] || ce.valHooks[t.nodeName.toLowerCase()]) && - "get" in r && - void 0 !== (e = r.get(t, "value")) - ? e - : "string" == typeof (e = t.value) - ? e.replace(St, "") - : null == e - ? "" - : e - : void 0; + ? (r = + ce.valHooks[t.type] || ce.valHooks[t.nodeName.toLowerCase()]) && + "get" in r && + void 0 !== (e = r.get(t, "value")) + ? e + : "string" == typeof (e = t.value) + ? e.replace(St, "") + : null == e + ? "" + : e + : void 0; }, }), ce.extend({ @@ -4470,10 +4475,10 @@ return null == n ? null : Array.isArray(n) - ? ce.map(n, function (e) { - return { name: t.name, value: e.replace(Lt, "\r\n") }; - }) - : { name: t.name, value: n.replace(Lt, "\r\n") }; + ? ce.map(n, function (e) { + return { name: t.name, value: e.replace(Lt, "\r\n") }; + }) + : { name: t.name, value: n.replace(Lt, "\r\n") }; }) .get(); }, @@ -4826,8 +4831,8 @@ 204 === e || "HEAD" === v.type ? (l = "nocontent") : 304 === e - ? (l = "notmodified") - : ((l = s.state), (o = s.data), (i = !(a = s.error)))) + ? (l = "notmodified") + : ((l = s.state), (o = s.data), (i = !(a = s.error)))) : ((a = l), (!e && l) || ((l = "error"), e < 0 && (e = 0))), (T.status = e), (T.statusText = (t || l) + ""), @@ -4977,18 +4982,18 @@ "abort" === e ? r.abort() : "error" === e - ? "number" != typeof r.status - ? t(0, "error") - : t(r.status, r.statusText) - : t( - Yt[r.status] || r.status, - r.statusText, - "text" !== (r.responseType || "text") || - "string" != typeof r.responseText - ? { binary: r.response } - : { text: r.responseText }, - r.getAllResponseHeaders(), - )); + ? "number" != typeof r.status + ? t(0, "error") + : t(r.status, r.statusText) + : t( + Yt[r.status] || r.status, + r.statusText, + "text" !== (r.responseType || "text") || + "string" != typeof r.responseText + ? { binary: r.response } + : { text: r.responseText }, + r.getAllResponseHeaders(), + )); }; }), (r.onload = o()), @@ -5290,17 +5295,17 @@ ? e["inner" + a] : e.document.documentElement["client" + a] : 9 === e.nodeType - ? ((r = e.documentElement), - Math.max( - e.body["scroll" + a], - r["scroll" + a], - e.body["offset" + a], - r["offset" + a], - r["client" + a], - )) - : void 0 === n - ? ce.css(e, t, i) - : ce.style(e, t, n, i); + ? ((r = e.documentElement), + Math.max( + e.body["scroll" + a], + r["scroll" + a], + e.body["offset" + a], + r["offset" + a], + r["client" + a], + )) + : void 0 === n + ? ce.css(e, t, i) + : ce.style(e, t, n, i); }, s, n ? e : void 0, diff --git a/ivatar/test_auxiliary.py b/ivatar/test_auxiliary.py index b531196..2b4b570 100644 --- a/ivatar/test_auxiliary.py +++ b/ivatar/test_auxiliary.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test various other parts of ivatar/libravatar in order to increase the overall test coverage. Test in here, didn't diff --git a/ivatar/test_file_security.py b/ivatar/test_file_security.py index a4acad7..1df6189 100644 --- a/ivatar/test_file_security.py +++ b/ivatar/test_file_security.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tests for file upload security enhancements """ diff --git a/ivatar/test_opentelemetry.py b/ivatar/test_opentelemetry.py index bc14c7a..6f3c34a 100644 --- a/ivatar/test_opentelemetry.py +++ b/ivatar/test_opentelemetry.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tests for OpenTelemetry integration in ivatar. diff --git a/ivatar/test_static_pages.py b/ivatar/test_static_pages.py index 280679d..45a61eb 100644 --- a/ivatar/test_static_pages.py +++ b/ivatar/test_static_pages.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ Test our views in ivatar.ivataraccount.views and ivatar.views """ + # pylint: disable=too-many-lines import os import django @@ -25,9 +25,9 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods user = None username = random_string() password = random_string() - email = "%s@%s.%s" % (username, random_string(), random_string(2)) + email = "{}@{}.{}".format(username, random_string(), random_string(2)) # Dunno why random tld doesn't work, but I'm too lazy now to investigate - openid = "http://%s.%s.%s/" % (username, random_string(), "org") + openid = "http://{}.{}.{}/".format(username, random_string(), "org") def login(self): """ diff --git a/ivatar/test_utils.py b/ivatar/test_utils.py index 30b017b..a3f2eb7 100644 --- a/ivatar/test_utils.py +++ b/ivatar/test_utils.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test our utils from ivatar.utils """ diff --git a/ivatar/test_views.py b/ivatar/test_views.py index 2049858..73d32ce 100644 --- a/ivatar/test_views.py +++ b/ivatar/test_views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test our views in ivatar.ivataraccount.views and ivatar.views """ @@ -31,9 +30,9 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods user = None username = random_string() password = random_string() - email = "%s@%s.%s" % (username, random_string(), random_string(2)) + email = "{}@{}.{}".format(username, random_string(), random_string(2)) # Dunno why random tld doesn't work, but I'm too lazy now to investigate - openid = "http://%s.%s.%s/" % (username, random_string(), "org") + openid = "http://{}.{}.{}/".format(username, random_string(), "org") def login(self): """ diff --git a/ivatar/test_views_stats.py b/ivatar/test_views_stats.py index 630efbb..49877e6 100644 --- a/ivatar/test_views_stats.py +++ b/ivatar/test_views_stats.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test our StatsView in ivatar.views """ diff --git a/ivatar/test_wsgi.py b/ivatar/test_wsgi.py index 73a33e8..a8b0705 100644 --- a/ivatar/test_wsgi.py +++ b/ivatar/test_wsgi.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ Unit tests for WSGI """ + import unittest import os diff --git a/ivatar/tools/forms.py b/ivatar/tools/forms.py index 5d06894..245b51d 100644 --- a/ivatar/tools/forms.py +++ b/ivatar/tools/forms.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ Classes for our ivatar.tools.forms """ + from django import forms from django.utils.translation import gettext_lazy as _ from django.core.exceptions import ValidationError diff --git a/ivatar/tools/test_views.py b/ivatar/tools/test_views.py index d26da7c..f7a5d8d 100644 --- a/ivatar/tools/test_views.py +++ b/ivatar/tools/test_views.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ Test our views in ivatar.ivataraccount.views and ivatar.views """ + # pylint: disable=too-many-lines import os import django @@ -28,9 +28,9 @@ class Tester(TestCase): # pylint: disable=too-many-public-methods user = None username = random_string() password = random_string() - email = "%s@%s.%s" % (username, random_string(), random_string(2)) + email = "{}@{}.{}".format(username, random_string(), random_string(2)) # Dunno why random tld doesn't work, but I'm too lazy now to investigate - openid = "http://%s.%s.%s/" % (username, random_string(), "org") + openid = "http://{}.{}.{}/".format(username, random_string(), "org") def login(self): """ diff --git a/ivatar/tools/urls.py b/ivatar/tools/urls.py index c8f629f..b0a5381 100644 --- a/ivatar/tools/urls.py +++ b/ivatar/tools/urls.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ ivatar/tools URL configuration """ diff --git a/ivatar/tools/views.py b/ivatar/tools/views.py index 2522d0e..2276a4f 100644 --- a/ivatar/tools/views.py +++ b/ivatar/tools/views.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- """ View classes for ivatar/tools/ """ + from socket import inet_ntop, AF_INET6 import hashlib import random diff --git a/ivatar/urls.py b/ivatar/urls.py index 0457c35..c1ecfe5 100644 --- a/ivatar/urls.py +++ b/ivatar/urls.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ ivatar URL configuration """ diff --git a/ivatar/utils.py b/ivatar/utils.py index dc950d2..7227991 100644 --- a/ivatar/utils.py +++ b/ivatar/utils.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Simple module providing reusable random_string function """ diff --git a/ivatar/views.py b/ivatar/views.py index bea9cbe..319281f 100644 --- a/ivatar/views.py +++ b/ivatar/views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ views under / """ @@ -762,9 +761,9 @@ class StatsView(TemplateView, JsonResponse): ) retval["photo_size_stats"] = { - "average_size_bytes": round(avg_size_bytes, 2) - if avg_size_bytes - else 0, + "average_size_bytes": ( + round(avg_size_bytes, 2) if avg_size_bytes else 0 + ), "average_size_kb": avg_size_kb, "average_size_mb": avg_size_mb, "total_photos_analyzed": photo_count, @@ -839,7 +838,7 @@ def _get_git_info_from_files(): if not path.exists(head_file): return None - with open(head_file, "r") as f: + with open(head_file) as f: head_content = f.read().strip() # Parse HEAD content @@ -851,7 +850,7 @@ def _get_git_info_from_files(): # Read the commit hash from the ref ref_file = path.join(git_dir, branch_ref) if path.exists(ref_file): - with open(ref_file, "r") as f: + with open(ref_file) as f: commit_hash = f.read().strip() else: return None diff --git a/ivatar/wsgi.py b/ivatar/wsgi.py index 883517b..18866fb 100644 --- a/ivatar/wsgi.py +++ b/ivatar/wsgi.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ WSGI config for ivatar project. diff --git a/libravatarproxy.py b/libravatarproxy.py index c9dcca6..248902e 100755 --- a/libravatarproxy.py +++ b/libravatarproxy.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- import urllib.request import sys diff --git a/manage.py b/manage.py index 21b3133..fcd61ac 100755 --- a/manage.py +++ b/manage.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- import os import sys diff --git a/setup.py b/setup.py index 3524089..5b94644 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(