Re: [gedit-list] Gedit build plugin in python, need help: Thread doesn't start/run.



Paolo Borelli wrote:

Il giorno gio, 26/07/2007 alle 15.53 +0200, Jan Niklas Hasse ha scritto:
Hello everyone,

I'm German, so I'm sorry if my English is bad. I'm currently
developing a plugin for gedit for building. There is a plugin, but i
try to implement auto-save before building, double-click should brings
you to the line where the error is, and execution if building was
successful.
I'm using python (which i don't know much) but now I've got a big
problem: I'm starting a Python-Thread which executes the building
command (scons or make). But the Thread doesn't "run". Only if i'm
doing something with gedit, like minimizing it or opening a new file.
I don't have an idea why this happens, so maybe you can help me.
Any clues you can give me would be great, or if you know a place where
I could also ask. The plugin is attached.


Hi Jan-Nik,

	using python threads from within a plugin is not supported. Honestly I
am not sure what is wrong with it but it's known that they block the UI.
My suggestion is that you avoid threads and instead spawn a separate
project to run the build into. You can take a look at what the External
Tools plugin does[1].

By the way, this is the right place to ask or you can come on irc (I saw
in the logs you asked there but I was not around at the time)

ciao
	Paolo


[1] In fact the external tools plugins allows to run make, scons etc way
more easily by writing a simple shell script, though it is not able to
provide ad-hoc features like click-on-error-moves-to-error-line.

Jan-Nik
_______________________________________________
gedit-list mailing list
gedit-list gnome org
http://mail.gnome.org/mailman/listinfo/gedit-list

_______________________________________________
gedit-list mailing list
gedit-list gnome org
http://mail.gnome.org/mailman/listinfo/gedit-list

   Hello,

I ran into this problems a few months back. After looking into gedit's source code, I think it has to do with the way gedit embeds python (you can check out http://www.linuxjournal.com/article/3641, among others). There should be a way for gedit to release the interpreter lock once in a while, but I haven't gotten a chance to get into this yet. IMHO this is actually a worthwhile problem to look into. Without solving this, other build-like tools (e.g., the LaTeX plugin) which use Python will simply not be viable alternatives to dedicated IDEs for the same purpose.

   Bye,

   Ami



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]