summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-12 21:58:44 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-12 21:58:44 +0000
commita522121744194d1e951d21a2af1afd959a97bb5d (patch)
tree4878733a0518ddb0a323c56ae498162ce87e4e8e
parent40d74003ec5b6e3ed2974e9dcdc588769fd3ef15 (diff)
downloadportage-a522121744194d1e951d21a2af1afd959a97bb5d.tar.gz
portage-a522121744194d1e951d21a2af1afd959a97bb5d.tar.bz2
portage-a522121744194d1e951d21a2af1afd959a97bb5d.zip
Use a simpler approach instead of implementing NewsItem.__getattr__().
svn path=/main/trunk/; revision=11867
-rw-r--r--pym/portage/news.py8
1 files changed, 3 insertions, 5 deletions
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.