diff options
| author | Sebastian Heinlein <sebi@glatzor.de> | 2008-08-20 10:57:44 +0200 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@glatzor.de> | 2008-08-20 10:57:44 +0200 |
| commit | 0b0b062b72b721e5f5b3387b6c0fb4de6f6a4e61 (patch) | |
| tree | 10a5695443125dd1655ddf457ecfb1dabe9f2660 /apt/package.py | |
| parent | c06893544e6c2b4b1b3f6fb50e50ead6874a157f (diff) | |
| download | python-apt-0b0b062b72b721e5f5b3387b6c0fb4de6f6a4e61.tar.gz | |
Add the installedFiles property to the Package class
Diffstat (limited to 'apt/package.py')
| -rw-r--r-- | apt/package.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apt/package.py b/apt/package.py index b664769d..3b26fb2b 100644 --- a/apt/package.py +++ b/apt/package.py @@ -374,7 +374,21 @@ class Package(object): return 0 return ver.InstalledSize installedSize = property(installedSize) - + + def installedFiles(self): + """ Return the list of files installed on the system by the package """ + if not self.isInstalled: + return None + path = "/var/lib/dpkg/info/%s.list" % self.name + try: + list = open(path) + files = list.read().split("\n") + list.close() + except: + return None + return files + installedFiles = property(installedFiles) + def getChangelog(self, uri=None, cancel_lock=None): """ Download the changelog of the package and return it as unicode |
