PlexEvents

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
anderscode
Posts: 2
Joined: Mon Feb 23, 2015 10:09 pm

PlexEvents

Post by anderscode » Mon Feb 23, 2015 10:22 pm

Hi

I just started with python(as in lets look at examples and try something) because i needed a Plex media server event forwarder for eventghost, the code for fetching the data from the server works in normal python 2.7 but trying to run the full thing as a plugin does not. Its not at all unlikely i have missed something simple so any help is appreciate

I get the error "No handlers could be found for logger "root" in Eventghost

:edit:
First as far as i know working version :) STOPP events are not 100% as i found no reliable way for it.
https://github.com/anderscode/PlexEvents


Regards
Anders
Last edited by anderscode on Thu Mar 05, 2015 9:30 pm, edited 2 times in total.

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: PlexEvents

Post by Pako » Tue Feb 24, 2015 5:31 am

Here you will find a solution to your problem.
Only then you will get the real cause:

Code: Select all

ERROR:root:On_WS_Error() takes exactly 2 arguments (3 given)
ERROR:root:On_WS_Close() takes exactly 1 argument (2 given)
Pako

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: PlexEvents

Post by krambriw » Tue Feb 24, 2015 8:47 am

Yes, as Pako indicated,

You have to declare your functions like this, then I think it will work

Code: Select all

    def On_WS_Message(self, ws, message):
(Add the keyword 'self')

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: PlexEvents

Post by Pako » Tue Feb 24, 2015 9:36 am

Dear Walter,
krambriw wrote:You have to declare your functions like this, then I think it will work ...
I just did not want to give away the whole point ... :D

Best regards,
Luboš

anderscode
Posts: 2
Joined: Mon Feb 23, 2015 10:09 pm

Re: PlexEvents

Post by anderscode » Tue Feb 24, 2015 9:50 am

Thank you both for the help now it works. Now to coax a stop message out of it add some error handling/config and its usable. Il post the final code when done incase somwone else wants it.


// Anders

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: PlexEvents

Post by krambriw » Tue Feb 24, 2015 10:02 am

I just did not want to give away the whole point ... :D
Oooops :oops:

Post Reply