Skip to content

Commit

Permalink
Final fix round
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl committed Jan 7, 2024
1 parent effe5be commit 448e754
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ensure Docker script files uses LF to support Docker for Windows.
# Ensure "git config --global core.autocrlf input" before you clone
* text eol=lf
*.py whitespace=error
*.py whitespace=error
2 changes: 0 additions & 2 deletions .pylintrc

This file was deleted.

7 changes: 3 additions & 4 deletions sagemcom_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
)
from .models import Device, DeviceInfo, PortMapping


# pylint: disable=too-many-instance-attributes
class SagemcomClient:
"""Client to communicate with the Sagemcom API."""
Expand All @@ -54,7 +55,7 @@ def __init__(
password: str,
authentication_method: EncryptionMethod,
session: ClientSession | None = None,
ssl: bool | None = False,
ssl: bool | None = False,
verify_ssl: bool | None = True,
):
"""
Expand Down Expand Up @@ -292,9 +293,7 @@ async def logout(self):
self._server_nonce = ""
self._request_id = -1

async def get_value_by_xpath(
self, xpath: str, options: dict | None = None
) -> dict:
async def get_value_by_xpath(self, xpath: str, options: dict | None = None) -> dict:
"""
Retrieve raw value from router using XPath.
Expand Down
3 changes: 2 additions & 1 deletion sagemcom_api/enums.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Enums for the Sagemcom F@st client."""
import sys
from enum import unique
import sys

# Since we support Python versions lower than 3.11, we use
# a backport for StrEnum when needed.
Expand All @@ -9,6 +9,7 @@
else:
from backports.strenum import StrEnum


@unique
class EncryptionMethod(StrEnum):
"""Encryption method defining the password hash."""
Expand Down
6 changes: 4 additions & 2 deletions sagemcom_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from dataclasses import dataclass
from typing import Any, List, Optional


# pylint: disable=too-many-instance-attributes
@dataclass
class Device:
Expand Down Expand Up @@ -66,6 +67,7 @@ def name(self):
"""Return name of the device."""
return self.user_host_name or self.host_name


# pylint: disable=too-many-instance-attributes
@dataclass
class DeviceInfo:
Expand Down Expand Up @@ -100,11 +102,11 @@ class DeviceInfo:
reboot_status: Optional[float] = None
reset_status: Optional[float] = None
update_status: Optional[float] = None
SNMP: Optional[bool] = None # pylint: disable=invalid-name
SNMP: Optional[bool] = None # pylint: disable=invalid-name
first_connection: Optional[bool] = None
build_date: Optional[str] = None
spec_version: Optional[str] = None
CLID: Optional[str] = None # pylint: disable=invalid-name
CLID: Optional[str] = None # pylint: disable=invalid-name
flush_device_log: Optional[bool] = None
locations: Optional[str] = None
api_version: Optional[str] = None
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E501

[pylint.FORMAT]
max-line-length=140
7 changes: 0 additions & 7 deletions tests/test_sagemcom.py
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
"""Test for Sagemcom F@st client."""

from sagemcom_api import __version__


def test_version():
"""Test if version number is 1.0.0."""
assert __version__ == "1.0.0"

0 comments on commit 448e754

Please sign in to comment.