Here's a script for Library Info
#1
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:

Quote: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
Reply
#2
there's a python_readme.txt in the cvs.
Reply
#3
Quote:@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.
ok, seeing now that it is possible to create such a file automaticly and that the 'python / xbmc' object structure seems ok now , i'll start adding those doc strings.

edit: btw, iirc python has already a module (pydoc?) that can generate a nice document of it



Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
oh, haven't seen that. thanks for the hint.

maybe the script is still useful as it could automate the process of creating such a file.

- stephan
Reply

Logout Mark Read Team Forum Stats Members Help
Here's a script for Library Info0