diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2008-07-03 13:04:25 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2008-07-03 13:04:25 +0200 |
commit | 0ee0562e55638df69905d42bf7dfa0df7465bff9 (patch) | |
tree | 9321dce64d6a533434d3b6bce31c0c03e5ed1b45 | |
parent | d0b370300b92883f34485f0b4875f9966bf61116 (diff) | |
download | portato-0ee0562e55638df69905d42bf7dfa0df7465bff9.tar.gz portato-0ee0562e55638df69905d42bf7dfa0df7465bff9.tar.bz2 portato-0ee0562e55638df69905d42bf7dfa0df7465bff9.zip |
Use __slots__ for the PkgData class to save memory
Diffstat (limited to '')
-rw-r--r-- | portato/gui/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 "<Package (%(cat)s, %(pkg)s, %(inst)s)>" % self.__dict__ + return "<Package (%(cat)s, %(pkg)s, %(inst)s)>" % {"cat" : self.cat, "pkg" : self.pkg, "inst" : self.inst} class Database (object): """An internal database which holds a simple dictionary cat -> [package_list].""" |