PDA

View Full Version : Script browser


YuYu
2005-06-20, 02:44
i was wondering if anyone of the python crowd around here would mind rewriting or fixing the scriptbrowser script. here (http://www.xbmcscripts.com/modules/mod_docman/includes_frontend/index.php?option=com_docman&task=cat_view&gid=28&itemid=36)

i actually only got this script to work twice, but the times i used it, i loved it.. i have all my custom icons and whatnot setup for the script to use, but it never has worked properly (except twice).

so, i am requesting for someone to write a script that works just like this one, "crawling" the scripts directory for folders with scripts inside of them by the same name, with icon support would be sweet. it appears from looking at the script it would not be hard for a seasoned python scripter.

thanks in advance for anyone willing...

Asteron
2005-06-20, 02:48
a replacement is in the works.

http://www.xboxmediaplayer.de/cgi-bin....t=13564 (http://www.xboxmediaplayer.de/cgi-bin/forums/ikonboard.pl?act=st;f=21;t=13564)

-ast

YuYu
2005-06-20, 03:07
umm, that's not really what i want...
i'm not really into having a script that downloads other scripts and whatnot from a website, doesn't appeal to me. i just want to have a script that will list with thumbnails, my locally installed scripts and then launch the selected script.

dmanfan
2005-06-20, 05:01
this does seem like a good script, but yuyu, how'd you get it work? i am having no luck in getting it to work.

Nuka1195
2005-06-20, 06:06
try this.

after: import os,xbmc,xbmcgui

add: from time import sleep

YuYu
2005-06-21, 01:43
try this.

after: import os,xbmc,xbmcgui

add: from time import sleep
hmm, thanks nuka for the input. it appears that fixes the problem of the script not actually running but, it will not "launch" any scripts... it just says executing and never does anything. on the two occasions i had it working, it actually did launch the scripts.
weird! thanks though for the bit of input, i guess i can mess around with it if no one else is going to take a stab at fixing it up a bit.

EnderW
2005-06-21, 01:50
umm, that's not really what i want...
i'm not really into having a script that downloads other scripts and whatnot from a website, doesn't appeal to me. i just want to have a script that will list with thumbnails, my locally installed scripts and then launch the selected script.
well, asteron is right (although that specific thread doesn't say so)...a script brower is planned as a part of that installer. it will be a while until it is released though..

Nuka1195
2005-06-21, 03:33
i thought the line that launches the script did work, though i do it differently.

try this:

replace:
xbmc.executescript(self.getscriptpath() + "\\" + self.getselitem() + ".py")

with:
xbmc.executebuiltin('xbmc.runscript(self.getscript path() + "\\" + self.getselitem() + ".py")')

i still think putting all the main scripts in the root directory and any supporting files off a main sub directory with there own directory works the best.

root -
script.py
script.tbn
extras-
scripts directory-
script.cfg
background.png

DonJ
2005-06-21, 12:50
hi,

more information can be found in this thread:
http://www.xboxmediaplayer.de/cgi-bin....t=13564 (http://www.xboxmediaplayer.de/cgi-bin/forums/ikonboard.pl?act=st;f=21;t=13564)

YuYu
2005-06-21, 18:48
ok well then. i modified the script browser ever so slightly and now it works how i always wanted it to.

put the folder in your scripts folder and it should work perfect. to add icons for your script, you name the icon the name of the folder your script is in, such as if i have a quicktimebrowser folder, the icon would be quicktimebrowser.jpg...

if it works, i'll post it as a scriptbrowser mod to the xbmc scripts site.

dload it here (http://yuyu.home.mchsi.com/files/scriptbrowser.rar)

Nuka1195
2005-06-21, 20:58
i looked at your changes.

you have a duplicate addcontrol that should crash the script. you should delete one of them.

def newsel(self):
sleep(0.05)
self.infolabel.setlabel("browsing...")
self.debuglabel.setlabel(self.getscriptpath() + self.getselitem() + ".py")
self.removecontrol(self.infoimage)
del self.infoimage
self.infoimage = xbmcgui.controlimage(75,125,100,100,scriptsdir + "scriptbrowser\\no.jpg")
self.addcontrol(self.infoimage)
self.infoimage = xbmcgui.controlimage(75,125,100,100,self.getscript path() + self.getselitem() + ".jpg")
self.addcontrol(self.infoimage)

YuYu
2005-06-22, 00:56
i looked at your changes.

you have a duplicate addcontrol that should crash the script. you should delete one of them.

def newsel(self):
sleep(0.05)
self.infolabel.setlabel("browsing...")
self.debuglabel.setlabel(self.getscriptpath() + self.getselitem() + ".py")
self.removecontrol(self.infoimage)
del self.infoimage
self.infoimage = xbmcgui.controlimage(75,125,100,100,scriptsdir + "scriptbrowser\\no.jpg")
self.addcontrol(self.infoimage)
self.infoimage = xbmcgui.controlimage(75,125,100,100,self.getscript path() + self.getselitem() + ".jpg")
self.addcontrol(self.infoimage)
that's on purspose, it will not crash the script, it is simply overwritten if an image exists for the given script, if not then the "no image available" image is shown...

i could not get an if fileexists(blah): statement to work correctly there so, that is what i did...

it works fine for me, does it not on your end?

Nuka1195
2005-06-22, 03:01
two addcontrol's for the same control name will cause an error, but if it works.

after the script you select ends, is scriptbrowser still running? it's suppose to.

YuYu
2005-06-22, 04:53
two addcontrol's for the same control name will cause an error, but if it works.

after the script you select ends, is scriptbrowser still running? it's suppose to.
yes, it is still running.

i think i have it running the way i want, thanks for the input nuka1195. now then, anymore suggestions for fixing it up or do you think it is pretty good as is?

Nuka1195
2005-06-22, 05:06
sounds like it works good.

Nuka1195
2005-06-22, 05:25
as a side note. i was wrong. it only errors when you do a duplicate addcontrol without defining a control.

hmm, oh well, nice job.

YuYu
2005-06-22, 06:59
well, i fixed it completely i think. foudn out i was using the wrong statement for a file existing by doing a little searching, now the control is only added once. i also fixed up the alignment and whatnot.

dload it here (http://yuyu.home.mchsi.com/files/scriptbrowser.rar)

you think i should post it as a modified version to the xbmc scritpts site?

Nuka1195
2005-06-22, 07:23
sure,

WarriorSan
2005-08-28, 22:26
well, i fixed it completely i think. foudn out i was using the wrong statement for a file existing by doing a little searching, now the control is only added once. i also fixed up the alignment and whatnot.

dload it here (http://yuyu.home.mchsi.com/files/scriptbrowser.rar)

you think i should post it as a modified version to the xbmc scritpts site?
thanks i was looking for a fix..the one on xbmcscripts.com is still the old version.