Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-28 Thread Juan Christian
On Fri Nov 28 2014 at 2:07:32 AM Michael Torrie torr...@gmail.com wrote: Okay, here's a reworking of the code that invokes a new QThread instance each time. Note the QThread instance has to be bound to the MainWindow so that it won't be destroyed when it goes out of scope. Also the Worker thread

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-28 Thread Michael Torrie
On 11/28/2014 06:06 AM, Juan Christian wrote: Which one would be better in performance, having a single 'Worker' to call all URLs, having inside this worker functions for each stuff, or having 3~5 different workers doing different stuff. In the end I'll only print the data when I have them

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 2:12:40 AM Michael Torrie torr...@gmail.com wrote: Hmm, I hit a wall. There's no main.ui file. Can you rework your code so that you have a single file (plus a separate ui file that's okay), that simulates the url request, that I can execute easily. As you asked, here it's,

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:58 AM, Juan Christian wrote: What I have in mind is simple (I think), have the Outpost get the data using QThread, and when it got everything needed emit a signal. So when I have something like 'var = Outpost('123')', when I get the signal I'll know that I can call

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 8:53:16 PM Michael Torrie torr...@gmail.com wrote: Hope this helps. Here's complete working code, minus the .ui file: http://pastebin.com/VhmSFX2t Thanks, I'll just repost the code on pastebin with a NEVER expire time and UNLISTED, so that it can be of some help for others

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 9:16:38 PM Juan Christian juan0christ...@gmail.com wrote: I'll read the code thoroughly and reply to you if I find something strange, many thanks! So, instantly I found one issue, you said that this code won't block the GUI, only the thread event loop, but if we keep moving

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:29 PM, Juan Christian wrote: So, instantly I found one issue, you said that this code won't block the GUI, only the thread event loop, but if we keep moving the window while it's open, every time new info is printed the GUI freezes for like 1-2 seconds. Correct. The thread

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:29 PM, Juan Christian wrote: Is that right? But I don't think that always calling the site this way is good for them and for me, sometimes I may not get new users for like 10~15 minutes, so I would have wasted a lot of calls for nothing. That's why I only instantiate/call the

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:29 PM, Juan Christian wrote: Is that right? But I don't think that always calling the site this way is good for them and for me, sometimes I may not get new users for like 10~15 minutes, so I would have wasted a lot of calls for nothing. That's why I only instantiate/call the

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Juan Christian
On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie torr...@gmail.com wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult if not impossible to assist with, resulting in obtuse, obvious replies from folks. As asked, here is

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Michael Torrie
On 11/26/2014 02:55 PM, Juan Christian wrote: On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie torr...@gmail.com wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult if not impossible to assist with, resulting in

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Michael Torrie
On 11/26/2014 08:57 PM, Michael Torrie wrote: On 11/26/2014 02:55 PM, Juan Christian wrote: On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie torr...@gmail.com wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult if

Re: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
On Mon Nov 24 2014 at 11:56:31 PM Michael Torrie torr...@gmail.com wrote: Looks alright. Does it work? Well, no =/ First I had to remove the multiple inheritance, because Qt doesn't allow that, so I removed the QObject. Second, just for testing I'm calling the module directly using: timer =

Re: Python Signal/Slot + QThred code analysis

2014-11-25 Thread MRAB
On 2014-11-25 13:58, Juan Christian wrote: On Mon Nov 24 2014 at 11:56:31 PM Michael Torrie torr...@gmail.com mailto:torr...@gmail.com wrote: Looks alright. Does it work? Well, no =/ First I had to remove the multiple inheritance, because Qt doesn't allow that, so I removed the QObject.

Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
On Tue Nov 25 2014 at 1:42:24 PM MRAB pyt...@mrabarnett.plus.com wrote: I think that the problem there is that strings don't have an __exit__ method. I don't understand what you said, what you mean by that? =/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread MRAB
On 2014-11-25 15:48, Juan Christian wrote: On Tue Nov 25 2014 at 1:42:24 PM MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com wrote: I think that the problem there is that strings don't have an __exit__ method. I don't understand what you said, what you mean by that? =/ The

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
So guys, I had to change to approach, I read that using Qt I can't do multiple inheritance. So my Outpost class can't be like 'Outpost(QObject, QThred)'. I had to change the code a bit: from PySide.QtCore import QObject, QThread, Signal import requests import bs4 class Worker(QThread): def

Content-Type (was: Fwd: Python Signal/Slot + QThred code analysis)

2014-11-25 Thread Christoph M. Becker
Juan Christian wrote: OFF-TOPIC: You guys said that my emails had some trash HTML and strange stuffs, is it OK now? You're still sending: Content-Type: multipart/alternative Please configure your MUA to send Content-Type: text/plain only. -- Christoph M. Becker --

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Michael Torrie
On 11/25/2014 02:36 PM, Juan Christian wrote: So guys, I had to change to approach, I read that using Qt I can't do multiple inheritance. So my Outpost class can't be like 'Outpost(QObject, QThred)'. I had to change the code a bit: snip So, let's see the problems: Traceback (most recent

Re: Python Signal/Slot + QThred code analysis

2014-11-24 Thread Juan Christian
Oh, and this code I made by myself, I didn't copy. That's why I want you guys to see if everything is ok. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Signal/Slot + QThred code analysis

2014-11-24 Thread Michael Torrie
On 11/24/2014 06:25 AM, Juan Christian wrote: Oh, and this code I made by myself, I didn't copy. That's why I want you guys to see if everything is ok. Looks alright. Does it work? -- https://mail.python.org/mailman/listinfo/python-list

Python Signal/Slot + QThred code analysis

2014-11-23 Thread Juan Christian
This is a continuation of my other topic How to access Qt components loaded from file, it was getting big and the focus changed completely, the real question there was already answered, and we were talking about signal/slot, QThred and other things. So, I read on the web (didn't find books