[pacman-dev] pyalpm/pycman -- how to check if a package is installed?

Kwpolska kwpolska at gmail.com
Sat Jul 30 13:18:03 EDT 2011


Hi,
I'd like to use pyalpm and pycman in my project.  I need to get the
database.  Unfortunately, when I run the code, I get an exception
saying "data is not initialized".  How to fix that?

Code (a segment) (imported: pyalpm pacman AUR argparse):
            db = pyalpm.get_localdb()
            pargs = db.get_pkg(dep)
            oargs = argparse.Namespace(package=False, quiet=False,
                                       info=0, listfiles=0)
            localInstalled = pycman.action_query.display_pkg(pargs, oargs)
            pyalpm.release()

-- 
-- Kwpolska (http://kwpolska.co.cc)
stop html mail      | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16   | Arch Linux x86_64, zsh, mutt, vim.
# vim:set textwidth=70:


More information about the pacman-dev mailing list