#1530: Event handling fails for plugin "AutoAdd" on pref dialog close. 
(Disconnect
on preferences dialog submit)
---------------------+------------------------------------------------------
 Reporter:  idefixx  |       Owner:           
     Type:  bug      |      Status:  new      
 Priority:  minor    |   Milestone:  1.4.0    
Component:  plugin   |     Version:  1.3.0_dev
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by idefixx):

 This was bugging me to no end since it disconnects the gtk-ui every time
 you you click OK on the prefs dialog or you make any plugin change.
 This fix seems to work I'm really not sure about it though.

 Afaics plugins don't even attempt to register them selfs with
 deluge.event.
 Yet DelugeRPCProtocol tries to get keyword arguments from deluge.event for
 every event it receives, which fails at least for the AutoAdd. No idea
 what you guys are planing here, since you obviously didn't merge this
 event stuff into 1.3.
 Well here is a temp fix patch.

 {{{
 index 9852b29..3e11302 100644
 --- a/deluge/ui/client.py
 +++ b/deluge/ui/client.py
 @@ -171,9 +171,17 @@ def dataReceived(self, data):
                  # A RPCEvent was received from the daemon so run any
 handlers
                  # associated with it.
                  if event_name in self.factory.event_handlers:
 -                    event = known_events[event_name](*request[2])
 +                    # Check for keywords arguments
 +                    try:
 +                        event = known_events[event_name](*request[2])
 +                    except:
 +                        event = None
                      for handler in
 self.factory.event_handlers[event_name]:
 -                        reactor.callLater(0, handler, event.copy())
 +                        if event == None:
 +                            # Twisted doesnt seem to have any problems
 with this.
 +                            reactor.callLater(0, handler, None)
 +                        else:
 +                            reactor.callLater(0, handler, event.copy())
                  continue

              request_id = request[1]
 }}}

-- 
Ticket URL: <http://dev.deluge-torrent.org/ticket/1530#comment:2>
Deluge <http://deluge-torrent.org/>
Deluge project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-dev?hl=en.

Reply via email to