mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Flake8
This commit is contained in:
parent
0a52430186
commit
aeeac12309
3 changed files with 11 additions and 11 deletions
|
@ -36,7 +36,6 @@ import urllib.parse
|
||||||
import tempfile
|
import tempfile
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from moulinette.interfaces.cli import colorize
|
|
||||||
from moulinette import Moulinette, m18n
|
from moulinette import Moulinette, m18n
|
||||||
from moulinette.core import MoulinetteError
|
from moulinette.core import MoulinetteError
|
||||||
from moulinette.utils.log import getActionLogger
|
from moulinette.utils.log import getActionLogger
|
||||||
|
@ -54,7 +53,7 @@ from moulinette.utils.filesystem import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from yunohost.service import service_status, _run_service_command
|
from yunohost.service import service_status, _run_service_command
|
||||||
from yunohost.utils import packages, config
|
from yunohost.utils import packages
|
||||||
from yunohost.utils.config import (
|
from yunohost.utils.config import (
|
||||||
ConfigPanel,
|
ConfigPanel,
|
||||||
parse_args_in_yunohost_format,
|
parse_args_in_yunohost_format,
|
||||||
|
@ -1764,8 +1763,8 @@ def app_config_get(app, key="", mode="classic"):
|
||||||
"""
|
"""
|
||||||
Display an app configuration in classic, full or export mode
|
Display an app configuration in classic, full or export mode
|
||||||
"""
|
"""
|
||||||
config = AppConfigPanel(app)
|
config_ = AppConfigPanel(app)
|
||||||
return config.get(key, mode)
|
return config_.get(key, mode)
|
||||||
|
|
||||||
|
|
||||||
@is_unit_operation()
|
@is_unit_operation()
|
||||||
|
@ -1776,12 +1775,12 @@ def app_config_set(
|
||||||
Apply a new app configuration
|
Apply a new app configuration
|
||||||
"""
|
"""
|
||||||
|
|
||||||
config = AppConfigPanel(app)
|
config_ = AppConfigPanel(app)
|
||||||
|
|
||||||
YunoHostArgumentFormatParser.operation_logger = operation_logger
|
YunoHostArgumentFormatParser.operation_logger = operation_logger
|
||||||
operation_logger.start()
|
operation_logger.start()
|
||||||
|
|
||||||
result = config.set(key, value, args, args_file)
|
result = config_.set(key, value, args, args_file)
|
||||||
if "errors" not in result:
|
if "errors" not in result:
|
||||||
operation_logger.success()
|
operation_logger.success()
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import toml
|
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import shutil
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from moulinette.interfaces.cli import colorize
|
from moulinette.interfaces.cli import colorize
|
||||||
|
@ -37,8 +37,6 @@ from moulinette.utils.filesystem import (
|
||||||
mkdir,
|
mkdir,
|
||||||
)
|
)
|
||||||
|
|
||||||
from yunohost.service import _get_services
|
|
||||||
from yunohost.service import _run_service_command, _get_services
|
|
||||||
from yunohost.utils.i18n import _value_for_locale
|
from yunohost.utils.i18n import _value_for_locale
|
||||||
from yunohost.utils.error import YunohostError, YunohostValidationError
|
from yunohost.utils.error import YunohostError, YunohostValidationError
|
||||||
|
|
||||||
|
@ -144,7 +142,7 @@ class ConfigPanel:
|
||||||
|
|
||||||
if self.errors:
|
if self.errors:
|
||||||
return {
|
return {
|
||||||
"errors": errors,
|
"errors": self.errors,
|
||||||
}
|
}
|
||||||
|
|
||||||
self._reload_services()
|
self._reload_services()
|
||||||
|
@ -290,6 +288,9 @@ class ConfigPanel:
|
||||||
write_to_yaml(self.save_path, self.new_values)
|
write_to_yaml(self.save_path, self.new_values)
|
||||||
|
|
||||||
def _reload_services(self):
|
def _reload_services(self):
|
||||||
|
|
||||||
|
from yunohost.service import _run_service_command, _get_services
|
||||||
|
|
||||||
logger.info("Reloading services...")
|
logger.info("Reloading services...")
|
||||||
services_to_reload = set()
|
services_to_reload = set()
|
||||||
for panel, section, obj in self._iterate(["panel", "section", "option"]):
|
for panel, section, obj in self._iterate(["panel", "section", "option"]):
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
along with this program; if not, see http://www.gnu.org/licenses
|
along with this program; if not, see http://www.gnu.org/licenses
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from moulinette import Moulinette, m18n
|
from moulinette import m18n
|
||||||
|
|
||||||
|
|
||||||
def _value_for_locale(values):
|
def _value_for_locale(values):
|
||||||
|
|
Loading…
Add table
Reference in a new issue