I'm a newbie at developing plex channels but wanted to hack on some stuff... I'm having some really basic problems using python builtin functions. For instance, if I try to use hasattr, I get the following error:
I'm a newbie at developing plex channels but wanted to hack on some stuff... I'm having some really basic problems using python builtin functions. For instance, if I try to use hasattr, I get the following error:
I have never used hasattr or others for objects, but I have used some of the ones for strings like len(), str(), int() etc. So I am not sure if its use of objects makes it different.
But it could be that it is just an issue with the syntax of your code and how you are calling it that is causing it not to be recognized. If you post the snippet of the code where you have use it and got errors, these guys may be able to see if that is the issue.
I've been tinkering with the Apple Movie Trailers channel. Just adding a line like:
If you do something like object.__class__ it also throws an exception. I don't know why this is. I think Plex only allows a subset of Python. For example, open() also isn't supported.
The Plex plugin framework uses a “restricted” python which does not include some of the standard built-ins. For most basic built-in functions that are not available, there are Framework substitutes. I don’t know off the top if my head what the substitute for hasattr would be.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.