[Libapt-front-devel] Re: [Debtags-devel] Python bindings

Torsten Marek shlomme at gmx.net
Wed Oct 26 15:22:18 UTC 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,


>>In the patch for libtagcoll, I had to exchange
>>
>>	Expression operator and (const Expression& e);
>>	Expression operator or (const Expression& e);
>>	Expression operator not ();
>>
>>with
>>	Expression operator&& (const Expression& e);
>>	Expression operator|| (const Expression& e);
>>	Expression operator! ();
>>
>>which works perfectly, since the former are only alii for the latter.
>>Enrico, I've attached a patch included all changes made to tagcoll.
> 
> It surely does work, but it makes the api a bit less clear :'/. I wish
> swig would have get fixed in this case (again).  
I'll report it.
The swig people will love me, this is going to be my fourth complaint today.

> 
> 
>>For apt-front, it's mostly the same, only more.
>>* in cache/component/tags.h, I had to make facetData(...) and tagData(...)
>>protected, otherwise the SWIG code generator would fail.
> 
> I'm wondering why it can't remain public? What does swig do? Since they aren't
> virtual (or i didn't notice?), maybe they could be completely left out for swig
> instead?
They are %ignore'd by now, but swig otherwise insists on wrapping these methods.
> 
> [snip iterator stuff -- not relevant anymore]
> 
> 
>>This is an excerpt from my other email to apt-front-devel:
>>I've created a distutils script, but the SWIG C++ support in distutils from
>>Python 2.4 still has some problems, so the code is generated manually as of now.
> 
> Hmm, isn't automake supposed to be able to handle that? I don't know, just
> would think so. If no, well, i guess we can live with distutils in there.
> 
> Just please make sure those things are done in swig/python, not in swig/. Also,
> i'd like to ask you to move python-specific code into python.i, as it was
> before. If we are already going with swig, we may as well do it cleanly enough
> to support say ruby or other language bindings. Same for testing or otherwise
> .py scripts, those belong to swig/python/.
> 
> 
>>The script debtags.py tries to mimic the behaviour of the debtags binary to show
>>how the Python interface works. As of now, I'll try to implement the behaviour
>>of the actions listed at the end of debtags.py and fix the problems as the
>>occur. Then I'm going to look at the rest of apt-front. Please note that the old
>>scripts from swig/python will not work, since both the apt-front interface and
>>the Python interface have changed.
> 
> Yes, sure, no problem with that :).
> 
> 
>>I'm also planning to split the Python interface into modules and hide some of
>>the classes the user does not instantiate directly.
>>===
>>The code for the SWIG bindings is available here:
>>http://diotavelli.net/files/apt-front-swig-python.tar.bz2
>>
>>There are still a lot of rough edges (like the naming of instantiated
>>templates), but if you want to see what works already, have a look at debtags.py.
>>
>>If you want to build the Python bindings, just patch the headers of apt-front
>>and tagcoll. No recompilation is needed.
>>
>>Bug reports, comments, suggestions welcome.
> 
> Apart from the above remarks, i guess you have done good job, even if python is
> not my favorite programming language =). However, if i find time, i will reuse
> your work here to revive the ruby bindings i suppose. They may, in the end, be
> of some use, even if only for myself :). Thanks again for working on this.
> 
> I would also like to start merging this into svn, do you have an alioth account
> and do you have access to the project? I could of course merge it myself, but
> i'd prefer you to work directly in svn in the future, so we don't get too
> desynchronized...

I'll split the Python specific parts first (I delayed that too long, already)
and get an alioth account. I'll merge the code, then.

greetings

Torsten
- --
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDX58qfMVFHqJEyFgRAioUAJ4x4zjkzIZsTyBFvzyWTZ3GBNxULQCePogx
FHmFo66fZWMCfryxoXXuQRE=
=aoDU
-----END PGP SIGNATURE-----



More information about the Debtags-devel mailing list