summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-11-21 10:33:10 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-11-21 10:33:10 +0000
commita9d234dfe2ab0358d3e61a53645e4ee1d83e53cb (patch)
tree9b66689add80af09a4b328a4b7891fb7841b82b8 /doc/examples
parent2fa652df49918cbfd8def4868b327bab3b30feb9 (diff)
downloadpython-apt-a9d234dfe2ab0358d3e61a53645e4ee1d83e53cb.tar.gz
* apt_inst.debExtractArchive() added
Diffstat (limited to 'doc/examples')
-rwxr-xr-xdoc/examples/deb_inspect.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/doc/examples/deb_inspect.py b/doc/examples/deb_inspect.py
index 4173c196..0befd2bb 100755
--- a/doc/examples/deb_inspect.py
+++ b/doc/examples/deb_inspect.py
@@ -4,6 +4,7 @@
import apt_pkg
import apt_inst
import sys
+import os.path
def Callback(What,Name,Link,Mode,UID,GID,Size,MTime,Major,Minor):
""" callback for debExtract """
@@ -35,5 +36,12 @@ if __name__ == "__main__":
print apt_pkg.ParseDepends(depends)
-
-
+ print "extracting archive"
+ dir = "/tmp/deb"
+ os.mkdir(dir)
+ apt_inst.debExtractArchive(open(file),dir)
+ def visit(arg, dirname, names):
+ print "%s/" % dirname
+ for file in names:
+ print "\t%s" % file
+ os.path.walk(dir, visit, None)