Commit graph

77 commits

Author SHA1 Message Date
Tim Rid
c5d08f9b87 add docstring to construct docs 2022-02-20 20:33:28 +01:00
Tim Rid
acc9f6a9e4 removed this_struct and added a lambda instead 2022-02-20 17:07:41 +01:00
Tim Rid
935f021a4f added a litte bit of documentation 2022-02-20 16:53:12 +01:00
Tim Rid
a46c180e7a Dont parse the provided subcon in csfield. Only check if it builds from none. But now you can use the const or default parameters instead to provied default or constant values. 2022-02-20 12:47:10 +01:00
Tim Rid
cab9a07c4f Use standard dataclasses modul for python >= 3.10 or use the provided dataclasses module from this library fol python < 3.10. So we can use the kw_only option. 2022-02-20 12:32:49 +01:00
Tim Rid
8529bd2878 ignore typing issues and removed unnessesary imports 2022-02-19 21:56:50 +01:00
Tim Rid
46fc3dd48c renamed file 2022-02-19 21:55:31 +01:00
Tim Rid
f9e2d24d71 Use marker instances from the original dataclass module so that hopefully also the original dataclass functions are working 2022-02-19 21:55:16 +01:00
Tim Rid
a0cadcce85 removed things that not work in Python 3.8 2022-02-19 21:54:04 +01:00
Tim Rid
b21c43ca65 added dataclass module from python 3.10 2022-02-19 21:27:52 +01:00
Tim Rid
75dbd8d822 fixed some mypy issues 2022-02-19 14:10:18 +01:00
Tim Rid
be5ae240fb renamed construct to constr so that there are no naming collisions with the construct package name 2022-02-19 12:46:28 +01:00
Tim Rid
94a8097bec added this_struct to public interface 2022-02-13 19:48:00 +01:00
Tim Rid
e99dd5d752 some renaming 2022-02-13 19:30:35 +01:00
Tim Rid
8525c04165 added custom _EnumMeta, because __init_subclass__ is not working correctly together with the standard enum.EnumMeta... 2022-02-13 19:29:56 +01:00
Tim Rid
7c68aeecd4 adapted all tests to the new api 2022-02-13 19:01:10 +01:00
Tim Rid
9a9b4ab95a fixed type error 2022-02-13 17:00:28 +01:00
Tim Rid
8169f0ed31 Changed implementation of TEnum and TEnumFlags. 2022-02-13 16:58:54 +01:00
Tim Rid
b896457f90 Changed implementation of DataclassStruct. It is now only nessesary to sublcass DataclassStruct and not to combine it with @dataclasses.dataclass. Also now the DataclassConstruct is included in the DataclassStruct class type itself. 2022-02-13 16:32:30 +01:00
Tim Rid
753e4282ee renamed generic_wrapper.py to generic.py and removed relative imports 2022-02-13 16:13:11 +01:00
Tim Rid
db9b35a0c2 added Constructable Protocol 2022-02-13 16:04:27 +01:00
Tim Rid
4c23eaa1b3 Revert "incremented version to 0.5.3"
This reverts commit 3b5a8af36f.
2021-10-23 13:07:06 +02:00
Tim Rid
3b5a8af36f incremented version to 0.5.3 2021-10-23 13:05:22 +02:00
Tim Rid
7c310cd771 incremented version to 0.5.2 2021-07-31 14:00:58 +02:00
Tim Rid
3848db5b1a incremented version to 0.5.1 2021-07-19 20:51:31 +02:00
Tim Rid
1c9925500b incremented version to 0.5.0 2021-05-24 14:43:00 +02:00
Tim Rid
2b5967e11d fixing pyright issues 2021-05-23 16:22:40 +02:00
Tim Rid
22a0ed7f24 - updated documentation
- removed tunion completely
2021-05-23 15:28:27 +02:00
Tim Rid
5a39c51321 - renamed classes/methods/file:
- "tstruct.py" -> "dataclass_struct.py"
    - "TStruct" -> "DataclassStruct"
    - "TBitStruct" -> "DataclassBitStruct"
    - "sfield" -> "csfield"
    - "TContainerMixin" -> "DataclassMixin"

- extended documentation
2021-05-22 23:36:54 +02:00
Tim Rid
a11132e67d fixed mypy error 2021-05-22 17:45:45 +02:00
Tim Rid
48d50736b0 fixed error 2021-05-22 17:33:34 +02:00
Tim Rid
c9d6f58fd4 fixed mypy errors 2021-05-22 17:32:23 +02:00
Tim Rid
a304977aca - Revised TContainerMixin:
- removed inheritance of cs.Container (which removed the acces to dataclass objects via square brackets)
   - copied __str__ from cs.Container with a few modifications

- Removed 'add_offsets' from TStruct
- Changed implementation of TBitStruct
2021-05-22 17:10:56 +02:00
Tim Rid
64731e4050 incremented version to 0.4.2 2021-04-13 21:35:32 +02:00
Tim Rid
976e68d4b9 values from "cs.Const" and "cs.Default" are now set as default value from the dataclass 2021-04-13 21:33:11 +02:00
Tim Rid
c7b0a9627c incremented version to v0.4.1 2021-04-03 21:37:19 +02:00
Tim Rid
b72c2671dc incremented version to v0.4.0 2021-03-30 19:58:04 +02:00
Tim Rid
94b7f7f606 changed "swapped" to "reverse" in TStruct and TBitStruct 2021-03-30 19:54:23 +02:00
Tim Rid
b336087493 renamed "TContainerBase" to "TContainerMixin" 2021-03-30 19:35:33 +02:00
Tim Rid
c03af674be added version file and incremented version to 0.3.0 2021-03-24 20:28:39 +01:00
Tim Rid
f64f1cac6c fixed __new__ 2021-03-24 20:19:15 +01:00
Tim Rid
5c6f5020f9 fixed typing error from pylance in the constructor of TEnum and TFlagsEnum 2021-03-24 20:15:23 +01:00
Tim Rid
ae440407e9 - renamed "TStructField" to "field" and "TUnionField" to "ufield". This makes the dataclass definitions shorter and more readable.
- removed "Opt" and "List" because they are not necessary any more, because covariant is now included for ParsedType.
- added test with typing.List as field
- fix: changed dict to typing.Dict
2021-03-16 18:51:04 +01:00
Tim Rid
084c39a1ff removed unused type ignore 2021-03-13 17:54:06 +01:00
Tim Rid
d0a31458a8 added covariant and contravariant from PR #1 2021-03-13 17:49:03 +01:00
Tim Rid
b6016554cc adapted the "TContainerBase" to the "TContainer" of construct v2.10.61 based on an OrderedDict 2021-02-21 00:13:45 +01:00
Tim Rid
246a7d3910 added two offsets for each element 2021-02-20 22:11:10 +01:00
Tim Rid
57d843171e added __getattr__ to TStruct 2021-02-20 21:50:50 +01:00
Tim Rid
a4741e2bf2 new setting in TStruct: "add_offsets" 2021-02-20 21:42:39 +01:00
Tim Rid
e902748656 removed unused 'type: ignore' 2021-01-24 17:59:37 +01:00