2006-07-22, 20:06
ok a guy on oxbox-scene forums ;blittan; threw this together for me and im having a little bit of trouble getting it to work, i figured id ask here first since hes busy workin on another project and i dont wanna be a neusance.
this is to make shortcuts for whatever emulator specified for all the roms in the rompath, but it just dies as soon as its launched nothing happens, any help?
any help would be appreciated
this is to make shortcuts for whatever emulator specified for all the roms in the rompath, but it just dies as soon as its launched nothing happens, any help?
Code:
import xbmc, xbmcgui, os
# this needs to be changed to the emulator you want the cut for (remember \\ is one \)
emulator = "F:\\emulators\\snes\\default.xbe"
#path to the roms (takes all files)
romPath = "F:\\emulators\\snes\\roms"
# path to thumbnail, otherwise it will use a thumbnail named like the rom (EG: myrom.zip -> myrom.tbn)
thumb = "E:\\Zsnexbox\\prev"
# # # DON'T CHANGE UNDER THIS
def savecut(cut,label,game,thumb):
f = open(cut, "wb")
f.write("<shortcut>\n")
f.write(" <path>"+emulator+"</path>\n")
f.write(" <thumb>"+thumb+"</thumb>\n")
f.write(" <label>"+label+"</label>\n")
f.write(" <custom>\n")
f.write(" <game>"+game+"</game>\n")
f.write(" </custom>\n")
f.write("</shortcut>\n")
f.close()
def listdir(tdir):
global thumb
dl = os.listdir(tdir)
for ret in dl:
if os.path.isdir(tdir+ret):
listdir(tdir+ret)
else:
if ret != 'list.py':
label = ret[:-4]
cut = tdir+label+".cut"
if thumb == '':
thumb = tdir+label+".tbn"
game = tdir+ret
savecut(cut,label,game,thumb)
listdir(romPath)
XBMC.Notification('DONE','Shortcuts created')
any help would be appreciated