Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

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 »

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 »

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 »

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 »

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 »

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 »

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