mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1424 from YunoHost/ci-format-dev
[CI] Format code with Black
This commit is contained in:
commit
97e17bbddb
4 changed files with 11 additions and 17 deletions
|
@ -680,7 +680,7 @@ def app_manifest(app):
|
||||||
shutil.rmtree(extracted_app_folder)
|
shutil.rmtree(extracted_app_folder)
|
||||||
|
|
||||||
raw_questions = manifest.get("arguments", {}).get("install", [])
|
raw_questions = manifest.get("arguments", {}).get("install", [])
|
||||||
manifest['arguments']['install'] = hydrate_questions_with_choices(raw_questions)
|
manifest["arguments"]["install"] = hydrate_questions_with_choices(raw_questions)
|
||||||
|
|
||||||
return manifest
|
return manifest
|
||||||
|
|
||||||
|
|
|
@ -111,9 +111,7 @@ def certificate_status(domains, full=False):
|
||||||
return {"certificates": certificates}
|
return {"certificates": certificates}
|
||||||
|
|
||||||
|
|
||||||
def certificate_install(
|
def certificate_install(domain_list, force=False, no_checks=False, self_signed=False):
|
||||||
domain_list, force=False, no_checks=False, self_signed=False
|
|
||||||
):
|
|
||||||
"""
|
"""
|
||||||
Install a Let's Encrypt certificate for given domains (all by default)
|
Install a Let's Encrypt certificate for given domains (all by default)
|
||||||
|
|
||||||
|
@ -231,9 +229,7 @@ def _certificate_install_selfsigned(domain_list, force=False):
|
||||||
operation_logger.error(msg)
|
operation_logger.error(msg)
|
||||||
|
|
||||||
|
|
||||||
def _certificate_install_letsencrypt(
|
def _certificate_install_letsencrypt(domains, force=False, no_checks=False):
|
||||||
domains, force=False, no_checks=False
|
|
||||||
):
|
|
||||||
from yunohost.domain import domain_list, _assert_domain_exists
|
from yunohost.domain import domain_list, _assert_domain_exists
|
||||||
|
|
||||||
if not os.path.exists(ACCOUNT_KEY_FILE):
|
if not os.path.exists(ACCOUNT_KEY_FILE):
|
||||||
|
@ -297,9 +293,7 @@ def _certificate_install_letsencrypt(
|
||||||
operation_logger.success()
|
operation_logger.success()
|
||||||
|
|
||||||
|
|
||||||
def certificate_renew(
|
def certificate_renew(domains, force=False, no_checks=False, email=False):
|
||||||
domains, force=False, no_checks=False, email=False
|
|
||||||
):
|
|
||||||
"""
|
"""
|
||||||
Renew Let's Encrypt certificate for given domains (all by default)
|
Renew Let's Encrypt certificate for given domains (all by default)
|
||||||
|
|
||||||
|
|
|
@ -492,6 +492,7 @@ class DomainConfigPanel(ConfigPanel):
|
||||||
filter_key = self.filter_key.split(".") if self.filter_key != "" else []
|
filter_key = self.filter_key.split(".") if self.filter_key != "" else []
|
||||||
if not filter_key or filter_key[0] == "dns":
|
if not filter_key or filter_key[0] == "dns":
|
||||||
from yunohost.dns import _get_registrar_config_section
|
from yunohost.dns import _get_registrar_config_section
|
||||||
|
|
||||||
toml["dns"]["registrar"] = _get_registrar_config_section(self.entity)
|
toml["dns"]["registrar"] = _get_registrar_config_section(self.entity)
|
||||||
|
|
||||||
# FIXME: Ugly hack to save the registar id/value and reinject it in _load_current_values ...
|
# FIXME: Ugly hack to save the registar id/value and reinject it in _load_current_values ...
|
||||||
|
@ -541,17 +542,13 @@ def domain_cert_status(domain_list, full=False):
|
||||||
return certificate_status(domain_list, full)
|
return certificate_status(domain_list, full)
|
||||||
|
|
||||||
|
|
||||||
def domain_cert_install(
|
def domain_cert_install(domain_list, force=False, no_checks=False, self_signed=False):
|
||||||
domain_list, force=False, no_checks=False, self_signed=False
|
|
||||||
):
|
|
||||||
from yunohost.certificate import certificate_install
|
from yunohost.certificate import certificate_install
|
||||||
|
|
||||||
return certificate_install(domain_list, force, no_checks, self_signed)
|
return certificate_install(domain_list, force, no_checks, self_signed)
|
||||||
|
|
||||||
|
|
||||||
def domain_cert_renew(
|
def domain_cert_renew(domain_list, force=False, no_checks=False, email=False):
|
||||||
domain_list, force=False, no_checks=False, email=False
|
|
||||||
):
|
|
||||||
from yunohost.certificate import certificate_renew
|
from yunohost.certificate import certificate_renew
|
||||||
|
|
||||||
return certificate_renew(domain_list, force, no_checks, email)
|
return certificate_renew(domain_list, force, no_checks, email)
|
||||||
|
|
|
@ -1397,11 +1397,14 @@ def ask_questions_and_parse_answers(
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
def hydrate_questions_with_choices(raw_questions: List) -> List:
|
def hydrate_questions_with_choices(raw_questions: List) -> List:
|
||||||
out = []
|
out = []
|
||||||
|
|
||||||
for raw_question in raw_questions:
|
for raw_question in raw_questions:
|
||||||
question = ARGUMENTS_TYPE_PARSERS[raw_question.get("type", "string")](raw_question)
|
question = ARGUMENTS_TYPE_PARSERS[raw_question.get("type", "string")](
|
||||||
|
raw_question
|
||||||
|
)
|
||||||
if question.choices:
|
if question.choices:
|
||||||
raw_question["choices"] = question.choices
|
raw_question["choices"] = question.choices
|
||||||
raw_question["default"] = question.default
|
raw_question["default"] = question.default
|
||||||
|
|
Loading…
Add table
Reference in a new issue