On Thu, 14 Sep 2000, [ISO-8859-1] "Jürgen A. Erhard" wrote:

>     Jason> You may want to just let it die.. I have finished the first
>     Jason> half of my work on making a python-apt wrapper which
>     Jason> includes at least these modules from scriptlib:
> 
> This looks certainly better than dpkg-python...

Well, it is what APT runs on, and I've always thought APT's source was
pretty reasonable :>
 
> But, please rename those dpkg_* modules.  I'd like

I was mearly listing the equivilents from the current dpkg-python. What I
have done is simply put everything under the apt_pkg module - this is
cheap since it is a binary module.
 
> (Underscores are ugly...)

I usually use -'s for apt-pkg, but python thinks that means minus I think.
 
> [...]
> 
>     Jason> Here is a simple example for some of the functions:
>     >>>> import apt_pkg,apt_inst;
>     >>>> Foo = 
> apt_pkg.ParseSection(apt_inst.debExtractControl(open("/tmp/dpkg-python_0.1-3.0.deb","r")))
>     >>>> print Foo.keys()
>     Jason> ['Package', 'Version', 'Section', 'Priority', 'Architecture', 
> 'Depends',
>     Jason> 'Installed-Size', 'Maintainer', 'Description', 'Source']
>     >>>> print apt_pkg.ParseDepends(Foo["Depends"]);
>     Jason> [[('python-base', '1.5-1', '>=')], [('dpkg', '1.4.0.8', '>=')]]
>     >>>> print apt_pkg.RewriteSection(Foo,apt_pkg.RewritePackageOrder,[]);
>     Jason> Package: dpkg-python
>     Jason> Priority: extra
> [...]
> 
> *Very* nice indeed... now if only we could take a closer look (apt-get
>  install python-apt, that is ;-)

CVS apt has packages (aliencode branch) - but I have not produced suitable
documentation or completed the bindings I want to have. Without a good
grounding in C++ you may have problems clearly understanding the Python
binary module. 

Jason


Reply via email to