I'm terrible at python and need your help with two questions
#61
Hi there.

I got the 5020L DLink camera and I would like to apply this script to it. SO I downloaded the doorbell.py and change it to:

Code:
import xbmc, xbmcgui, time, urllib

#inherit from WindowDialog instead of Window so that it's shown on top of
#what's onscreen instead of replacing it entirely
class CamView(xbmcgui.WindowDialog):

    def __init__(self):
        #Define image location and size
        self.image = xbmcgui.ControlImage(870, 438, 380, 253, "")
        self.addControl(self.image)

viewer = CamView()
viewer.show()
start_time = time.time()
while(time.time() - start_time <= 14):
    #set url to ip cam image, password auth not supported
    urllib.urlretrieve("http://10.1.1.50/mjpeg.cgi", 'C:\Users\Loki\AppData\Roaming\XBMC\addons\script.doorbell

\bell_icon.png')
    viewer.image.setImage("")
    viewer.image.setImage("bell_icon.png")
    #Define image transparency
    viewer.image.setAnimations([('conditional', 'effect=fade start=90 end=90 time=0 condition=true',)])
    xbmc.sleep(500)
viewer.close()
del viewer

When I press launch it gives me an error.

What am I doing wrong?
Reply


Messages In This Thread
RE: I'm terrible at python and need your help with two questions - by lokipoki - 2013-11-19, 15:50
Logout Mark Read Team Forum Stats Members Help
I'm terrible at python and need your help with two questions0