Skip to content

Commit

Permalink
Replace type with type_definitions (#30209)
Browse files Browse the repository at this point in the history
* Replace type with type_definitions

* Minor change to make sure larger summary is used when merging patch

* restyle

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
  • Loading branch information
2 people authored and pull[bot] committed Feb 12, 2024
1 parent 2eabfc9 commit 2393890
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion scripts/codepregen.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pregenerate import FindPregenerationTargets, TargetFilter

from pregenerate.executors import DryRunner, ShellRunner
from pregenerate.types import IdlFileType
from pregenerate.type_definitions import IdlFileType

try:
import coloredlogs
Expand Down
2 changes: 1 addition & 1 deletion scripts/pregenerate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from dataclasses import dataclass, field
from typing import Iterator, List, Optional

from .types import IdlFileType, InputIdlFile
from .type_definitions import IdlFileType, InputIdlFile
from .using_codegen import (CodegenCppAppPregenerator, CodegenCppClustersTLVMetaPregenerator,
CodegenCppProtocolsTLVMetaPregenerator, CodegenJavaClassPregenerator, CodegenJavaJNIPregenerator)
from .using_zap import ZapApplicationPregenerator
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/pregenerate/using_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import logging
import os

from .types import IdlFileType, InputIdlFile
from .type_definitions import IdlFileType, InputIdlFile

CODEGEN_PY_PATH = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', 'codegen.py'))
Expand Down
2 changes: 1 addition & 1 deletion scripts/pregenerate/using_zap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
from enum import Enum, auto

from .types import IdlFileType, InputIdlFile
from .type_definitions import IdlFileType, InputIdlFile

ZAP_GENERATE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'tools', 'zap', 'generate.py'))

Expand Down
4 changes: 2 additions & 2 deletions scripts/py_matter_idl/files.gni
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ matter_idl_generator_sources = [
"${chip_root}/scripts/py_matter_idl/matter_idl/generators/idl/__init__.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/generators/java/__init__.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/generators/registry.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/generators/types.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/generators/type_definitions.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/lint/__init__.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/lint/lint_rules_parser.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/lint/types.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/lint/type_definitions.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/matter_idl_parser.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/matter_idl_types.py",
"${chip_root}/scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import Optional
from xml.sax.xmlreader import AttributesImpl

from matter_idl.generators.types import GetDataTypeSizeInBits, IsSignedDataType
from matter_idl.generators.type_definitions import GetDataTypeSizeInBits, IsSignedDataType
from matter_idl.matter_idl_types import AccessPrivilege, Attribute, Command, ConstantEntry, DataType, Event, EventPriority, Field

LOGGER = logging.getLogger('data-model-xml-data-parsing')
Expand Down
4 changes: 2 additions & 2 deletions scripts/py_matter_idl/matter_idl/generators/java/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from typing import List, Optional, Set

from matter_idl.generators import CodeGenerator, GeneratorStorage
from matter_idl.generators.types import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType,
ParseDataType, TypeLookupContext)
from matter_idl.generators.type_definitions import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType,
ParseDataType, TypeLookupContext)
from matter_idl.matter_idl_types import (Attribute, Cluster, ClusterSide, Command, DataType, Field, FieldQuality, Idl, Struct,
StructQuality, StructTag)
from stringcase import capitalcase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from typing import List, Optional, Set

from matter_idl.generators import CodeGenerator, GeneratorStorage
from matter_idl.generators.types import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType,
ParseDataType, TypeLookupContext)
from matter_idl.generators.type_definitions import (BasicInteger, BasicString, FundamentalType, IdlBitmapType, IdlEnumType, IdlType,
ParseDataType, TypeLookupContext)
from matter_idl.matter_idl_types import (Attribute, Cluster, ClusterSide, Command, DataType, Field, FieldQuality, Idl, Struct,
StructQuality, StructTag)
from stringcase import capitalcase
Expand Down
10 changes: 5 additions & 5 deletions scripts/py_matter_idl/matter_idl/lint/lint_rules_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
from lark.visitors import Discard, Transformer, v_args

try:
from .types import (AttributeRequirement, ClusterAttributeDeny, ClusterCommandRequirement, ClusterRequirement,
ClusterValidationRule, RequiredAttributesRule, RequiredCommandsRule)
from matter_idl.lint.type_definitions import AttributeRequirement
except ImportError:
import sys

sys.path.append(os.path.join(os.path.abspath(
os.path.dirname(__file__)), "..", ".."))
from matter_idl.lint.types import (AttributeRequirement, ClusterAttributeDeny, ClusterCommandRequirement, ClusterRequirement,
ClusterValidationRule, RequiredAttributesRule, RequiredCommandsRule)
from matter_idl.lint.type_definitions import AttributeRequirement

from matter_idl.lint.type_definitions import (ClusterAttributeDeny, ClusterCommandRequirement, ClusterRequirement,
ClusterValidationRule, RequiredAttributesRule, RequiredCommandsRule)


class ElementNotFoundError(Exception):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022 Project CHIP Authors
# Copyright (c) 2022-2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from typing import Optional

from matter_idl.generators.types import GetDataTypeSizeInBits, IsSignedDataType
from matter_idl.generators.type_definitions import GetDataTypeSizeInBits, IsSignedDataType
from matter_idl.matter_idl_types import AccessPrivilege, Attribute, AttributeQuality, DataType, Field, FieldQuality


Expand Down

0 comments on commit 2393890

Please sign in to comment.