[Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread ecir hana
Hello, How to use Vala with Python? How to achieve something like this: http://live.gnome.org/Vala/LuaSample Btw: is it possible to stop the execution of Python function? ___ Vala-list mailing list Vala-list@gnome.org

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Jan Hudec
On Tue, Sep 01, 2009 at 10:19:34 +0200, ecir hana wrote: How to use Vala with Python? How to achieve something like this: http://live.gnome.org/Vala/LuaSample You would need a .vapi for the python library. There is none in the vala distribution, so search the web whether somebody already did

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread ecir hana
On Tue, Sep 1, 2009 at 10:56 AM, Frederikscumm_fr...@gmx.net wrote: Hi, here's a proof of concept. Compile with: Wow! That's all?! Nice $ valac pythondemo.vala -X -lpython2.6 If you want to do more interesting things (e.g. function callbacks) you will have to add more API bindings.

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Jiahua Huang
nice =) On Tue, Sep 1, 2009 at 4:56 PM, Frederik scumm_fr...@gmx.net wrote: Hi, here's a proof of concept. Compile with: $ valac pythondemo.vala -X -lpython2.6 If you want to do more interesting things (e.g. function callbacks) you will have to add more API bindings. (Python code from

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread ecir hana
On Tue, Sep 1, 2009 at 10:40 AM, Jan Hudecb...@ucw.cz wrote: You would need a .vapi for the python library. There is none in the vala distribution, so search the web whether somebody already did anything in that direction, otherwise you'd have to write it. I found this, I just tried to ask

[Vala] d6dfe515 (gobject-2.0: Add constructor to GLib.Object class) breaks .gir generation

2009-09-01 Thread Jan Hudec
Hi, I recompiled vala from master and the .gir generation is broken, for broken meaning the g-ir-compiler rejects the .gir file. The problem is, that since mentioned commit, constructors are written with name .new (instead of new) and g-ir-compiler complains because it's not an identifier. Is

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Arc Riley
There is a lot more than a vapi needed for this. First, there is a big difference between using Python to extend Vala and Vala to extend Python. I assume what we are talking about here is building Python extension modules in the Vala language The vapi is of course needed, but more than this

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Jan Hudec
On Tue, Sep 01, 2009 at 06:17:43 -0400, Arc Riley wrote: There is a lot more than a vapi needed for this. First, there is a big difference between using Python to extend Vala and Vala to extend Python. I assume what we are talking about here is building Python extension modules in the Vala

Re: [Vala] removing an element from a list

2009-09-01 Thread Jiří Zárevúcky
On 09/01/2009 08:51 AM, Didier Ptitjes wrote: Jiří Zárevúcky wrote: If the dependency concerns you, you can simply copy the class you use into your application. :) Vala compiler itself includes a copy of the whole library. Jiří, please, remember that Valac includes that code for

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread ecir hana
On Tue, Sep 1, 2009 at 1:14 PM, Jan Hudecb...@ucw.cz wrote: The OP does not seem to be. He says like the example for Lua and that shows running lua code from vala. Yes. And also calling Vala code from Lua. Or Python. Just to check if I'm on the right track: - just to run some python from Vala

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Arc Riley
Vala does not need to understand python types (natively) either to create python extension modules nor to call python. We've been working on this for some time. Perhaps you'd like to back this statement up with an example? For creating extension modules, python already knows how to wrap the

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Jan Hudec
On Tue, Sep 01, 2009 at 14:07:37 +0200, ecir hana wrote: On Tue, Sep 1, 2009 at 1:14 PM, Jan Hudecb...@ucw.cz wrote: The OP does not seem to be. He says like the example for Lua and that shows running lua code from vala. Yes. And also calling Vala code from Lua. Or Python. Just to

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Frederik
ecir hana wrote: On Tue, Sep 1, 2009 at 1:14 PM, Jan Hudecb...@ucw.cz wrote: The OP does not seem to be. He says like the example for Lua and that shows running lua code from vala. Yes. And also calling Vala code from Lua. Or Python. Just to check if I'm on the right track: - just to run

[Vala] simple echo client server example

2009-09-01 Thread Reid Thompson
Could someone point me to, or post, a simple tcp echo client server example using the current vala bindings? thanks, reid ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread ecir hana
On Tue, Sep 1, 2009 at 3:19 PM, Frederikscumm_fr...@gmx.net wrote: ecir hana wrote: Yes, except that PyMethodDef is a type, not a function. I have translated this example to Vala (see attachment). I have put the bindings into a separate 'python.vapi' file. You can compile with: Thank you!

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread ecir hana
On Tue, Sep 1, 2009 at 7:24 PM, ecir hanaecir.h...@gmail.com wrote: - during compiling, valac says: pythondemo3.vala.c:43: warning: passing arg 2 of `Py_InitModule4' discards qualifiers from pointer target type Is this what you said below about 'emb_methods' being constant? More on this:

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread Frederik
ecir hana wrote: However, I'm slowly getting lost: - during compiling, valac says: pythondemo3.vala.c:43: warning: passing arg 2 of `Py_InitModule4' discards qualifiers from pointer target type Is this what you said below about 'emb_methods' being constant? Yes, that's what I meant. -

[Vala] Improving the i18n binding in GLib

2009-09-01 Thread Yu Feng
Dear Maintainers, The attachment is a patch that adds a few more gettext functions to the glib-2.0.vapi. Also in the patch I moved the gettext functions to Intl namespace, while leaving the _ macros under the GLib namespace. If it possible I would also suggest using the name I18N as the

Re: [Vala] Embed Python into Vala, extend Vala with Python

2009-09-01 Thread ecir hana
On Tue, Sep 1, 2009 at 8:20 PM, Frederikscumm_fr...@gmx.net wrote: ecir hana wrote: However, I'm slowly getting lost: - during compiling, valac says: pythondemo3.vala.c:43: warning: passing arg 2 of `Py_InitModule4' discards qualifiers from pointer target type Is this what you said below