summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-11-22 11:21:49 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-11-22 11:21:49 +0000
commitf398b1a5833fdf50f8c0c541958d5770ea767be8 (patch)
tree95d91a49f637820cd0b554cf381d35105b7e75cc /doc/examples
parentc26431eebbd6d9b90bba2498355e1874a15aba60 (diff)
downloadpython-apt-f398b1a5833fdf50f8c0c541958d5770ea767be8.tar.gz
* fix in the pkgmanager.cc code (/me needs to be hit with a clue-stick)
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/acquire.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py
index 0031fa18..a5de0029 100644
--- a/doc/examples/acquire.py
+++ b/doc/examples/acquire.py
@@ -1,9 +1,14 @@
import apt
import apt_pkg
import os
+import sys
apt_pkg.init()
+#apt_pkg.Config.Set("Debug::pkgDPkgPM","1");
+#apt_pkg.Config.Set("Debug::pkgPackageManager","1");
+#apt_pkg.Config.Set("Debug::pkgDPkgProgressReporting","1");
+
cache = apt_pkg.GetCache()
depcache = apt_pkg.GetDepCache(cache)
@@ -16,7 +21,7 @@ try:
os.mkdir("/tmp/pyapt-test/partial")
except OSError:
pass
-#apt_pkg.Config.Set("Dir::Cache::archives","/tmp/pyapt-test")
+apt_pkg.Config.Set("Dir::Cache::archives","/tmp/pyapt-test")
pkg = cache["3ddesktop"]
depcache.MarkInstall(pkg)
@@ -32,18 +37,19 @@ print fetcher
pm.GetArchives(fetcher,list,recs)
for item in fetcher.Items:
- print "%s -> %s:\n Status: %s Complete: %s IsTrusted: %s" % (item.DescURI,
- item.DestFile,
- item.Status,
- item.Complete,
- item.IsTrusted)
+ print item
if item.Status == item.StatError:
print "Some error ocured: '%s'" % item.ErrorText
if item.Complete == False:
- print "No error, still nothing downloaded"
+ print "No error, still nothing downloaded (%s)" % item.ErrorText
print
res = fetcher.Run()
print "fetcher.Run() returned: %s" % res
+print "now runing pm.DoInstall()"
+res = pm.DoInstall(1)
+print "pm.DoInstall() returned: %s"% res
+
+