<commit_before>"""
A test / draft for defining Naali Entity-Components with Naali Attribute data.
This one synchs animation state with a GUI slider.
There is now also another test, door.py, so moved common parts to componenthandler.py

Originally this used the first test version of DynamicComponent that provided a single float attribute (Attribute<float>).
That can be useful when testing performance and robustness of an upcoming ECA sync mechanism.
The current implementation in Naali 0.2 uses a workaround that needed no protocol nor server changes to old ReX,
where all attributes of all components for a single entity are synched and stored as xml.

After this test, a Door test with two attributes: opened & locked, was written.
First as door.py here, and then as door.js that can be safely loaded from the net (the source is for convenience in Naali repo jsmodules).
To add support for multiple attributes of various types easily to py & js, that was made using a single Naali string attr to store json.
With the current ECA sync the performance makes no diff, so there are little drawbacks in this shortcut to get to experiment more.

Currently the DynamicComponent system doesn't differentiate/allow multiple instances for a single entity
-- that will be easy to add using the existing (quite new) Component instance identification system in Naali.
But to allow this to work simultaneously with the door tests, adopting this to use the current single JSON attr also.
Also, the initial idea was to have the door handler sync animation state of the door (for a skel animated folding door (haitariovi)),
so perhaps these merge somehow.
"""

from __future__ import division
import time
import rexviewer as r
<commit_msg>update animsync EC test doc to current info<commit_after>"""
A test / draft for defining Naali Entity-Components with Naali Attribute data.
This one synchs animation state with a GUI slider.
There is now also another test, door.py .
Both are registered as ComponentHandlers in componenthandler.py, and instanciated from there when components of interest are encountered in scene data.0

Originally this used the first test version of DynamicComponent that provided a single float attribute (Attribute<float>).
That can be useful when testing performance and robustness of an upcoming ECA sync mechanism.
The current implementation in Naali 0.2 uses a workaround that needed no protocol nor server changes to old ReX,
where all attributes of all components for a single entity are synched and stored as xml.

After this test, a Door test with two attributes: opened & locked, was written.
First as door.py here, and then as door.js that can be safely loaded from the net (the source is for convenience in Naali repo jsmodules).
To add support for multiple attributes of various types easily to py & js, that was made using a single Naali string attr to store json in v. 0.2.5
With the current ECA sync the performance makes no diff, so there are little drawbacks in this shortcut to get to experiment more.

Now finally for Naali 0.3.0 this system is quite full featured: the DynamicComponents are identified using names, so there can be several for different purposes in a single Entity, and the handler system works so that there can be any number of Entities with a certain component and the individual handlers for those work correctly.

"""

from __future__ import division
import time
import rexviewer as r

{'fraction_non_alphanumeric': 0.0319860424542018, 'fraction_numerical': 0.00319860424542018, 'mean_word_length': 4.602605863192182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1764132', 'n_tokens_mistral': 803, 'n_tokens_neox': 768, 'n_words': 549}