fixing cached property

This commit is contained in:
Peter Molnar 2018-11-03 10:49:45 +01:00
parent cb0f20f2c0
commit 4d116ed5dc
2 changed files with 5 additions and 6 deletions

View file

@ -5,6 +5,7 @@ from bleach import clean
import arrow
import keys
import common
from common import cached_property
import settings
from pprint import pprint
import logging
@ -67,15 +68,13 @@ class FlickrFav(common.ImgFav):
def __str__(self):
return "fav-of %s" % (self.url)
@property
@common.cached_property
@cached_property
def owner(self):
return self.info.get('owner')
@property
@common.cached_property
@cached_property
def info(self):
return flickrphoto.getInfo()
return self.flickrphoto.getInfo()
@property
def author(self):

View file

@ -30,6 +30,7 @@ class cached_property(object):
def __init__(self, method, name=None):
self.method = method
self.name = name or method.__name__
def __get__(self, inst, cls):
if inst is None:
return self
@ -37,7 +38,6 @@ class cached_property(object):
setattr(inst, self.name, result)
return result
class Follows(object):
def __init__(self):
self.feeds = {}