Keyboard opens when using input variable for http request
#1
Hey guys,
I´m trying to code my first video addon using python.
The addon should do the following:
1. Open the keyboard, and ask for an input
2. call an api with the input variable as last parameter
3. Give out the result as a list

Here is the Code:
http://pastebin.com/SaNjkZfx

It works, but quickly after the list will be created, the keyboard opens again and my error message (if not path) pops up.
The Kodi log says that it is impossible to combine a string with an boolean.
If i write the search parameter directly in the source code, it works perfectly.

Hope for help Smile
Reply
#2
Problematic code fragments please. ))) + Line with error Wink
Reply
#3
Sure, pc crashed and i have forget to repost the link. Sorry..
I think the error is somewhere here:

url2 = "http://127.0.0.1:8080/api/movies/" + sSearchText
r = urllib2.urlopen(url2).read()

Thanks
Reply
#4
1. Writing code out of function and without if __name__ checking you must only if you want execute it when importing. If you need execute some code only when you run addon you need use this construction:
Code:
if __name__ == '__main__' :
    # my code

For example:
Code:
import xbmc

def main():
    # only when you run addon
    xbmc.log('.... I was started!')

# run, import ...
xbmc.log('.... Hi!')

if __name__ == '__main__':
    main()

Try:
Code:
if __name__ == '__main__':
    sSearchText = GUIEditExportName('german')
    ...
    code ...
    ...
    xbmcplugin.endOfDirectory(addon_handle)

2. GUIInfo ?
Reply

Logout Mark Read Team Forum Stats Members Help
Keyboard opens when using input variable for http request0