SVN Scripts
#1
Updated: Feb 28th, 2007

This package is for skinners who want to include a link to a script in your skin and want some kind of message if the script doesn't exist.

What this does is, checks if the script exists, then runs it if it does. If not the user will get a dialog with the option to download the script. It grabs the latest tagged version.

Copy the folder from the package into your skin somewhere and link to the script in there.

Code:
<onclick>XBMC.RunScript(q:\skin\skin-name\extras\SVNScripts\XBMC Lyrics.py)</onclick>

*Updated:
This package includes all the scripts in SVN that have been tagged:

AccuWeather.py
Ambient Light Control Pad
Apple Movie Trailers.py
Poker Timer II
Tetris.py
XBMC Changelog.py
XBMC Lyrics.py
xStocks.py
Youtube.py (not tested, this is the original)
*more may be added in the future.

Download:
http://xbmc-scripting.googlecode.com/svn...cripts.zip


*New:
There is also a version that supports sys.argv[]. No need for any updates when a new script is tagged.

*Note this version requires XBMC Rev-7908 or newer.

You link your button to launcher.py and supply the script name.

Code:
<onclick>XBMC.RunScript(q:\skin\skin-name\extras\SVNScripts_argv\launcher.py,XBMC Lyrics)</onclick>

***** committed to the main SVN trunk *****
Download version with sys.argv[] support from the main trunk.
http://xbmc-scripting.googlecode.com/svn...ripts_argv[url=http://xbmc-scripting.googlecode.com/svn/tags/SVNScripts/SVNScripts_argv.zip][/url]

Thanks to Jezz_X for the original idea and Blittan for the download idea.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#2
Thanks for this Nuka.

This should be really useful.
Reply
#3
Hey this is a really good idea Nuka... Smile great thinking as always. I guess if we could pass arguments there wouldnt be need to have different .py files?
Reply
#4
Yeah, it is, it was jezz's idea and blittan thought of the download.

If we had sys.argv[0], the script could just be named tight with no editing.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
Nuka1195 Wrote:If we had sys.argv[0], the script could just be named tight with no editing.
Ask and ye shall receive! http://sourceforge.net/tracker/index.php...tid=581840
Reply
#6
thought of that direction of development too, but was too tired when i coded the xbmcscripts one up.

nice thinking of you there Big Grin
Reply
#7
Asteron, where the heck were you when i was trying to get this working? Smile
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
*shrug* It actually turned out pretty straightforward. Donno just put it up to SVN on 2007/02/24 Scripters can follow the following guide on the wiki to using arguments http://www.xboxmediacenter.com/wiki/inde..._Arguments

Skinners should take note of the updated XBMC.RunScript definition here
http://www.xboxmediacenter.com/wiki/inde..._Functions

Actually this is kinda big I think for skinners since alot of skins use python for things like selecting font color, now the skin can do all the GUI purely and let python do a simple backend without ever putting up its own gui. Doing the gui purely in the skin is sure to be easier for skinners.

For instance you can make a button that says "Purple Font" on it and the OnClick would be like
"XBMC.RunScript(Q:\skin\Project Mayhem III\extras\fontcolor.py,FFFF00FF)"

Maybe I should put this in a new topic?
Reply
#9
Might be a good idea for it's own thread and yes this adds a lot of possibilties.

Good job.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#10
@Asteron, is there anyway to set sys.argv[0] = scriptname?
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#11
Nuka sys.argv[0] = scriptname but only when the script is launched by the builtin XBMC.RunScript(). This is the only place where I exposed argument support.

Really though most real scripts (not integrated into a skin) are just 'default.py' and so you might as well get a real name from os.getcwd()
Reply
#12
Neat... I'm sure this will be very handy!
Image
Reply
#13
Nice!

That would be a nice idea for SVN-Skins, too Wink
Philips TV with Kodi 20.2 with IPTV --- Orbsmart 500 Android 21 alpha/beta as Online-radio/TV in the kitchen
Reply
#14
New version: Updated 1st post
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#15
You may now get this in the main SVN trunk, just the argv version as that's the easiest to use. I also added a strip() to sys.argv[1] in case someone adds a space before or after the script name.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
SVN Scripts0