summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-07-03 13:04:25 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-07-03 13:04:25 +0200
commit0ee0562e55638df69905d42bf7dfa0df7465bff9 (patch)
tree9321dce64d6a533434d3b6bce31c0c03e5ed1b45 /portato/gui
parentd0b370300b92883f34485f0b4875f9966bf61116 (diff)
downloadportato-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.py5
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]."""