summaryrefslogtreecommitdiff
path: root/apt/package.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-03-02 14:34:30 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-03-02 14:34:30 +0100
commit0ce374b88d19f45e84c3557ef8fb4caf19c98304 (patch)
tree4ee952ff7f4b88fe839cefa6a3aa8737eb45bdf4 /apt/package.py
parent389fe246d85aa59348b770db793e9455fd17d73c (diff)
parent6e90d3114415976a20013647b0d1d6cafdd764a6 (diff)
downloadpython-apt-0ce374b88d19f45e84c3557ef8fb4caf19c98304.tar.gz
* updated to the latest python-apt
Diffstat (limited to 'apt/package.py')
-rw-r--r--apt/package.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/apt/package.py b/apt/package.py
index 4633123a..4fceb904 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -19,19 +19,22 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
-import apt_pkg, string, sys, random
+import apt_pkg
+import sys
+import random
+import string
class Package(object):
""" This class represents a package in the cache
"""
- def __init__(self, cache, depcache, records, list, pcache, pkgiter):
+ def __init__(self, cache, depcache, records, sourcelist, pcache, pkgiter):
""" Init the Package object """
self._cache = cache # low level cache
self._depcache = depcache
self._records = records
self._pkg = pkgiter
- self._list = list # sourcelist
+ self._list = sourcelist # sourcelist
self._pcache = pcache # python cache in cache.py
pass
@@ -52,8 +55,8 @@ class Package(object):
if ver.FileList == None:
print "No FileList for: %s " % self._pkg.Name()
return False
- file, index = ver.FileList.pop(0)
- self._records.Lookup((file,index))
+ f, index = ver.FileList.pop(0)
+ self._records.Lookup((f,index))
return True
@@ -317,10 +320,10 @@ if __name__ == "__main__":
cache = apt_pkg.GetCache()
depcache = apt_pkg.GetDepCache(cache)
records = apt_pkg.GetPkgRecords(cache)
- list = apt_pkg.GetPkgSourceList()
+ sourcelist = apt_pkg.GetPkgSourceList()
- iter = cache["apt-utils"]
- pkg = Package(cache, depcache, records, list, None, iter)
+ pkgiter = cache["apt-utils"]
+ pkg = Package(cache, depcache, records, sourcelist, None, pkgiter)
print "Name: %s " % pkg.name
print "ID: %s " % pkg.id
print "Priority (Candidate): %s " % pkg.priority