I'm terrible at python and need your help with two questions
#26
Just checked you blog and I want to point something out, especially since you're offering this up to others: the http api was depreciated in Frodo so the call you're using to activate it won't work in Frodo. You'll need to trigger the notification via the JSONRPC

The docs are a little weird because it's usually only skins that create windows and animations. Looking at setAnimations (http://mirrors.xbmc.org/docs/python-docs...Animations) you'll see that it calls for a "list of tuples." A "list" is a set of things surrounded by [ ] and separated by commas. A tuple is very similar, but it's a set of things surrounded by ( ) and separated by commas. What it's looking for is a list of all animations to apply. Each animation is specified by a two element tuple of (eventtype, string of attributes). Both are explained here: http://wiki.xbmc.org/?title=Animating_Your_Skin Event types in 3.1, and attributes in 3.2

The fade effect's start and end attributes are the visibility to start at and the visibility to end at. The time attribute is how many milliseconds to spend getting there.

Putting it all together, if you want the image to fade in, wait 1 second, then fade back out, it would look something like this:
Code:
viewer.image.setAnimations([('conditional', 'effect=fade start=0 end=100 time=500 condition=true',) , ('conditional', 'effect=fade start=100 end=0 time=500 delay=1000 condition=true',)])

EDIT: Ronie beat me again lol
Reply


Messages In This Thread
RE: I'm terrible at python and need your help with two questions - by Bstrdsmkr - 2013-02-20, 00:33
Logout Mark Read Team Forum Stats Members Help
I'm terrible at python and need your help with two questions0