Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/properties.py
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-12-02 22:36:46 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-12-02 22:36:46 (GMT)
commit5511467f6f7eab041b53563c883f72cd7547402f (patch)
tree6a2101c3bc99db3865ba11d678fe27e370e7ba09 /tutorius/properties.py
parentaa26bcdf23f0d096ca38c6b48b7f479fb2fdcc6d (diff)
Creator : Updating for working property updates from activity to Shell (HACK alert in saveTutorial!!!)
Diffstat (limited to 'tutorius/properties.py')
-rw-r--r--tutorius/properties.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tutorius/properties.py b/tutorius/properties.py
index cc76748..85e8aa5 100644
--- a/tutorius/properties.py
+++ b/tutorius/properties.py
@@ -36,6 +36,9 @@ from .propwidgets import PropWidget, \
FloatPropWidget, \
IntArrayPropWidget
+import logging
+LOGGER = logging.getLogger("properties")
+
class TPropContainer(object):
"""
A class containing properties. This does the attribute wrapping between
@@ -62,6 +65,12 @@ class TPropContainer(object):
copy(propinstance.default))
self.__id = hash(uuid.uuid4())
+ # The differences dictionary. This is a structure that holds all the
+ # modifications that were made to the properties since the action
+ # was last installed or the last moment the notification was executed.
+ # Every property change will be logged inside it and it will be sent
+ # to the creator to update its action edition dialog.
+ self._diff_dict = {}
def __getattribute__(self, name):
"""
@@ -96,8 +105,11 @@ class TPropContainer(object):
try:
# We attempt to get the property object with __getattribute__
# to work through inheritance and benefit of the MRO.
- return props.__setitem__(name,
+ real_value = props.__setitem__(name,
object.__getattribute__(self, name).validate(value))
+ LOGGER.debug("Action :: caching %s = %s in diff dict"%(name, str(value)))
+ self._diff_dict[name] = value
+ return real_value
except AttributeError:
return object.__setattr__(self, name, value)