mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-21 08:56:29 +00:00
style: fix
This commit is contained in:
committed by
Florian BEZANNIER
parent
83ef3d6a57
commit
abd1cf4ebf
@@ -5,7 +5,7 @@ repos:
|
||||
- id: autopep8
|
||||
language: system
|
||||
- repo: https://github.com/PyCQA/prospector
|
||||
rev: v1.10.3 # The version of Prospector to use, if not 'master' for latest
|
||||
rev: v1.16.1 # The version of Prospector to use, if not 'master' for latest
|
||||
hooks:
|
||||
- id: prospector
|
||||
language: system
|
||||
|
||||
@@ -8,7 +8,7 @@ logging.addLevelName(DEBUG_LEVELV_NUM, "DEBUGV")
|
||||
|
||||
|
||||
class CustomLogger(logging.Logger):
|
||||
def _log(self, level, # pylint: disable=too-many-arguments,unused-argument
|
||||
def _log(self, level, # pylint: disable=too-many-arguments,unused-argument,too-many-positional-arguments
|
||||
msg,
|
||||
args,
|
||||
exc_info=None,
|
||||
@@ -21,7 +21,8 @@ class CustomLogger(logging.Logger):
|
||||
exc_info = True
|
||||
super()._log(level, msg, args, exc_info, extra, stack_info, stacklevel)
|
||||
|
||||
def __new_style_log(self, level, msg, args, exc_info=None, extra=None, # pylint: disable=too-many-arguments
|
||||
def __new_style_log(self, level, msg, args, exc_info=None, extra=None,
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
stack_info=False, **kwargs):
|
||||
if kwargs.pop('style', "%") == "{": # optional
|
||||
msg = msg.format(*args)
|
||||
|
||||
@@ -94,7 +94,7 @@ class Oauth2PSACCApiConfig(connected_car_api.Configuration):
|
||||
|
||||
|
||||
class OauthAPIClient(ApiClient):
|
||||
# pylint: disable=no-member,too-many-arguments
|
||||
# pylint: disable=no-member,too-many-arguments,too-many-positional-arguments
|
||||
def call_api(self, resource_path, method,
|
||||
path_params=None, query_params=None, header_params=None,
|
||||
body=None, post_params=None, files=None,
|
||||
|
||||
@@ -59,7 +59,7 @@ class Charging:
|
||||
|
||||
@staticmethod
|
||||
def record_charging(car: Car, charging_status, charge_date: datetime, level, latitude,
|
||||
# pylint: disable=too-many-locals
|
||||
# pylint: disable=too-many-locals,too-many-positional-arguments
|
||||
longitude, country_code, charging_mode, charging_rate, autonomy, mileage):
|
||||
conn = Database.get_db()
|
||||
charge_date = charge_date.replace(microsecond=0)
|
||||
|
||||
@@ -34,7 +34,7 @@ class PSAClient:
|
||||
def connect(self, code: str):
|
||||
self.manager.connect_with_code(code)
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
def __init__(self, refresh_token, client_id, client_secret, remote_refresh_token, customer_id, realm, country_code,
|
||||
brand=None, proxies=None, weather_api=None, abrp=None, co2_signal_api=None):
|
||||
self.realm = realm
|
||||
|
||||
@@ -7,7 +7,7 @@ from ..repository.car_model import CarModelRepository
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
class Car:
|
||||
def __init__(self, vin, vehicle_id, brand, label=None, battery_power=None, fuel_capacity=None,
|
||||
max_elec_consumption=None, max_fuel_consumption=None, abrp_name=None):
|
||||
|
||||
@@ -13,7 +13,7 @@ from psa_car_controller.psa.connected_car_api.models.vehicle_odometer import Veh
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
class CarStatus(Status):
|
||||
def __init__(self, embedded=None, links=None, battery=None, doors_state=None, energy=None, environment=None,
|
||||
ignition=None, kinetic=None, last_position=None, preconditionning=None, privacy=None, safety=None,
|
||||
|
||||
@@ -13,7 +13,7 @@ class ChargingMode(Enum):
|
||||
|
||||
|
||||
class Charge:
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
def __init__(self, start_at: datetime, stop_at: datetime = None, vin=None, start_level=None, end_level=None,
|
||||
co2=None, kw=None, price=None, charging_mode=None, mileage=None):
|
||||
assert isinstance(start_at, datetime)
|
||||
|
||||
@@ -246,7 +246,7 @@ class Database:
|
||||
conn.close()
|
||||
return geo_dumps(feature_collection, sort_keys=True)
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
@staticmethod
|
||||
def record_position(weather_api, vin, mileage, latitude, longitude, altitude, date, level, level_fuel, moving):
|
||||
if mileage == 0: # fix a bug of the api
|
||||
|
||||
@@ -51,7 +51,8 @@ def start_app(*args, **kwargs):
|
||||
run(config_flask(*args, **kwargs))
|
||||
|
||||
|
||||
def config_flask(title, base_path, debug: bool, host, port, reloader=False, # pylint: disable=too-many-arguments
|
||||
def config_flask(title, base_path, debug: bool, host, port, reloader=False,
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
unminified=False, view="psa_car_controller.web.view.views"):
|
||||
global app, dash_app
|
||||
reload_view = app is not None
|
||||
|
||||
@@ -9,7 +9,8 @@ RESPONSE = "-response"
|
||||
|
||||
|
||||
class Button:
|
||||
def __init__(self, role, element_id, label, fct, prevent_initial_call=True): # pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
def __init__(self, role, element_id, label, fct, prevent_initial_call=True):
|
||||
self.role = role
|
||||
self._element_id = element_id
|
||||
self._button_id = "{}-{}".format(self.role, element_id)
|
||||
|
||||
@@ -9,7 +9,7 @@ from psa_car_controller.web.tools.Button import Button
|
||||
|
||||
class Switch(Button):
|
||||
def __init__(self, role, element_id, label, fct, value, prevent_initial_call=True):
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
self.value = value
|
||||
super().__init__(role, element_id, label, fct, prevent_initial_call)
|
||||
|
||||
|
||||
+2
-1
@@ -44,12 +44,13 @@ scipy = [{version = ">=1.9.2", python = ">=3.11"},
|
||||
ipython = "^7.0.0"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
prospector = "1.10.3"
|
||||
prospector = "1.12.1"
|
||||
pre-commit = "^2.17.0"
|
||||
coverage = "^6.3.2"
|
||||
deepdiff = "^5.7.0"
|
||||
greenery = "^3.3.5"
|
||||
autopep8 = "2.0.4"
|
||||
pylint = "3.3.6"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
|
||||
Reference in New Issue
Block a user