summaryrefslogtreecommitdiff
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
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]."""
ommit/portato/gui/templates/SearchWindow.ui?h=v0.14&id=8c127b4c4e7930f4c6a076e5c7d7679b4badfabb&follow=1'>Removed the 'translatable' attribute from 'gtk-*' stringsRené 'Necoro' Neumann5-11/+11 2009-08-31Removed TODO. Renamed ChangeLog to TODORené 'Necoro' Neumann2-40/+0 2009-08-27Only import stuff if necessaryRené 'Necoro' Neumann1-8/+8 2009-08-25Release the threadQueue-Lock in syncv0.13René 'Necoro' Neumann1-0/+1 2009-08-25Updated portugese translationAlberto Federman Neto1-650/+687 2009-08-15Update spanish translationDaniel Halens1-245/+258 2009-08-15Use boolean flags instead of obscure C flags for ipc.MessageQueueRené 'Necoro' Neumann3-13/+15 2009-08-15TypoRené 'Necoro' Neumann1-1/+1 2009-08-15Enhanced the extensions.shRené 'Necoro' Neumann1-3/+8 2009-08-15Move eix-format to correct locationRené 'Necoro' Neumann1-0/+0