summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-11-29 12:25:33 +0100
committerMichael Vogt <egon@bottom>2007-11-29 12:25:33 +0100
commit0fc4aa9466d57ddc4a54191eeb8775e41ad35525 (patch)
tree93b7f4e949c3c013309d397de200d058ec7b5af5 /doc/examples
parentbe3ddb25ea0baa259f20936f1d7a62cafa019b99 (diff)
parentabf6c5801c6b162a9dcda5099e8eb746525dc826 (diff)
downloadpython-apt-0fc4aa9466d57ddc4a54191eeb8775e41ad35525.tar.gz
* apt/package.py:
- fix apt.package.Dependency.relation initialization * python/string.cc: - fix overflow in SizeToStr() * python/metaindex.cc: - added support for the metaIndex objects * python/sourceslist.cc: - support new "List" attribute that returns the list of metaIndex source entries * python/depcache.cc: - be more threading friendly * python/tag.cc - support "None" as default in ParseSection(control).get(field, default), LP: #44470 * python/progress.cc: - fix refcount problem in OpProgress - fix refcount problem in FetchProgress - fix refcount problem in CdromProgress * apt/README.apt: - fix typo (thanks to Thomas Schoepf, closes: #387787) * po/fr.po: - merge update, thanks to Christian Perrier (closes: #435918)
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/acquire.py3
-rw-r--r--doc/examples/metaindex.py15
2 files changed, 16 insertions, 2 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py
index a0790c98..1291dbfa 100644
--- a/doc/examples/acquire.py
+++ b/doc/examples/acquire.py
@@ -45,7 +45,7 @@ fetcher = apt_pkg.GetAcquire(progress)
pm = apt_pkg.GetPackageManager(depcache)
pm.GetArchives(fetcher,list,recs)
print "%s (%s)" % (apt_pkg.SizeToStr(fetcher.FetchNeeded), fetcher.FetchNeeded)
-
+actiongroup = apt_pkg.GetPkgActionGroup(depcache)
for pkg in cache.Packages:
depcache.MarkKeep(pkg)
@@ -68,7 +68,6 @@ print pm
print fetcher
get_file(fetcher, "ftp://ftp.debian.org/debian/dists/README", "/tmp/lala")
-sys.exit(1)
pm.GetArchives(fetcher,list,recs)
diff --git a/doc/examples/metaindex.py b/doc/examples/metaindex.py
new file mode 100644
index 00000000..1bce0dba
--- /dev/null
+++ b/doc/examples/metaindex.py
@@ -0,0 +1,15 @@
+
+import apt_pkg
+
+apt_pkg.init()
+
+sources = apt_pkg.GetPkgSourceList()
+sources.ReadMainList()
+
+
+for metaindex in sources.List:
+ print metaindex
+ print "URI: ",metaindex.URI
+ print "Dist: ",metaindex.Dist
+ print "IndexFiles: ","\n".join([str(i) for i in metaindex.IndexFiles])
+ print