InputDirectoryItem not showing in menu

but my old SearchDirectoryItem did? And other update wierdness
Hello,

just saw that my PMS downloaded a bunch of updates while I was working on my plugin, and after this I started get all kinds of wierdness; first up the one I havent managed to solve yet:

I'm using a SearchDirectoryItem (v1 framework), which have been working all fine until now. Saw a warning about that call being depricated now, so changed it to the new InputDirectoryItem (which in Objects.py looks the same?). First I got all sort of wierd errors, with my function beeing called with wrong arguments etc, but after some hacking I now can't even get it to show in my directory.


						Log("adding search")<br />
						try:<br />
								o = InputDirectoryItem(performSearch,<br />
														title=u'Seek',<br />
														prompt='Seek input?')<br />
								Log(repr(o))<br />
								root.Append(o)<br />
						except:<br />
								Log("failed add")



15:50:15.242675: com.plexapp.plugins.headweb			 :   (Framework) Handling request :  /video/headweb<br />
15:50:15.243973: com.plexapp.plugins.headweb			 :   adding search<br />
15:50:15.244347: com.plexapp.plugins.headweb			 :   InputDirectoryItem(key=performSearch, search=True, prompt='Seek input?', thumb=None, subtitle=None, summary=None, art=None, name=u'Seek')<br />
15:50:15.244723: com.plexapp.plugins.headweb			 :   (Framework) Response OK<br />
Reading 3837 bytes in the body, code is 200



All other items added to root are shown just fine, but not this one?
The only difference when using SearchDirectoryItem instead is the depricted warning.
So..any hints here would be appreciated :)

Another thing i noticed was that HTTP.Request started to feed me back unicode() objects, which XML.ElementFromString failed to parse since it is raw XML with an encode="utf-8" attribute in the xmldeclr (http://codespeak.net/lxml/parsing.html#python-unicode-strings). Passing encoding=None seemed to fix the problem, except for when it tried to fetch data form the cache which was holding the old unicode object.. Cleaning that up fixed it.. Just a note if someone got the same problem :)

Anyways, great work with the release! :)

why not just XML.ElementFromURL() ?



check your python for syntax or whitespace errors introduced retyping lines ,the syntax for search and input objects is exactly the same as all a SearchDirectoryItem does now is call an InputDirectoryItem:


class SearchDirectoryItem(InputDirectoryItem):<br />
  def __init__(self, key, title, prompt, subtitle=None, summary=None, thumb=None, art=None, **kwargs):<br />
	PMS.Log("(Framework) WARNING: SearchDirectoryItem is deprecated. Use InputDirectoryItem instead.")<br />
	InputDirectoryItem.__init__(self, key=key, title=title, prompt=prompt, subtitle=subtitle, summary=summary, thumb=thumb, art=art, **kwargs)

Hi, thanks for your response!



Hm, probably just missed that one, thanks :)



Hm got it working now.. Added a Function() wrapper (which I had earlier, missed to add that again when trying to get it working..) and now it seems to work! Guess those wierd errors with invalid parameters etc was update related or something..

Well, all working now! :)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.