From 0ee0562e55638df69905d42bf7dfa0df7465bff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Thu, 3 Jul 2008 13:04:25 +0200 Subject: Use __slots__ for the PkgData class to save memory --- portato/gui/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'portato/gui/utils.py') diff --git a/portato/gui/utils.py b/portato/gui/utils.py index 035d1c6..fd858e9 100644 --- a/portato/gui/utils.py +++ b/portato/gui/utils.py @@ -132,7 +132,8 @@ class Config (ConfigParser): ConfigParser.write(self) self.modify_external_configs() -class PkgData: +class PkgData (object): + __slots__ = ("cat", "pkg", "inst") def __init__ (self, cat, pkg, inst): self.cat = cat @@ -146,7 +147,7 @@ class PkgData: return cmp(self.pkg.lower(), other.pkg.lower()) def __repr__ (self): - return "" % self.__dict__ + return "" % {"cat" : self.cat, "pkg" : self.pkg, "inst" : self.inst} class Database (object): """An internal database which holds a simple dictionary cat -> [package_list].""" -- cgit v1.2.3