Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Sun, 05 Feb 2023 16:16:19 UTC Commit: 67631dda0483d0311152fb4882bd2dce505da50b https://github.com/geany/www.geany.org/commit/67631dda0483d0311152fb4882bd2d...
Log Message: ----------- Fix linting
Modified Paths: -------------- latest_version/context_processors.py news/views.py pastebin/views.py static_docs/generate_i18n_statistics.py static_docs/github_client.py
Modified: latest_version/context_processors.py 11 lines changed, 6 insertions(+), 5 deletions(-) =================================================================== @@ -45,8 +45,9 @@ def latest_version(request): fallback_version=geany_plugins_latest_version.version) plugins_release_versions = geany_plugins_release_versions_provider.provide()
- return dict( - geany_latest_version=geany_latest_version, - geany_plugins_latest_version=geany_plugins_latest_version, - release_versions=release_versions, - plugins_release_versions=plugins_release_versions) + return { + 'geany_latest_version': geany_latest_version, + 'geany_plugins_latest_version': geany_plugins_latest_version, + 'release_versions': release_versions, + 'plugins_release_versions': plugins_release_versions, + }
Modified: news/views.py 15 lines changed, 8 insertions(+), 7 deletions(-) =================================================================== @@ -60,17 +60,18 @@ def post(self, request, *args, **kwargs): # pylint: disable=unused-argument newspost = NewsPost.objects.get(slug=newspost_slug) except NewsPost.DoesNotExist: error_message = f'News post item for "{newspost_slug}" could not be found' - result = dict(error=error_message) + result = {'error': error_message} else: # adapt to dict user_name = newspost.user.get_full_name() publish_date = date(newspost.publish_date, 'F dS, Y') content = safe(richtext_filters(newspost.content)) - result = dict( - error=None, - title=newspost.title, - content=content, - user=user_name, - publish_date=publish_date) + result = { + 'error': None, + 'title': newspost.title, + 'content': content, + 'user': user_name, + 'publish_date': publish_date, + }
return JsonResponse(result, safe=True)
Modified: pastebin/views.py 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -68,7 +68,7 @@ def get(self, request, snippet_id): snippet = self._fetch_snippet(snippet_id) except SnippetNotFoundError as exc: # 404 response with custom message - context = dict(message=exc) + context = {'message': exc} return TemplateResponse(request, 'errors/404.html', context=context, status=404)
snippet_list_ = _get_snippet_list(no_content=True) @@ -92,8 +92,8 @@ def _fetch_snippet(self, snippet_id): raise SnippetNotFoundError( _('This snippet does not exist anymore. Probably its lifetime is expired.') ) from exc - else: - return snippet + + return snippet
class SnippetDetailRawView(SnippetDetailView):
Modified: static_docs/generate_i18n_statistics.py 14 lines changed, 8 insertions(+), 6 deletions(-) =================================================================== @@ -138,9 +138,10 @@ def _factor_pot_filename(self):
# ---------------------------------------------------------------------- def _execute_command(self, command): - environment = dict( - srcdir=self._source_path, - LANG='C') + environment = { + 'srcdir': self._source_path, + 'LANG': 'C' + } try: output = check_output( command, @@ -242,9 +243,10 @@ def _fetch_message_catalog_stats(self):
# ---------------------------------------------------------------------- def _factor_overall_statistics(self): - self._overall_statistics = dict( - total_statistics=self._pot_stats, - catalog_statistics=self._message_catalogs) + self._overall_statistics = { + 'total_statistics': self._pot_stats, + 'catalog_statistics': self._message_catalogs + }
# add timestamp self._overall_statistics['generated_timestamp'] = time()
Modified: static_docs/github_client.py 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -46,7 +46,7 @@ def get_file_contents(self, filename, user=None, repository=None):
# ---------------------------------------------------------------------- def _request(self, url, status_404_expected=False): - request_args = dict(timeout=HTTP_REQUEST_TIMEOUT, stream=False) + request_args = {'timeout': HTTP_REQUEST_TIMEOUT, 'stream': False} if self._auth_token is not None: authorization_header = self._factor_authorization_header() request_args['headers'] = authorization_header
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).