2016-06-11, 19:52
hi . I´m trying to do a cast window information over a movie info information.
this is the movie window information:
and this is the code(this work perfect):
over this window, when a impress the ugly search button(yes, i am going to change it ), i want a window whit DialogSelect.xml which show list os cast an thumb but , this is that i have:
No cast, no thumb... but label "cast" work .
this is the code for this window(in the great enen92 inspired):
yes, the first error is that "id" value don't work, (is themoviedb id for search actor) but , at the moment, the important is actor list and thumb.
i can´t make it work
i can imagine i have several , several error.
some help please ??THANKS
this is the movie window information:
and this is the code(this work perfect):
Code:
...
ventana2 = TextBox1(title=title, plot=plot, thumbnail=photo, fanart=foto, quit=quit,id=id,item=item)
ventana2.doModal()
ACTION_SELECT_ITEM = 7
ACTION_PREVIOUS_MENU = 10
ACTION_MOVE_LEFT = 1
ACTION_MOVE_RIGHT = 2
ACTION_MOVE_DOWN = 4
class TextBox1( xbmcgui.WindowDialog ):
""" Create a skinned textbox window """
def __init__( self, *args, **kwargs):
self.getTitle = kwargs.get('title')
self.getItem = kwargs.get('item')
self.id = kwargs.get('id')
self.getPlot = kwargs.get('plot')
self.getThumbnail = kwargs.get('thumbnail')
self.getFanart = kwargs.get('fanart')
self.getQuit = kwargs.get('quit')
self.searchButton = xbmcgui.ControlButton(500, 50, 100, 30, 'Search', font='Font40', alignment=0x00000006, noFocusTexture='https://cdn3.iconfinder.com/data/icons/ilb/Perspective%20Button%20-%20Stop.png', focusTexture='', focusedColor='0xFFAAAAAA')
self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://s6.postimg.org/58jknrvtd/backgroundventana5.png')
self.title = xbmcgui.ControlTextBox(140, 60, 1130, 50)
self.quit = xbmcgui.ControlTextBox(145, 105, 1030, 45)
self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 140 )
self.thumbnail = xbmcgui.ControlImage( 813, 43, 390, 100, self.getThumbnail )
self.fanart = xbmcgui.ControlImage( 120, 365, 1060, 250, self.getFanart )
self.addControl(self.background)
self.addControl(self.searchButton)
self.addControl(self.title)
self.addControl(self.quit)
self.addControl(self.plot)
self.addControl(self.thumbnail)
self.addControl(self.fanart)
self.title.setText( self.getTitle )
self.quit.setText( self.getQuit )
try:
self.plot.autoScroll(7000,6000,30000)
except:
import xbmc
xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
self.plot.setText( self.getPlot )
def get(self):
self.show()
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU :
self.close()
if action == ACTION_MOVE_RIGHT :
self.setFocus(self.searchButton)
if action == ACTION_MOVE_LEFT:
print "omaaa"
self.setFocus(self.background)
def onControl(self, control):
if control == self.searchButton:
self.close()
id=(self.id)
print "pacomanue"
print id
ignoreWindow = Select('DialogSelect.xml',id)
ignoreWindow.doModal()
del ignoreWindow
def test():
return True
No cast, no thumb... but label "cast" work .
this is the code for this window(in the great enen92 inspired):
Code:
class Select(xbmcgui.WindowXMLDialog):
def __init__( self, *args, **kwargs ):
self.getId = kwargs.get('id')
print "caaaasiii"
print self.getId
def onInit(self):
self.getControl(1).setLabel("Casts")
import json
current_window = xbmc.executeJSONRPC('{"jsonrpc":"2.0","id":1,"method":"GUI.GetProperties","params":{"properties":["currentwindow"]}}')
window_id = json.loads(current_window)["result"]["currentwindow"]["id"]
print window_id
items = []
url="http://api.themoviedb.org/3/movie/347945/credits?api_key=xxxxxxxxxxxxxxxxx"
data = scrapertools.cachePage(url)
#data = jsontools.load_json(data)
print "ofuuuu"
print data
patroncast ='"cast"(.*?)"crew":'
matchescast = re.compile(patroncast,re.DOTALL).findall(data)
for bloque_cast in matchescast:
matches = re.compile('"name":"(.*?)"',re.DOTALL).findall(bloque_cast)
matchesthumb = re.compile('"profile_path":"(.*?)"',re.DOTALL).findall(bloque_cast)
item = xbmcgui.ListItem("str(matches)")
item.setArt({"thumb":str(matchesthumb)})
print "mi abuela es der beti"
self.getControl(6).addItems(items)
self.setFocusId(6)
def onAction(self,action):
if action.getId() == ACTION_SELECT_ITEM :
self.close()
i can´t make it work
i can imagine i have several , several error.
some help please ??THANKS