Gigi
2009-08-29, 16:31
i wrote this short testing script. it works good and shows this slideshow endlessly.
import xbmcgui, threading, os, time
class test(xbmcgui.WindowDialog):
def __init__(self):
self.pic=xbmcgui.ControlImage(0,0,1200,800,"")
self.addControl(self.pic)
self.restart()
def restart(self):
self.Thread=threading.Thread(group=None,target=sel f.loop,name=None,args=(),kwargs={})
self.Thread.start()
def loop(self):
self.imageNames=[]
for item in os.listdir("/home/gigi/Bilder"):
if item[-4:] == ".jpg" or item[-4:] == ".png":
self.imageNames.append(item)
for i in range(len(self.imageNames)):
self.pic.setImage(os.path.join("special://home", "..", "Bilder", self.imageNames[i]))
time.sleep(5)
self.restart()
mydisplay=test()
mydisplay.doModal()
del mydisplay
the problem with it is that the ram space xbmc uses gets bigger and bigger... endlessly. I'm using ubuntu hardy 8.04.
EDIT: Updated Script Code
import xbmcgui, threading, os, time
class test(xbmcgui.WindowDialog):
def __init__(self):
self.pic=xbmcgui.ControlImage(0,0,1200,800,"")
self.addControl(self.pic)
self.restart()
def restart(self):
self.Thread=threading.Thread(group=None,target=sel f.loop,name=None,args=(),kwargs={})
self.Thread.start()
def loop(self):
self.imageNames=[]
for item in os.listdir("/home/gigi/Bilder"):
if item[-4:] == ".jpg" or item[-4:] == ".png":
self.imageNames.append(item)
for i in range(len(self.imageNames)):
self.pic.setImage(os.path.join("special://home", "..", "Bilder", self.imageNames[i]))
time.sleep(5)
self.restart()
mydisplay=test()
mydisplay.doModal()
del mydisplay
the problem with it is that the ram space xbmc uses gets bigger and bigger... endlessly. I'm using ubuntu hardy 8.04.
EDIT: Updated Script Code