]> git.0d.be Git - chloro.git/commitdiff
trivial: apply new pre-commit hooks
authorFrédéric Péters <fpeters@0d.be>
Sat, 16 Jul 2022 21:27:01 +0000 (23:27 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 16 Jul 2022 21:27:01 +0000 (23:27 +0200)
chloro/monkeypatch.py
chloro/phyll/fields.py
chloro/phyll/migrations/0001_initial.py
chloro/phyll/migrations/0002_auto_20191229_1932.py
chloro/phyll/migrations/0003_note_published.py
chloro/phyll/urls.py
chloro/phyll/views.py
debian/control
setup.py

index c0c71425df778dd51be43adfb6bdd744d89aae92..127dc86fab96a030a744bbb61d586e2e4183d6f6 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.urls import reverse
+import ckeditor.views
+import ckeditor.widgets
+from ckeditor.image import pillow_backend
 from django.forms.utils import flatatt
 from django.template.loader import render_to_string
+from django.urls import reverse
 from django.utils.encoding import force_text
 from django.utils.html import conditional_escape
 from django.utils.safestring import mark_safe
 from django.utils.translation import get_language
 
-import ckeditor.views
-import ckeditor.widgets
-from ckeditor.image import pillow_backend
-
 
 def ckeditor_render(self, name, value, attrs=None, renderer=None):
     if value is None:
index 2ce4b91920430639a975c1b91b94edc77167ba19..7bd2ddbef308b08f3b4f11cc17e8daca42f6e751 100644 (file)
@@ -14,9 +14,8 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.conf import settings
-
 import ckeditor.fields
+from django.conf import settings
 
 
 class RichTextField(ckeditor.fields.RichTextField):
@@ -28,12 +27,12 @@ class RichTextField(ckeditor.fields.RichTextField):
             'external_plugin_resources': self.external_plugin_resources,
         }
         defaults.update(kwargs)
-        return super(RichTextField, self).formfield(**defaults)
+        return super().formfield(**defaults)
 
 
 class RichTextFormField(ckeditor.fields.RichTextFormField):
     def clean(self, value):
-        value = super(RichTextFormField, self).clean(value)
+        value = super().clean(value)
         if settings.LANGUAGE_CODE.startswith('fr-'):
             # apply some basic typographic rules
             value = value.replace('&laquo; ', '«\u202f')
index 32c3af759a105720d2d84375e415218fec4a7c3b..143385d487fdfaf99416ffd4d28ee11d7fed0b9f 100644 (file)
@@ -1,10 +1,9 @@
-# -*- coding: utf-8 -*-
 # Generated by Django 1.11.17 on 2019-12-29 13:29
-from __future__ import unicode_literals
 
-import chloro.phyll.fields
-from django.db import migrations, models
 import taggit.managers
+from django.db import migrations, models
+
+import chloro.phyll.fields
 
 
 class Migration(migrations.Migration):
index 0620b4d2b909948eb9bee906f7434aad9ffce6fe..d9e83e5e2b263687f79c252aad109f8223552b01 100644 (file)
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
 # Generated by Django 1.11.17 on 2019-12-29 18:32
-from __future__ import unicode_literals
 
 from django.db import migrations
 
index 7c5f05e9bf6ab91e0c0ce01528549050ae27dcbc..f13495bbdbfccef9ca3dfee225ba60b48f58289c 100644 (file)
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
 # Generated by Django 1.11.17 on 2019-12-29 18:39
-from __future__ import unicode_literals
 
 from django.db import migrations, models
 
index 6de4516ce7b50e2948e75dca048367360496e789..bc58fbd6420bab467fbe4bd91887785ac13382df 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import ckeditor.views as ckeditor_views
 from django.conf.urls import url
 from django.contrib.admin.views.decorators import staff_member_required
 from django.views.decorators.cache import never_cache
 
