Hiding packages was done incorrectly. Fixed.

This commit is contained in:
Jack Jansen 2003-04-22 13:53:33 +00:00
parent 6cb9029a22
commit f776dee6dd
1 changed files with 16 additions and 9 deletions

View File

@ -48,10 +48,10 @@ import pimp
ELIPSES = '...' ELIPSES = '...'
USER_INSTALL_DIR = os.path.join(os.environ.get('HOME', ''), USER_INSTALL_DIR = os.path.join(os.environ.get('HOME', ''),
'Library', 'Library',
'Python', 'Python',
sys.version[:3], sys.version[:3],
'site-packages') 'site-packages')
class PackageManagerMain(Wapplication.Application): class PackageManagerMain(Wapplication.Application):
@ -204,7 +204,7 @@ class PackageManagerMain(Wapplication.Application):
try: try:
rv = window.close() # ignore any errors while quitting rv = window.close() # ignore any errors while quitting
except: except:
rv = 0 # (otherwise, we can get stuck!) rv = 0 # (otherwise, we can get stuck!)
if rv and rv > 0: if rv and rv > 0:
return return
## try: ## try:
@ -270,12 +270,19 @@ class PimpInterface:
return self.pimpprefs.installDir == USER_INSTALL_DIR return self.pimpprefs.installDir == USER_INSTALL_DIR
def getbrowserdata(self, show_hidden=1): def getbrowserdata(self, show_hidden=1):
self.packages = self.pimpdb.list() packages = self.pimpdb.list()
if show_hidden:
self.packages = packages
else:
self.packages = []
for pkg in packages:
name = pkg.fullname()
if name[0] == '(' and name[-1] == ')' and not show_hidden:
continue
self.packages.append(pkg)
rv = [] rv = []
for pkg in self.packages: for pkg in self.packages:
name = pkg.fullname() name = pkg.fullname()
if name[0] == '(' and name[-1] == ')' and not show_hidden:
continue
status, _ = pkg.installed() status, _ = pkg.installed()
description = pkg.description() description = pkg.description()
rv.append((status, name, description)) rv.append((status, name, description))