From 5afbc397bc279d14fe5228f629abf9f38e52536f Mon Sep 17 00:00:00 2001 From: Frank Loemker Date: Sun, 5 Jan 2020 09:35:49 -0500 Subject: [PATCH] Incorporated review comments: - Switched to Python 3's super() syntax. - Trailing comma for a config set. - Removed unneded (). - Line breaks for some long lines. - Removed "import __future__". --- .../editsection/markdown_extensions.py | 4 ++-- src/wiki/plugins/editsection/views.py | 4 ++-- testproject/testproject/db/prepopulated.db | Bin 377856 -> 377856 bytes tests/plugins/editsection/test_editsection.py | 16 +++++++++------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/wiki/plugins/editsection/markdown_extensions.py b/src/wiki/plugins/editsection/markdown_extensions.py index 08ae4a05..37d4813d 100644 --- a/src/wiki/plugins/editsection/markdown_extensions.py +++ b/src/wiki/plugins/editsection/markdown_extensions.py @@ -11,9 +11,9 @@ class EditSectionExtension(Extension): 'level': [settings.MAX_LEVEL, 'Allow to edit sections till this level'], 'headers': None, # List of FindHeader, all headers with there positions 'location': None, # To be extracted header - 'header_id': None # Header text ID of the to be extracted header + 'header_id': None, # Header text ID of the to be extracted header } - super(EditSectionExtension, self).__init__(**kwargs) + super().__init__(**kwargs) def extendMarkdown(self, md, md_globals): ext = EditSectionProcessor(md) diff --git a/src/wiki/plugins/editsection/views.py b/src/wiki/plugins/editsection/views.py index 14eb37c3..259b3917 100644 --- a/src/wiki/plugins/editsection/views.py +++ b/src/wiki/plugins/editsection/views.py @@ -117,10 +117,10 @@ class EditSection(EditView): kwargs['content'] = request.session.get('editSection_content') self.orig_section = kwargs.get('content') - return super(EditSection, self).dispatch(request, article, *args, **kwargs) + return super().dispatch(request, article, *args, **kwargs) def form_valid(self, form): - super(EditSection, self).form_valid(form) + super().form_valid(form) section = self.article.current_revision.content if not section.endswith("\n"): diff --git a/testproject/testproject/db/prepopulated.db b/testproject/testproject/db/prepopulated.db index 989ee89c714e7148c0dad79c88c1a2297dfdc64b..6d3e7fd9a98da6fae243fe36fd8fbffdfa521358 100644 GIT binary patch delta 751 zcmah{U2D@|6n@_~$y$-g%3$+j1C@!}a5JC%7;M^YZI^1IldNq58!L%xlcw!D+jT7n z+mKOEhTSeAsNmHQK~M_KWM#YdLKuP|_!k5(9fDv~5Wx!%oQvn2=Wxz>&RMN>uhzOB zo<8Bh0e}Snz*EOzz2DpBM27wD*V?lP){Y%)yQX>(cF^#2JjUEm9d}q=R~m1x`P@4- z0$)#TBw#ava5vTio>;DVGy?B#dpgG8SUq^gx;%&4PSNBLNexkfvlKhRFe5BGO#1yS z%ZBZ}dBnT?T|fosJ9Zw6U?x__n%F1!4XE$~c!_lM5x#==;R2|^AnXC}Q3HHMo197M ztj}q4(N@!_1#z?qq7DoX^kD+bsDaXo&s$7Wq)9F3G9{zr&6hJ3gGuI@;?hdkS>b}i zK4&)!BoTxIL07}m@dc~jBsPj@qlh(&IJ|lsivff>0qR8iPTGZBYyGettPNPRHr}mJ z9O+nJ%3MsQDwMwx*9(2+TNARfqJ*YyYsFZUQ%ePL$Y3rShGuD0+f8^W-yl_T+ZlhfsKRng~Cdn7qo{R$@;?d=pP~f{V;oQm)L?kEyDc+lZ)8M delta 405 zcmZqZ5O3%ZpCH92@P~ncv5PIiE#NcmSmge7-pK7 zPZktV-=3Vow1<%e=$A;W%h0Iq$SBUM&&cS=Tac8Ul4cZNoRMf`YNldrW?*2T z;%=1hWSSXaVvrP(q*9uZ9HO1>R_q%XZ0=f`>YtWTRTZi2Tvg#8UY4F85$O@(W*Y9{ z### Title 4[\r\n]*' @@ -52,7 +52,8 @@ class EditSectionTests(RequireRootArticleMixin, DjangoClientTestBase): ) self.assertRegex(response.rendered_content, expected) - url = reverse('wiki:editsection', kwargs={'path': 'testedit/', 'location': '1-2-0', 'header': 'T3'}) + url = reverse('wiki:editsection', + kwargs={'path': 'testedit/', 'location': '1-2-0', 'header': 'T3'}) response = self.client.get(url) expected = ( '>Title 3[\r\n]*' @@ -77,7 +78,8 @@ class EditSectionEditTests(EditSectionEditBase, WebTestBase): title="TestEdit", content=TEST_CONTENT) old_number = urlpath.article.current_revision.revision_number - self.get_literal_url(reverse('wiki:editsection', kwargs={'path': 'testedit/', 'location': '1-2-0', 'header': 'T3'})) + self.get_literal_url(reverse('wiki:editsection', + kwargs={'path': 'testedit/', 'location': '1-2-0', 'header': 'T3'})) self.fill({ '#id_content': '# Header 1\nContent of the new section' }) -- 2.45.2