Make a few __get__ methods work properly on their class

Automatic doc generation requires this.
This commit is contained in:
Petr Viktorin 2012-02-11 22:54:46 +01:00
parent d3fa2891c8
commit 50b08d94d9

View file

@ -121,6 +121,8 @@ class MoveEffectProperty(object):
self.effect_column = effect_column self.effect_column = effect_column
def __get__(self, obj, cls): def __get__(self, obj, cls):
if obj is None:
return self
if obj.move_effect is None: if obj.move_effect is None:
return None return None
prop = getattr(obj.move_effect, self.effect_column) prop = getattr(obj.move_effect, self.effect_column)
@ -131,6 +133,8 @@ class MoveEffectPropertyMap(MoveEffectProperty):
proxies. proxies.
""" """
def __get__(self, obj, cls): def __get__(self, obj, cls):
if obj is None:
return self
prop = getattr(obj.move_effect, self.effect_column) prop = getattr(obj.move_effect, self.effect_column)
newdict = dict(prop) newdict = dict(prop)
for key in newdict: for key in newdict: