From: Zac Medico Date: Wed, 12 Nov 2008 21:58:44 +0000 (-0000) Subject: Use a simpler approach instead of implementing NewsItem.__getattr__(). X-Git-Tag: v2.2_rc15~77 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a522121744194d1e951d21a2af1afd959a97bb5d;p=portage.git Use a simpler approach instead of implementing NewsItem.__getattr__(). svn path=/main/trunk/; revision=11867 --- diff --git a/pym/portage/news.py b/pym/portage/news.py index d590ae46d..6c0712d3a 100644 --- a/pym/portage/news.py +++ b/pym/portage/news.py @@ -188,6 +188,9 @@ class NewsItem(object): or raise a ValueError exception if the required object is not present. """ + if not self._parsed: + self.parse() + if not len(self.restrictions): return True # no restrictions to match means everyone should see it @@ -237,11 +240,6 @@ class NewsItem(object): self._parsed = True - def __getattr__(self, attr): - if not self._parsed: - self.parse() - return self.__dict__[attr] - class DisplayRestriction(object): """ A base restriction object representing a restriction of display.