schdeffan
2004-04-08, 20:49
hi,
as there's little library info on what methods the modules xbmc and xbmcgui export i wrote a little script that creates a (atm ugly html-file) with at least some info:
import xbmcgui, xbmc
def startfile():
* *f = open('q:\\lib.html', 'w')
* *f.write('<html><body>')
* *f.close()
def stopfile():
* *f = open('q:\\lib.html', 'a')
* *f.write('</body></html>')
* *f.close()
def addmodule(module, d):
* *str = '['
* *for t in d:
* * * *if t[:2] != '§§':
* * * * * str = str + t + ', '
* *str = str + ']'
*
* *dmodule = module + '.§§doc§§'
* *docs = eval(dmodule)
* *f = open('q:\\lib.html', 'a')
* *f.write('<p><b>%s =</b> %s <br>%s</p>' % (module, str, docs))
* *f.close()
def dodir(module, depth, max):
* *if depth <= max:
* * * *print module
* * * *try:
* * * * * *d = dir(eval(module))
* * * * * *addmodule(module, d)
* * * * * *for t in d:
* * * * * * * *if t[:2] != '§§':
* * * * * * * * * p = module + '.' + t
* * * * * * * * * dodir(p, depth + 1, max)
* * * *except:
* * * * * *pass * * * * * * * * *
* * * *
* * * *
startfile()
dodir('xbmc', 0, 2)
dodir('xbmcgui', 0, 2)
stopfile()
please replace the § with underscores, cause otherwise this won't display correctly in this board
the file will obviously be q:\lib.html
@darkie: if you could fill in the doc strings a bit more, e.g. what does it, which arguments, how to call, etc., we could improve this script a bit and have automatically create a good library info on the modules xbmc is exporting.
with this, on every new release of xbmc script coders could run the script and see what's new / possible
-stephan
as there's little library info on what methods the modules xbmc and xbmcgui export i wrote a little script that creates a (atm ugly html-file) with at least some info:
import xbmcgui, xbmc
def startfile():
* *f = open('q:\\lib.html', 'w')
* *f.write('<html><body>')
* *f.close()
def stopfile():
* *f = open('q:\\lib.html', 'a')
* *f.write('</body></html>')
* *f.close()
def addmodule(module, d):
* *str = '['
* *for t in d:
* * * *if t[:2] != '§§':
* * * * * str = str + t + ', '
* *str = str + ']'
*
* *dmodule = module + '.§§doc§§'
* *docs = eval(dmodule)
* *f = open('q:\\lib.html', 'a')
* *f.write('<p><b>%s =</b> %s <br>%s</p>' % (module, str, docs))
* *f.close()
def dodir(module, depth, max):
* *if depth <= max:
* * * *print module
* * * *try:
* * * * * *d = dir(eval(module))
* * * * * *addmodule(module, d)
* * * * * *for t in d:
* * * * * * * *if t[:2] != '§§':
* * * * * * * * * p = module + '.' + t
* * * * * * * * * dodir(p, depth + 1, max)
* * * *except:
* * * * * *pass * * * * * * * * *
* * * *
* * * *
startfile()
dodir('xbmc', 0, 2)
dodir('xbmcgui', 0, 2)
stopfile()
please replace the § with underscores, cause otherwise this won't display correctly in this board
the file will obviously be q:\lib.html
@darkie: if you could fill in the doc strings a bit more, e.g. what does it, which arguments, how to call, etc., we could improve this script a bit and have automatically create a good library info on the modules xbmc is exporting.
with this, on every new release of xbmc script coders could run the script and see what's new / possible
-stephan