From 511c957ecec39d80f0df79a76cb0754c3befe999 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 18 Oct 2017 17:25:33 +0530 Subject: [PATCH] matrixsynapse: Minor PEP8 fixes Signed-off-by: Sunil Mohan Adapa --- actions/matrixsynapse | 7 +++---- plinth/modules/matrixsynapse/__init__.py | 9 +++++---- plinth/modules/matrixsynapse/views.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actions/matrixsynapse b/actions/matrixsynapse index e1065bdba..3ac930f28 100755 --- a/actions/matrixsynapse +++ b/actions/matrixsynapse @@ -22,10 +22,8 @@ Configuration helper for Matrix-Synapse server. """ import argparse -import collections - from ruamel.yaml import round_trip_dump, round_trip_load -from ruamel.yaml.scalarstring import DoubleQuotedScalarString as __ +from ruamel.yaml.scalarstring import DoubleQuotedScalarString from plinth import action_utils from plinth.modules.matrixsynapse import CONFIG_FILE_PATH @@ -63,7 +61,8 @@ def subcommand_post_install(_): listener['bind_address'] = '0.0.0.0' # Setup ldap parameters - config.insert(0, 'password_providers', [{}]) + __ = DoubleQuotedScalarString + config['password_providers'] = [{}] config['password_providers'][0]['module'] = __( 'ldap_auth_provider.LdapAuthProvider') ldap_config = { diff --git a/plinth/modules/matrixsynapse/__init__.py b/plinth/modules/matrixsynapse/__init__.py index cb7085004..1bd0a0cb8 100644 --- a/plinth/modules/matrixsynapse/__init__.py +++ b/plinth/modules/matrixsynapse/__init__.py @@ -48,8 +48,8 @@ description = [ 'server implementing the Matrix protocol. It provides chat groups, ' 'audio/video calls, end-to-end encryption, multiple device ' 'synchronization and does not require phone numbers to work. Users on a ' - 'given Matrix server can converse with users on all other Matrix servers ' - 'via federation.'), + 'given Matrix server can converse with users on all other Matrix ' + 'servers via federation.'), _('To communicate, you can use the ' 'available clients ' @@ -64,10 +64,12 @@ logger = logging.getLogger(__name__) SERVER_NAME_PATH = "/etc/matrix-synapse/conf.d/server_name.yaml" CONFIG_FILE_PATH = '/etc/matrix-synapse/homeserver.yaml' + def init(): """Initialize the matrix-synapse module.""" menu = main_menu.get('apps') - menu.add_urlname(name, 'glyphicon-comment', 'matrixsynapse:index', short_description) + menu.add_urlname(name, 'glyphicon-comment', 'matrixsynapse:index', + short_description) global service setup_helper = globals()['setup_helper'] @@ -156,4 +158,3 @@ def get_public_registration_status(): output = actions.superuser_run('matrixsynapse', ['public_registration', 'status']) return output.strip() == 'enabled' - diff --git a/plinth/modules/matrixsynapse/views.py b/plinth/modules/matrixsynapse/views.py index 1ed11cce7..e9a65beaf 100644 --- a/plinth/modules/matrixsynapse/views.py +++ b/plinth/modules/matrixsynapse/views.py @@ -94,7 +94,7 @@ class MatrixSynapseServiceView(ServiceView): new_config = form.cleaned_data app_same = old_config['is_enabled'] == new_config['is_enabled'] pubreg_same = old_config['enable_public_registration'] == \ - new_config['enable_public_registration'] + new_config['enable_public_registration'] if app_same and pubreg_same: # TODO: find a more reliable/official way to check whether the