mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
searx: Styling fixes
- Internet is used instead of 'internet' in Plinth elsewhere. - Use common error messages instead of specific errors to reduce l10n effort. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
0e9d10bff5
commit
f054703d3a
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- mode: python -*-
|
||||
#
|
||||
# This file is part of Plinth.
|
||||
#
|
||||
@ -38,10 +37,10 @@ def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
|
||||
|
||||
subparsers.add_parser('enable', help='Enable searx')
|
||||
subparsers.add_parser('disable', help='Disable searx')
|
||||
subparsers.add_parser('enable', help='Enable Searx')
|
||||
subparsers.add_parser('disable', help='Disable Searx')
|
||||
subparsers.add_parser(
|
||||
'setup', help="Perform post-installation operations for Searx")
|
||||
'setup', help='Perform post-installation operations for Searx')
|
||||
|
||||
safe_search = subparsers.add_parser(
|
||||
'set-safe-search',
|
||||
@ -106,11 +105,13 @@ def subcommand_get_safe_search(_):
|
||||
|
||||
|
||||
def read_settings():
|
||||
"""Load settings as dictionary from YAML config file."""
|
||||
with open(SETTINGS_FILE, 'rb') as settings_file:
|
||||
return yaml.load(settings_file)
|
||||
|
||||
|
||||
def write_settings(settings):
|
||||
"""Write settings from dictionary to YAML config file."""
|
||||
with open(SETTINGS_FILE, 'w') as settings_file:
|
||||
yaml.dump(settings, settings_file)
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
"""
|
||||
FreedomBox module to configure Searx
|
||||
FreedomBox app to configure Searx.
|
||||
"""
|
||||
|
||||
import os
|
||||
@ -44,7 +44,7 @@ name = _('Searx')
|
||||
short_description = _('Web Search')
|
||||
|
||||
description = [
|
||||
_('Searx is a privacy-respecting internet metasearch engine. '
|
||||
_('Searx is a privacy-respecting Internet metasearch engine. '
|
||||
'It aggregrates and displays results from multiple search engines.'),
|
||||
_('Searx can be used to avoid tracking and profiling by search engines. '
|
||||
'It stores no cookies by default.')
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
"""
|
||||
Plinth form for configuring Searx.
|
||||
Django form for configuring Searx.
|
||||
"""
|
||||
|
||||
from django import forms
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
"""
|
||||
Plinth views for Searx.
|
||||
Django views for Searx.
|
||||
"""
|
||||
|
||||
from django.contrib import messages
|
||||
@ -51,13 +51,10 @@ class SearxServiceView(views.ServiceView):
|
||||
if str(old_data['safe_search']) != form_data['safe_search']:
|
||||
try:
|
||||
actions.superuser_run(
|
||||
'searx',
|
||||
['set-safe-search',
|
||||
str(form_data['safe_search'])])
|
||||
messages.success(self.request,
|
||||
_('Safe search setting updated'))
|
||||
'searx', ['set-safe-search', form_data['safe_search']])
|
||||
messages.success(self.request, _('Configuration updated.'))
|
||||
except ActionError as e:
|
||||
messages.error(self.request,
|
||||
_('Failed to update safe search setting'))
|
||||
_('An error occurred during configuration.'))
|
||||
|
||||
return super().form_valid(form)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user