Hi, I'm trying to modify a script to take into account the tags (writers/directors) for series episodes so I looked into the tvdb plugin and found what seems to be the function that handles it:
def readTags(self, element, list, name):
try:
el_text = lambda element, xp: element.xpath(xp)[0].text
tag_text = el_text(element, name)
if tag_text.find('|') != -1:
tags = tag_text.split('|')
else:
tags = tag_text.split(',')
tags = [tag.strip() for tag in tags if len(tag) > 0]
list.clear()
for tag in tags:
if tag not in list:
list.add(tag)
except:
pass
but the result is not what I expect as it seems the core of python is not agreeing with this :
2014-07-03 16:37:26,329 (-8d07950) : CRITICAL (core:556) - Exception while loading code (most recent call last):
File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/core.py", line 550, in load_code
self.init_code = self.loader.load(self.init_path, elevated, use_xpython = Framework.constants.flags.use_xpython in self.sandbox.flags)
File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 47, in load
code = self.compile(str(source), str(uni(filename)), elevated)
File "/share/MD0_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 52, in compile
return RestrictedPython.compile_restricted(source, name, 'exec', elevated=elevated)
File "/root/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 115, in compile_restricted
gen.compile()
File "/root/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 68, in compile
tree = self._get_tree()
File "/root/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 59, in _get_tree
tree = self.parse()
File "/root/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 56, in parse
return niceParse(self.source, self.filename, self.mode)
File "/root/Library/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 38, in niceParse
compile(source, filename, mode)
File "/root/Library/Plex Media Server/Plug-ins/XBMCnfoTV.bundle/Contents/Code/__init__.py", line 244
def readTags(self, element, list, name):
^
IndentationError: unindent does not match any outer indentation level
So I just don't get why the function is giving me an error without even been called once in the script. I guess I am missing something but really can't see it. If anyone could point me on how to make the tag reader working without throwing any error that would be very nice. Thanks.