https://bugs.gpodder.org/show_bug.cgi?id=1500

Thomas Perl <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |CONFIRMED
     Ever Confirmed|0                           |1

--- Comment #3 from Thomas Perl <[email protected]> 2012-02-28 11:25:23 GMT ---
(In reply to comment #2)
> If the developer needs to create an own thread he's free to do so. If it's not
> needed it'll make a coordination more complex without a benefit.

I agree. Maybe the extension manager/container should provide a way to create a
"progress item" of some sort (with title, etc..) that extensions can use to
report the progress of their work to the main application (and that one then
handles it accordingly, e.g. display the progress item in the
"downloads/progress" tab).

So, what this needs IMHO is something like that:

class gPodderExtension:
    def __init__(self, container):
        self.container = container

    def on_some_event(self):
        progress = self.container.start_progress(_('Converting file'))
        progress.set_progress(0.)
        while True:
            ...
            progress.set_progress(.5)
            ...
        progress.set_progress(1.)
        progress.finish()

Of course, the "on_some_event" could also create a thread and call methods on
the "progress" method from this thread (i.e. the progress object takes care of
thread safety). What do you think, does that sound like a workable solution?

-- 
Configure bugmail: https://bugs.gpodder.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
gPodder-Bugs mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-bugs

Reply via email to