This repository was archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
This repository was archived by the owner on Feb 1, 2023. It is now read-only.
Implement DMPersistentTagsSequence #6
Copy link
Copy link
Open
Milestone
Description
DMPersistentTagsSequence : collections.abc.Sequence
Motivation
Dealing with persistent tags is the main key in execdmscript but also very complicated since
TagGroups cannot be travelled through on python side (with GMS <= 3.4). This problem should be
solved by this class.
Definition
On each call it checks the structure of the persistent tag group by executing dm-script code if
necessary. Add some optional caching (caching is not reliable here, but if the user decides so it
may help to speed up)
Attributes
`base_path : tuple[str]|None` # The base path in the persistent tags this object represents, if an empty string this is the base, each TagGroup in the persistent TagGroups is represented by another object of this again which is saved here
Methods
_getPatFor(key : int|str) -> str# return the path to look in the persistent tags for, append the key to the base_path, list indices are "[]" in dm-script__getitem__() -> any# travel through the persistent tags on python side, uses_getPathFor()__len__() -> int# get the length from the persistent tags if base is "", otherwise check the length on dm-script side (maybe getting the value from the base_path is possible on python, note that assigning taggroups to variables breaks them, try out to get the length)__contains__() -> bool# check if index() returns a value- `iter() -> return self
__next__() -> any# use getitem with couter in iter__reversed__() -> any# use getitem and reverse the counter in iterindex()# travel through taggroup on dm-script sidecount()# travel through taggroup on dm-script side and count occurances
Metadata
Metadata
Assignees
Labels
No labels