diff options
| author | Julian Andres Klode <jak@debian.org> | 2013-10-21 14:35:33 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2013-10-21 14:35:33 +0200 |
| commit | abc9feb18b268cbc4ddb79aabb30ce352e31b44a (patch) | |
| tree | 5f910a1634905d2b5b2246f48c18451e04785ae5 /doc/examples/deb_inspect.py | |
| parent | ce50049ebd837697c947ed332a8a81bc56c75fb4 (diff) | |
| download | python-apt-abc9feb18b268cbc4ddb79aabb30ce352e31b44a.tar.gz | |
doc/examples: Start updating to new API
Diffstat (limited to 'doc/examples/deb_inspect.py')
| -rwxr-xr-x | doc/examples/deb_inspect.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/examples/deb_inspect.py b/doc/examples/deb_inspect.py index 54c52b7b..3261c734 100755 --- a/doc/examples/deb_inspect.py +++ b/doc/examples/deb_inspect.py @@ -7,10 +7,10 @@ import sys import os.path -def Callback(What, Name, Link, Mode, UID, GID, Size, MTime, Major, Minor): +def Callback(member, data): """ callback for debExtract """ - print "%s '%s','%s',%u,%u,%u,%u,%u,%u,%u" \ - % (What, Name, Link, Mode, UID, GID, Size, MTime, Major, Minor) + print "'%s','%s',%u,%u,%u,%u,%u,%u,%u" \ + % (member.name, member.linkname, member.mode, member.uid, member.gid, member.size, member.mtime, member.major, member.minor) if __name__ == "__main__": @@ -21,10 +21,10 @@ if __name__ == "__main__": print "Working on: %s" % file print "Displaying data.tar.gz:" - apt_inst.debExtract(open(file), Callback, "data.tar.gz") + apt_inst.DebFile(open(file)).data.go(Callback) print "Now extracting the control file:" - control = apt_inst.debExtractControl(open(file)) + control = apt_inst.DebFile(open(file)).control.extractdata("control") sections = apt_pkg.TagSection(control) print "Maintainer is: " @@ -33,13 +33,13 @@ if __name__ == "__main__": print print "DependsOn: " depends = sections["Depends"] - print apt_pkg.ParseDepends(depends) + print apt_pkg.parse_depends(depends) print "extracting archive" dir = "/tmp/deb" os.mkdir(dir) - apt_inst.debExtractArchive(open(file), dir) + apt_inst.DebFile(open(file)).data.extractall(dir) def visit(arg, dirname, names): print "%s/" % dirname |
