XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-04-08, 20:49   #1
schdeffan
Junior Member
 
Join Date: Apr 2004
Posts: 7
schdeffan is on a distinguished road
Default

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
schdeffan is offline   Reply With Quote
Old 2004-04-09, 14:20   #2
ent
Member
 
Join Date: Mar 2004
Posts: 74
ent is on a distinguished road
Default

there's a python_readme.txt in the cvs.
ent is offline   Reply With Quote
Old 2004-04-09, 16:00   #3
darkie
Team-XBMC Developer
 
Join Date: Sep 2003
Posts: 530
darkie is on a distinguished road
Default

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.


darkie is offline   Reply With Quote
Old 2004-04-09, 16:01   #4
schdeffan
Junior Member
 
Join Date: Apr 2004
Posts: 7
schdeffan is on a distinguished road
Default

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
schdeffan is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
myTV - TV-Guide script, with pluginsnew script BigBellyBilly Plugin/Script (Python) Development 457 2009-10-11 17:16
SYStem Hardware info mem unit info must adjust loction gamepc XBMC for Xbox Specific Support 1 2006-08-23 23:16
Music library pfidr34 XBMC for Xbox Specific Support 3 2005-06-15 21:01
Feature requests:passing window info to script thor918 Plugin/Script (Python) Development 0 2005-03-06 18:58
Script,getting info from inet Mntz Plugin/Script (Python) Development 1 2004-12-05 21:46


All times are GMT +2. The time now is 09:12.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project