mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
matrixsynapse: Minor PEP8 fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
9ba3d4b104
commit
511c957ece
@ -22,10 +22,8 @@ Configuration helper for Matrix-Synapse server.
|
|||||||
"""
|
"""
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
import collections
|
|
||||||
|
|
||||||
from ruamel.yaml import round_trip_dump, round_trip_load
|
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 import action_utils
|
||||||
from plinth.modules.matrixsynapse import CONFIG_FILE_PATH
|
from plinth.modules.matrixsynapse import CONFIG_FILE_PATH
|
||||||
|
|
||||||
@ -63,7 +61,8 @@ def subcommand_post_install(_):
|
|||||||
listener['bind_address'] = '0.0.0.0'
|
listener['bind_address'] = '0.0.0.0'
|
||||||
|
|
||||||
# Setup ldap parameters
|
# Setup ldap parameters
|
||||||
config.insert(0, 'password_providers', [{}])
|
__ = DoubleQuotedScalarString
|
||||||
|
config['password_providers'] = [{}]
|
||||||
config['password_providers'][0]['module'] = __(
|
config['password_providers'][0]['module'] = __(
|
||||||
'ldap_auth_provider.LdapAuthProvider')
|
'ldap_auth_provider.LdapAuthProvider')
|
||||||
ldap_config = {
|
ldap_config = {
|
||||||
|
|||||||
@ -48,8 +48,8 @@ description = [
|
|||||||
'server implementing the Matrix protocol. It provides chat groups, '
|
'server implementing the Matrix protocol. It provides chat groups, '
|
||||||
'audio/video calls, end-to-end encryption, multiple device '
|
'audio/video calls, end-to-end encryption, multiple device '
|
||||||
'synchronization and does not require phone numbers to work. Users on a '
|
'synchronization and does not require phone numbers to work. Users on a '
|
||||||
'given Matrix server can converse with users on all other Matrix servers '
|
'given Matrix server can converse with users on all other Matrix '
|
||||||
'via federation.'),
|
'servers via federation.'),
|
||||||
|
|
||||||
_('To communicate, you can use the '
|
_('To communicate, you can use the '
|
||||||
'<a href="https://matrix.org/docs/projects/">available clients</a> '
|
'<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"
|
SERVER_NAME_PATH = "/etc/matrix-synapse/conf.d/server_name.yaml"
|
||||||
CONFIG_FILE_PATH = '/etc/matrix-synapse/homeserver.yaml'
|
CONFIG_FILE_PATH = '/etc/matrix-synapse/homeserver.yaml'
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
"""Initialize the matrix-synapse module."""
|
"""Initialize the matrix-synapse module."""
|
||||||
menu = main_menu.get('apps')
|
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
|
global service
|
||||||
setup_helper = globals()['setup_helper']
|
setup_helper = globals()['setup_helper']
|
||||||
@ -156,4 +158,3 @@ def get_public_registration_status():
|
|||||||
output = actions.superuser_run('matrixsynapse', ['public_registration',
|
output = actions.superuser_run('matrixsynapse', ['public_registration',
|
||||||
'status'])
|
'status'])
|
||||||
return output.strip() == 'enabled'
|
return output.strip() == 'enabled'
|
||||||
|
|
||||||
|
|||||||
@ -94,7 +94,7 @@ class MatrixSynapseServiceView(ServiceView):
|
|||||||
new_config = form.cleaned_data
|
new_config = form.cleaned_data
|
||||||
app_same = old_config['is_enabled'] == new_config['is_enabled']
|
app_same = old_config['is_enabled'] == new_config['is_enabled']
|
||||||
pubreg_same = old_config['enable_public_registration'] == \
|
pubreg_same = old_config['enable_public_registration'] == \
|
||||||
new_config['enable_public_registration']
|
new_config['enable_public_registration']
|
||||||
|
|
||||||
if app_same and pubreg_same:
|
if app_same and pubreg_same:
|
||||||
# TODO: find a more reliable/official way to check whether the
|
# TODO: find a more reliable/official way to check whether the
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user