From c737f0dc58556b644cb5f22823bf3534c89357ab Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Mon, 19 Feb 2018 09:34:04 +0100 Subject: [PATCH] Don't inherit from object. It's default in Python 3. --- src/wiki/core/compat.py | 2 +- src/wiki/core/plugins/base.py | 4 ++-- src/wiki/editors/base.py | 2 +- src/wiki/forms.py | 2 +- src/wiki/managers.py | 4 ++-- src/wiki/urls.py | 2 +- tests/base.py | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wiki/core/compat.py b/src/wiki/core/compat.py index 0d653cee..279adf87 100644 --- a/src/wiki/core/compat.py +++ b/src/wiki/core/compat.py @@ -11,7 +11,7 @@ USER_MODEL = getattr(django_settings, 'AUTH_USER_MODEL', 'auth.User') # so we restore that version. # When support for Django < 1.11 is dropped, we should look at using the # new template based rendering, at which point this probably won't be needed at all. -class BuildAttrsCompat(object): +class BuildAttrsCompat: def build_attrs_compat(self, extra_attrs=None, **kwargs): "Helper function for building an attribute dictionary." attrs = self.attrs.copy() diff --git a/src/wiki/core/plugins/base.py b/src/wiki/core/plugins/base.py index 930910f4..b07ea3bf 100644 --- a/src/wiki/core/plugins/base.py +++ b/src/wiki/core/plugins/base.py @@ -13,7 +13,7 @@ plugin's models. """ -class BasePlugin(object): +class BasePlugin: """Plugins should inherit from this""" # Must fill in! @@ -59,7 +59,7 @@ class PluginSidebarFormMixin(forms.ModelForm): pass -class PluginSettingsFormMixin(object): +class PluginSettingsFormMixin: settings_form_headline = _('Settings for plugin') settings_order = 1 settings_write_access = False diff --git a/src/wiki/editors/base.py b/src/wiki/editors/base.py index 5676b975..67164e03 100644 --- a/src/wiki/editors/base.py +++ b/src/wiki/editors/base.py @@ -1,7 +1,7 @@ from django import forms -class BaseEditor(object): +class BaseEditor: """Editors should inherit from this. See wiki.editors for examples.""" diff --git a/src/wiki/forms.py b/src/wiki/forms.py index b1de8485..304474ec 100644 --- a/src/wiki/forms.py +++ b/src/wiki/forms.py @@ -100,7 +100,7 @@ User = get_user_model() Group = apps.get_model(settings.GROUP_MODEL) -class SpamProtectionMixin(object): +class SpamProtectionMixin: """Check a form for spam. Only works if properties 'request' and 'revision_model' are set.""" diff --git a/src/wiki/managers.py b/src/wiki/managers.py index db8b3785..c2434a6b 100644 --- a/src/wiki/managers.py +++ b/src/wiki/managers.py @@ -50,7 +50,7 @@ class ArticleEmptyQuerySet(EmptyQuerySet): return self -class ArticleFkQuerySetMixin(object): +class ArticleFkQuerySetMixin: def can_read(self, user): """Filter objects so only the ones with a user's reading access @@ -86,7 +86,7 @@ class ArticleFkQuerySetMixin(object): return self.filter(article__current_revision__deleted=False) -class ArticleFkEmptyQuerySetMixin(object): +class ArticleFkEmptyQuerySetMixin: def can_read(self, user): return self diff --git a/src/wiki/urls.py b/src/wiki/urls.py index 290abe93..8d257c42 100644 --- a/src/wiki/urls.py +++ b/src/wiki/urls.py @@ -6,7 +6,7 @@ from wiki.core.utils import get_class_from_str from wiki.views import accounts, article, deleted_list -class WikiURLPatterns(object): +class WikiURLPatterns: """ configurator for wiki urls. diff --git a/tests/base.py b/tests/base.py index 596905a4..9ae2560a 100644 --- a/tests/base.py +++ b/tests/base.py @@ -13,7 +13,7 @@ SUPERUSER1_USERNAME = 'admin' SUPERUSER1_PASSWORD = 'secret' -class RequireSuperuserMixin(object): +class RequireSuperuserMixin: def setUp(self): super().setUp() @@ -39,7 +39,7 @@ class TestBase(RequireBasicData, TestCase): pass -class RequireRootArticleMixin(object): +class RequireRootArticleMixin: def setUp(self): super().setUp() @@ -100,7 +100,7 @@ class SeleniumBase(WebTestCommonMixin, django_functest.FuncSeleniumMixin, Static pass -class ArticleWebTestUtils(object): +class ArticleWebTestUtils: def get_by_path(self, path): """ -- 2.45.2