From 9f1a408a7ada15571d20281e9fa79d962f1fef82 Mon Sep 17 00:00:00 2001 From: Yax <1949284+kianby@users.noreply.github.com> Date: Sun, 26 Nov 2023 17:51:51 +0100 Subject: [PATCH] CQ --- dbmigration/create_empty_db.py | 2 +- dbmigration/migrate_from_1.1_to_2.0.py | 2 +- src/stacosys/db/dao.py | 2 +- src/stacosys/model/comment.py | 2 +- src/stacosys/model/email.py | 2 +- src/stacosys/run.py | 2 +- src/stacosys/service/configuration.py | 9 +++++---- src/stacosys/service/rssfeed.py | 2 +- tests/test_api.py | 2 +- tests/test_config.py | 2 +- tests/test_db.py | 2 +- tests/test_form.py | 2 +- tests/test_mail.py | 2 +- tests/test_rssfeed.py | 2 +- 14 files changed, 18 insertions(+), 17 deletions(-) diff --git a/dbmigration/create_empty_db.py b/dbmigration/create_empty_db.py index 50bd0f2..43a317c 100644 --- a/dbmigration/create_empty_db.py +++ b/dbmigration/create_empty_db.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import sqlite3 diff --git a/dbmigration/migrate_from_1.1_to_2.0.py b/dbmigration/migrate_from_1.1_to_2.0.py index f63112e..e4618c8 100644 --- a/dbmigration/migrate_from_1.1_to_2.0.py +++ b/dbmigration/migrate_from_1.1_to_2.0.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import sqlite3 diff --git a/src/stacosys/db/dao.py b/src/stacosys/db/dao.py index 7d9abdb..307e439 100644 --- a/src/stacosys/db/dao.py +++ b/src/stacosys/db/dao.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- # pylint: disable=singleton-comparison diff --git a/src/stacosys/model/comment.py b/src/stacosys/model/comment.py index 41688a5..999b5a4 100644 --- a/src/stacosys/model/comment.py +++ b/src/stacosys/model/comment.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- from dataclasses import dataclass diff --git a/src/stacosys/model/email.py b/src/stacosys/model/email.py index e67fecf..fad2336 100644 --- a/src/stacosys/model/email.py +++ b/src/stacosys/model/email.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- from dataclasses import dataclass diff --git a/src/stacosys/run.py b/src/stacosys/run.py index 9cf26cd..eb90a09 100644 --- a/src/stacosys/run.py +++ b/src/stacosys/run.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import argparse diff --git a/src/stacosys/service/configuration.py b/src/stacosys/service/configuration.py index ef348e9..8cba173 100644 --- a/src/stacosys/service/configuration.py +++ b/src/stacosys/service/configuration.py @@ -35,12 +35,13 @@ class Config: def load(self, config_pathname): self._cfg.read(config_pathname) - def _split_key(self, key: ConfigParameter): + @staticmethod + def _split_key(key: ConfigParameter): section, param = str(key.value).split(".") if not param: param = section section = "" - return (section, param) + return section, param def exists(self, key: ConfigParameter): section, param = self._split_key(key) @@ -77,8 +78,8 @@ class Config: def check(self): for key in ConfigParameter: if not self.get(key): - return (False, key.value) - return (True, None) + return False, key.value + return True, None def __repr__(self): dict_repr = {} diff --git a/src/stacosys/service/rssfeed.py b/src/stacosys/service/rssfeed.py index dd3c3d5..069448f 100644 --- a/src/stacosys/service/rssfeed.py +++ b/src/stacosys/service/rssfeed.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- from datetime import datetime diff --git a/tests/test_api.py b/tests/test_api.py index 6badcbd..6e27120 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import json diff --git a/tests/test_config.py b/tests/test_config.py index ae173c2..057f052 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import pytest diff --git a/tests/test_db.py b/tests/test_db.py index f82b389..68d6f83 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import time diff --git a/tests/test_form.py b/tests/test_form.py index 9244483..d27b89e 100644 --- a/tests/test_form.py +++ b/tests/test_form.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging diff --git a/tests/test_mail.py b/tests/test_mail.py index 9f9597f..992845f 100644 --- a/tests/test_mail.py +++ b/tests/test_mail.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- import pytest diff --git a/tests/test_rssfeed.py b/tests/test_rssfeed.py index 021fc1e..e2a15b9 100644 --- a/tests/test_rssfeed.py +++ b/tests/test_rssfeed.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: UTF-8 -*- from stacosys.service import rss