Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio committed Apr 6, 2024
1 parent dc42761 commit 456fb0b
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for ETS project parser."""

from pathlib import Path

RESOURCES_PATH = Path(__file__).parent / "resources"
Expand Down
1 change: 1 addition & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Conftest for xknxproject."""

import json
from test import STUBS_PATH

Expand Down
1 change: 1 addition & 0 deletions test/test_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test utilities."""

import pytest

from xknxproject.util import get_dpt_type, parse_dpt_types
Expand Down
1 change: 1 addition & 0 deletions test/xml/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test parser."""

from test import RESOURCES_PATH

import pytest
Expand Down
1 change: 1 addition & 0 deletions test/zip/test_extractor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test reading KNX projects."""

from test import RESOURCES_PATH

from pytest import raises
Expand Down
1 change: 1 addition & 0 deletions xknxproject/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""ETS Project Parser is a library to parse ETS project files."""

# flake8: noqa
from .xknxproj import XKNXProj
1 change: 1 addition & 0 deletions xknxproject/combination/combination.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Combine the project data for more details inferred from linked objects."""

from __future__ import annotations

from typing import NamedTuple
Expand Down
1 change: 1 addition & 0 deletions xknxproject/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for the library."""

from typing import Final

ETS_6_SCHEMA_VERSION: Final = 21
Expand Down
1 change: 1 addition & 0 deletions xknxproject/exceptions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Package for exception handling."""

from .exceptions import (
InvalidPasswordException,
ProjectNotFoundException,
Expand Down
1 change: 1 addition & 0 deletions xknxproject/loader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""XML loader for xknxproj files."""

from .application_program_loader import ApplicationProgramLoader
from .hardware_loader import HardwareLoader
from .knx_master_loader import KNXMasterLoader
Expand Down
7 changes: 4 additions & 3 deletions xknxproject/loader/application_program_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Application Program Loader."""

from __future__ import annotations

from collections.abc import Iterator
Expand Down Expand Up @@ -61,9 +62,9 @@ def load(
)
elif elem.tag.endswith("ComObjectRef"):
if (_id := elem.attrib.get("Id")) in used_com_object_ref_ids:
com_object_refs[
_id
] = ApplicationProgramLoader.parse_com_object_ref(elem, _id)
com_object_refs[_id] = (
ApplicationProgramLoader.parse_com_object_ref(elem, _id)
)
elem.clear()
elif elem.tag.endswith("Allocator"): # Allocators/Allocator
allocators[elem.attrib.get("Id")] = Allocator(
Expand Down
1 change: 1 addition & 0 deletions xknxproject/loader/hardware_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Hardware Loader."""

from __future__ import annotations

from xml.etree import ElementTree
Expand Down
1 change: 1 addition & 0 deletions xknxproject/loader/knx_master_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""KNX Master Data Loader."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions xknxproject/loader/project_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Project file loader."""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions xknxproject/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Xknxproj models."""

# flake8: noqa
from .knxproject import (
Area,
Expand Down
5 changes: 4 additions & 1 deletion xknxproject/models/knxproject.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define output type for parsed KNX project."""

from __future__ import annotations

from typing import TypedDict
Expand Down Expand Up @@ -44,7 +45,9 @@ class ModuleInstanceInfos(TypedDict):
"""Information about module association for CommunicationObjects."""

definition: str
root_number: int # `Number` assigned by ComObject - without Module base object number added
root_number: (
int # `Number` assigned by ComObject - without Module base object number added
)


class Device(TypedDict):
Expand Down
1 change: 1 addition & 0 deletions xknxproject/models/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define internally used data structures."""

from __future__ import annotations

from collections.abc import Iterator
Expand Down
1 change: 1 addition & 0 deletions xknxproject/models/static.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains static data from the project files that is not really important and doesn't change often."""

from enum import Enum


Expand Down
7 changes: 3 additions & 4 deletions xknxproject/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""XML utilities."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -52,13 +53,11 @@ def parse_dpt_types(dpt_string: str | None) -> list[DPTType]:


@overload
def parse_xml_flag(flag: str | None, default: bool) -> bool:
...
def parse_xml_flag(flag: str | None, default: bool) -> bool: ...


@overload
def parse_xml_flag(flag: str | None, default: None = None) -> bool | None:
...
def parse_xml_flag(flag: str | None, default: None = None) -> bool | None: ...


def parse_xml_flag(flag: str | None, default: bool | None = None) -> bool | None:
Expand Down
1 change: 1 addition & 0 deletions xknxproject/xknxproj.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ETS Project Parser is a library to parse ETS project files."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions xknxproject/xml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""XML Parsing functionality."""

from .parser import XMLParser

__all__ = ["XMLParser"]
1 change: 1 addition & 0 deletions xknxproject/xml/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Parser logic for ETS XML files."""

from __future__ import annotations

import html
Expand Down
1 change: 1 addition & 0 deletions xknxproject/zip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Package for reading KNXProj ZIP."""

from .extractor import KNXProjContents, extract

__all__ = ["KNXProjContents", "extract"]
1 change: 1 addition & 0 deletions xknxproject/zip/extractor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class to read KNXProj ZIP files."""

from __future__ import annotations

import base64
Expand Down

0 comments on commit 456fb0b

Please sign in to comment.