From f04e1c1657ef22aa9cb203cae66e531fafc41013 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 28 Feb 2016 19:27:49 +0530 Subject: [PATCH] Minor PEP8 & spelling fixes in various modules --- plinth/modules/apps/apps.py | 4 ++-- plinth/modules/config/config.py | 2 +- plinth/modules/firewall/views.py | 2 +- plinth/modules/help/help.py | 1 - plinth/modules/openvpn/views.py | 2 +- plinth/modules/tor/views.py | 2 +- plinth/modules/users/__init__.py | 2 -- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/plinth/modules/apps/apps.py b/plinth/modules/apps/apps.py index 39c77c43f..9d90af549 100644 --- a/plinth/modules/apps/apps.py +++ b/plinth/modules/apps/apps.py @@ -23,8 +23,8 @@ from plinth import cfg def init(): """Initailize the apps module""" - cfg.main_menu.add_urlname(_('Apps'), 'glyphicon-download-alt', 'apps:index', - 80) + cfg.main_menu.add_urlname(_('Apps'), 'glyphicon-download-alt', + 'apps:index', 80) def index(request): diff --git a/plinth/modules/config/config.py b/plinth/modules/config/config.py index 4957589bd..8f75bca2a 100644 --- a/plinth/modules/config/config.py +++ b/plinth/modules/config/config.py @@ -226,7 +226,7 @@ def _apply_changes(request, old_status, new_status): request.session[translation.LANGUAGE_SESSION_KEY] = language except Exception as exception: messages.error(request, _('Error setting language: {exception}') - .format(exception=exception)) + .format(exception=exception)) else: messages.success(request, _('Language changed')) diff --git a/plinth/modules/firewall/views.py b/plinth/modules/firewall/views.py index 3dab988ab..8ed984741 100644 --- a/plinth/modules/firewall/views.py +++ b/plinth/modules/firewall/views.py @@ -26,7 +26,7 @@ import plinth.service as service_module def index(request): - """Serve introcution page""" + """Serve introduction page""" if not firewall.get_enabled_status(): return TemplateResponse(request, 'firewall.html', {'title': firewall.title, diff --git a/plinth/modules/help/help.py b/plinth/modules/help/help.py index 0f8aa3f52..1db714089 100644 --- a/plinth/modules/help/help.py +++ b/plinth/modules/help/help.py @@ -20,7 +20,6 @@ Help module for Plinth. """ import os -from gettext import gettext as _ from django.http import Http404 from django.template.response import TemplateResponse from django.utils.translation import ugettext as _, ugettext_lazy diff --git a/plinth/modules/openvpn/views.py b/plinth/modules/openvpn/views.py index ea1c6aefa..ea460589c 100644 --- a/plinth/modules/openvpn/views.py +++ b/plinth/modules/openvpn/views.py @@ -116,7 +116,7 @@ def _collect_setup_result(request): return_code = setup_process.poll() # Setup process is not complete yet - if return_code == None: + if return_code is None: return if not return_code: diff --git a/plinth/modules/tor/views.py b/plinth/modules/tor/views.py index 58e513a1f..d041c7155 100644 --- a/plinth/modules/tor/views.py +++ b/plinth/modules/tor/views.py @@ -108,7 +108,7 @@ def _collect_config_result(request): return_code = config_process.poll() # Config process is not complete yet - if return_code == None: + if return_code is None: return status = tor.get_status() diff --git a/plinth/modules/users/__init__.py b/plinth/modules/users/__init__.py index b7c6c8ca1..62bb174bc 100644 --- a/plinth/modules/users/__init__.py +++ b/plinth/modules/users/__init__.py @@ -67,5 +67,3 @@ def _diagnose_ldap_entry(search_item): return [_('Check LDAP entry "{search_item}"') .format(search_item=search_item), result] - -