-import ckeditor.views as ckeditor_views
-
 from . import views
 
 urlpatterns = [
index e67a1bc6b41a162a006a045e995fe111255f637d..b2fcbe25dc7dd2ea9ffa45af32785d029e1a821d 100644 (file)
@@ -21,13 +21,12 @@ from django.conf import settings
 from django.contrib.syndication.views import Feed
 from django.core.exceptions import PermissionDenied
 from django.core.files.storage import default_storage
-from django.http import HttpResponse, Http404, JsonResponse
+from django.http import Http404, HttpResponse, JsonResponse
 from django.utils.feedgenerator import Atom1Feed
 from django.utils.text import slugify
 from django.views import View
 from django.views.decorators.csrf import csrf_exempt
-from django.views.generic import CreateView, DeleteView, DetailView, ListView, UpdateView, TemplateView
-
+from django.views.generic import CreateView, DeleteView, DetailView, ListView, TemplateView, UpdateView
 from sorl.thumbnail.shortcuts import get_thumbnail
 
 from .models import Note
@@ -49,7 +48,7 @@ class NoteView(DetailView):
                 raise Http404()
         if not note.published and not request.user.is_staff:
             raise PermissionDenied()
-        return super(NoteView, self).get(request, *args, **kwargs)
+        return super().get(request, *args, **kwargs)
 
 
 class NoteEditView(UpdateView):
@@ -83,7 +82,7 @@ class HomeView(TemplateView):
     template_name = 'phyll/home.html'
 
     def get_context_data(self, **kwargs):
-        context = super(HomeView, self).get_context_data(**kwargs)
+        context = super().get_context_data(**kwargs)
         context['posts'] = Note.objects.filter(published=True).order_by('-creation_timestamp')[:5]
         context['recent_changes'] = Note.objects.filter(published=True).order_by('-last_update_timestamp')
         return context
@@ -93,7 +92,7 @@ class ArchivesView(ListView):
     model = Note
 
     def get_queryset(self):
-        qs = super(ArchivesView, self).get_queryset()
+        qs = super().get_queryset()
         if not self.request.user.is_staff:
             qs = qs.filter(published=True)
         return qs
@@ -111,7 +110,7 @@ class ListOnTagView(ListView):
 
 class Atom1FeedWithBaseXml(Atom1Feed):
     def root_attributes(self):
-        root_attributes = super(Atom1FeedWithBaseXml, self).root_attributes()
+        root_attributes = super().root_attributes()
         scheme, netloc, path, params, query, fragment = urllib.parse.urlparse(self.feed['feed_url'])
         root_attributes['xml:base'] = urllib.parse.urlunparse((scheme, netloc, '/', params, query, fragment))
         return root_attributes
@@ -125,7 +124,7 @@ class AtomFeed(Feed):
 
     def get_object(self, request, *args, **kwargs):
         self.sub = kwargs.get('sub', 'default')
-        return super(AtomFeed, self).get_object(request, *args, **kwargs)
+        return super().get_object(request, *args, **kwargs)
 
     def items(self):
         qs = Note.objects.filter(published=True)
index 2d171ec6bb838756c4dbaa10614e2bdb7bcbfb31..09f4c0e8820ab514cc66668f77c1c1526cc48541 100644 (file)
@@ -7,7 +7,7 @@ Build-Depends: debhelper-compat (= 12),
                python3-all,
                python3-django,
                python3-setuptools,
-               sassc
+               sassc,
 Standards-Version: 3.9.1
 
 Package: chloro
index c11cbb80cac10037bcb4b175808628c1c03fc706..01bf6b66b226aee145afb44f04de2b6fc3765fe0 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,17 +1,16 @@
 #! /usr/bin/env python3
-# -*- coding: utf-8 -*-
 
 import os
 import re
 import subprocess
 import sys
-
-from setuptools.command.install_lib import install_lib as _install_lib
+from distutils.cmd import Command
 from distutils.command.build import build as _build
 from distutils.command.sdist import sdist
-from distutils.cmd import Command
 from distutils.spawn import find_executable
-from setuptools import setup, find_packages
+
+from setuptools import find_packages, setup
+from setuptools.command.install_lib import install_lib as _install_lib
 
 
 class eo_sdist(sdist):
@@ -31,7 +30,7 @@ def get_version():
     tag exists, take 0.0- and add the length of the commit log.
     """
     if os.path.exists('VERSION'):
-        with open('VERSION', 'r') as v:
+        with open('VERSION') as v:
             return v.read()
     if os.path.exists('.git'):
         p = subprocess.Popen(