matrixsynapse: Minor PEP8 fixes

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2017-10-18 17:25:33 +05:30
parent 9ba3d4b104
commit 511c957ece
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
3 changed files with 9 additions and 9 deletions

View File

@ -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 = {

View File

@ -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 '
'<a href="https://matrix.org/docs/projects/">available clients</a> '
@ -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'

View File

@ -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