SkinString to Python script?
#1
Hey Guys,

I'm searching for a method to pass a skin-string to a python script in order to pass the skin-string as a parameter for a third-party app, like dos-script or bash-script?
Did not find any hint here in the forum and on google...
Somebody already tried this?

cheers,
mad-max
- - - Tribute to Metallica - - -
If I managed to help you, please click my reputation
Reply
#2
Max,

Is the link to the script part of the skin code? If so, couldn't you just pass the string as an infolabel - e.g.
Code:
<onclick>RunScript(script.myscript, skinstring=$INFO[Skin.String(your-skin-string)])</onclick>
You could then parse the arguments in the python script.

Or have I misunderstood?

el_P
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#3
Hey el_p,

thanks for replying...
yes, starting the script is part of the skin...I suppose adding several skin-strings after each other won't be a problem...
Let's see...
I'll try and report back...

cheers,
Max
- - - Tribute to Metallica - - -
If I managed to help you, please click my reputation
Reply
#4
mad-max Wrote:Hey el_p,

thanks for replying...
yes, starting the script is part of the skin...I suppose adding several skin-strings after each other won't be a problem...
Let's see...
I'll try and report back...

cheers,
Max

You can pass as many strings as you like, just do something like
Code:
skinstring1=foo&skinstring2=bar&skinstring3=...

You can then parse them in your script with the following.
Code:
try:    
  # parse sys.argv for params    
  try:params = dict( arg.split( "=" ) for arg in sys.argv[ 1 ].split( "&" ) )    
  except:params =  dict( sys.argv[ 1 ].split( "=" ))
except:    
  # no params passed    
  params = {}
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply

Logout Mark Read Team Forum Stats Members Help
SkinString to Python script?0