![]() |
Release script.toolbox - Printable Version Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12) +---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300) ---- Thread: Release script.toolbox (/showthread.php?tid=207618) |
RE: Suggestion: Script to expose python functions to skinners - phil65 - 2014-10-31 okay, seems some demand is there, my impression is: 1) put it into a separate add-on 2) use way one (setting properties) because it´s easier to read and more friendly to non-coders Will tackle that when i find some free minutes. Cheers RE: Suggestion: Script to expose python functions to skinners - wyrm - 2014-10-31 phil65, I for one would love to see something like this and yes to add some additional python accessible functions as MassIV suggested. One I would like would be 'FileExists'. I know the need for this has lessened to some degree as a number of former custom image types have made their way into mainline Kodi, but the need to have a blank fallback image for an image control that you check to see if your image loaded is a PITA. PHP Code: <control type="group"> In the above example each one of the $VAR's has a default value of 'blank.png' which is used in the check in the next image block. Would be really nice to be able to give a script a list of images to check and have it return the first one found. To display one image block with one visible condition has got to be faster and easier to read for the skin coder. I'm sure if we thought about it, there would be a number of situations like this one that could be handled better than they currently are. Just my 2c worth Wyrm RE: Suggestion: Script to expose python functions to skinners - phil65 - 2014-10-31 you can use IsEmpty(VideoPlayer.Art(xxx)) (or am i missing something?) RE: Suggestion: Script to expose python functions to skinners - wyrm - 2014-10-31 (2014-10-31, 06:07)phil65 Wrote: you can use IsEmpty(VideoPlayer.Art(xxx)) (or am i missing something?)phil65, Sorry mate, you're missing something. That would work if you are using something supported by VideoPlayer.Art(xxx), but what happens if there is a art type not supported by Kodi? Or if you wanted to go that extra mile and try to bring in a image that had not been scanned into the DB but was still available in the local directory? For example here is one of my $VAR's PHP Code: <variable name="ListViewVideoLogo"> That's a lot of checks and a lot of code just to make sure something nice is showing on screen (and very likely a lot of time if I get right to the end before I find something to display). Wyrm RE: Suggestion: Script to expose python functions to skinners - phil65 - 2014-10-31 sorry, won´t do that. Directly accessing the disc is something I am very careful with. Skins shouldnt do that IMO because for example it can make NAS drives wake up. The user should make sure that all wanted artwork is in the database. RE: Suggestion: Script to expose python functions to skinners - Hitcher - 2014-11-06 (2014-10-31, 01:23)phil65 Wrote: okay, seems some demand is there, my impression is: Sounds good to me, thanks. RE: Suggestion: Script to expose python functions to skinners - fastcolors - 2014-11-09 +1 to this. RE: Suggestion: Script to expose python functions to skinners - phil65 - 2014-11-09 here it is: script.toolbox Documentation will follow in some time. ![]() nice new feature: blurred background image + average color for nowplaying screen (not 100% ready yet): https://www.youtube.com/watch?v=jd8QYBia4RU&feature=youtu.be RE: Suggestion: Script to expose python functions to skinners - nessus - 2014-11-10 Nice ![]() Can you point somewhere in script's code to look about the functions until you have the documentation ready ? Cheers Nessus RE: Suggestion: Script to expose python functions to skinners - phil65 - 2014-11-10 (2014-11-10, 02:00)nessus Wrote: Nice default.py. script has same stucture as script.extendedinfo. RE: Suggestion: Script to expose python functions to skinners - ronie - 2014-11-10 Code: 01:25:56 T:140707923556096 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- also keep in mind that PIL currently doesn't work on android at all: 5218 (PR) RE: Suggestion: Script to expose python functions to skinners - phil65 - 2014-11-10 (2014-11-10, 02:29)ronie Wrote: yes, the ImageGrab() was only for testing and will probably get removed, the blur is intended to be used with an infolabel. (info=blur,id=$INFO[...]) didn´t know about the PIL-on-Android issue though. that´s a pity ![]() RE: Suggestion: Script to expose python functions to skinners - wyrm - 2014-11-10 (2014-10-31, 08:29)phil65 Wrote: sorry, won´t do that. Directly accessing the disc is something I am very careful with. Skins shouldnt do that IMO because for example it can make NAS drives wake up.phil65, I would have though you need your NAS to wake up anyway, as you are looking for information on a listitem, thus you are about to play something. But I also understand you reasoning on this as well, so fair enough. Another suggestion if I may. It would be nice to be able to call a number of dialogs from within the skin. For example while we can code a custom version of a selection dialog or a yes/no dialog, we have already coded one of these, so why do we need to code it all over again? If I could provide two options to display and have the script return a result with either one of those options or a code to say that the user exited the dialog without choosing an option that would save recoding a yes/no dialog for each instance of a yes/no that I wanted to use. Finally, love the blur idea. As to Ronie's post about Android not having a working PIL library, could you not just return the image unchanged if you can't find PIL. That way most platforms will have a working blur and when Android issue is sorted, so will they. Wyrm RE: Suggestion: Script to expose python functions to skinners - phil65 - 2014-11-10 (2014-11-10, 10:00)wyrm Wrote:no, in general you only access your xbmc userdata folder, not your source path.(2014-10-31, 08:29)phil65 Wrote: sorry, won´t do that. Directly accessing the disc is something I am very careful with. Skins shouldnt do that IMO because for example it can make NAS drives wake up.phil65, yesnodialog and selectdialog are already implemented. Example: Code: RunScript(script.toolbox,info=yesnodialog,header=Shutdown,text=$LOCALIZE[31149],yesaction=Dialog.Close(all,true)|Quit()) ![]() Not sure yet how to deal with the android situation. Will see. RE: Suggestion: Script to expose python functions to skinners - wyrm - 2014-11-10 (2014-11-10, 15:03)phil65 Wrote: no, in general you only access your xbmc userdata folder, not your source path.Sure I get that, it's just if I'm looking thru my video library (userdata folder) it's usually because I'm looking for something to play (My source path), so having my NAS spool up while I'm looking is a positive, not a negative. But, that's my use case and I appreciate that it may not be everyone's use case (or anyone's use case for that matter). Was just a suggestion, move along, nothing to see here ;-) Quote:yesnodialog and selectdialog are already implemented. Example:Cool, will have to go poke thru your script and see what else is lurking there (hopefully my brain will not explode from reading python) Quote:The blur stuff should be used in a senseful way, please don´t clutter your skins with itNo such thing as a free lunch, will definitely use this one sparingly. My vertical home menu used to use skin supplied blurred icons to denote depth (icons were coming from the distance and into view), but could not do the same with custom user supplied icons, so I dropped this idea. I instead used a colour diffuse (darker was further away) and made the distant icons smaller. Would be nice to be able to re-add this original idea and still allow for custom icons. Thanks for working on these scripts, I know my skin has benefited from a number of them. Wyrm (xTV-SAF) |