Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nutti committed Oct 10, 2024
1 parent 22ec172 commit 2336e19
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/fake_bpy_module/transformer/data_type_refiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
REGEX_MATCH_DATA_TYPE_LIST_OF_PARENTHESES_VALUE = re.compile(r"^list of \(([a-zA-Z.,` ]+)\)") # noqa: E501
REGEX_MATCH_DATA_TYPE_PAIR_OF_VALUE = re.compile(r"^pair of `([A-Za-z0-9_.]+)`")
REGEX_MATCH_DATA_TYPE_BMELEMSEQ_OF_VALUE = re.compile(r"`BMElemSeq` of `([a-zA-Z0-9]+)`$") # noqa: E501
REGEX_MATCH_DATA_TYPE_BMLAYERCOLLECTION_OF_VALUE = re.compile(r"`BMLayerCollection` of ([a-zA-Z0-9]+)$") # noqa: E501
REGEX_MATCH_DATA_TYPE_BMLAYERCOLLECTION_OF_CLASS = re.compile(r"`BMLayerCollection` of `([a-zA-Z0-9]+)`$") # noqa: E501
REGEX_MATCH_DATA_TYPE_TUPLE_OF_VALUE = re.compile(r"^tuple of `([a-zA-Z0-9.]+)`('s)*$") # noqa: E501
REGEX_MATCH_DATA_TYPE_LIST_OR_DICT_OR_SET_OR_TUPLE = re.compile(r"^`*(list|dict|set|tuple)`*\.*$") # noqa: E501
REGEX_MATCH_DATA_TYPE_OT = re.compile(r"^`([A-Z]+)_OT_([A-Za-z_]+)`$")
Expand Down Expand Up @@ -471,6 +473,19 @@ def _get_refined_data_type_fast( # noqa: C901, PLR0911, PLR0912
return [
make_data_type_node(f"`bmesh.types.BMElemSeq`[`{s}`]")
]
# [Ex] BMLayerCollection of float
if m := REGEX_MATCH_DATA_TYPE_BMLAYERCOLLECTION_OF_VALUE.match(dtype_str):

Check failure on line 477 in src/fake_bpy_module/transformer/data_type_refiner.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

src/fake_bpy_module/transformer/data_type_refiner.py:477:81: E501 Line too long (82 > 80)
return [
make_data_type_node(f"`bmesh.types.BMLayerCollection`[{m.group(1)}]")
]
# [Ex] BMLayerCollection of `mathutils.Vector`
if m := REGEX_MATCH_DATA_TYPE_BMLAYERCOLLECTION_OF_CLASS.match(dtype_str):

Check failure on line 482 in src/fake_bpy_module/transformer/data_type_refiner.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

src/fake_bpy_module/transformer/data_type_refiner.py:482:81: E501 Line too long (82 > 80)
s = self._parse_custom_data_type(
m.group(1), uniq_full_names, uniq_module_names, module_name)
if s:
return [
make_data_type_node(f"`bmesh.types.BMLayerCollection`[`{s}`]")
]
# [Ex] tuple of mathutils.Vector's
if m := REGEX_MATCH_DATA_TYPE_TUPLE_OF_VALUE.match(dtype_str):
s = self._parse_custom_data_type(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,26 @@
of
<class-ref>
RefinedClassA
<data>
<name>
data_bmlayercollection_of_value
<description>
<data-type-list>
<data-type>
<class-ref>
BMLayerCollection
of float
<data>
<name>
data_bmlayercollection_of_class
<description>
<data-type-list>
<data-type>
<class-ref>
BMLayerCollection
of
<class-ref>
ClassA
<data>
<name>
data_tuple_of_value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,27 @@
<class-ref>
refined_module_a.RefinedClassA
]
<data>
<name>
data_bmlayercollection_of_value
<description>
<data-type-list>
<data-type option="never none">
<class-ref>
bmesh.types.BMLayerCollection
[float]
<data>
<name>
data_bmlayercollection_of_class
<description>
<data-type-list>
<data-type>
<class-ref>
bmesh.types.BMLayerCollection
[
<class-ref>
ClassA
]
<data>
<name>
data_tuple_of_value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@

:type: :class:`BMElemSeq` of :class:`RefinedClassA`

.. data:: data_bmlayercollection_of_value

:type: :class:`BMLayerCollection` of float

.. data:: data_bmlayercollection_of_class

:type: :class:`BMLayerCollection` of :class:`ClassA`

.. data:: data_tuple_of_value

:type: tuple of :class:`RefinedClassA`'s
Expand Down

0 comments on commit 2336e19

Please sign in to comment.