Skip to content

Commit

Permalink
using property decorators for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Jan 5, 2012
1 parent 963fa3b commit d21217b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zope/preference/preference.py
Expand Up @@ -72,9 +72,9 @@ def __init__(self, id, schema=None, title=u'', description=u'',
# the property to an actual value during binding, but because we overrode
# ``__setattr__`` this is not possible anymore.
__parent = None
@property
def __parent__(self):
return self.__parent or zope.component.hooks.getSite()
__parent__ = property(__parent__)


def __bind__(self, parent):
Expand Down Expand Up @@ -175,6 +175,7 @@ def __delattr__(self, key):
else:
del self.__dict__[key]

@property
def data(self):
# TODO: what if we have multiple participations?
principal = getInteraction().participations[0].principal
Expand All @@ -190,7 +191,6 @@ def data(self):
prefs[self.__id__] = OOBTree()

return prefs[self.__id__]
data = property(data)


def PreferenceGroupChecker(instance):
Expand Down

0 comments on commit d21217b

Please sign in to comment.