Videodatabase query to xml file
#1
Hi everyone,

i'm using xbmc eden and i need help in getting out some information from the library directly into a xml file.
for that i have tried the following python script from skin influence,(xbmc dharma), "listGenre.py" but without success.
i don't know nothing about scripting.

this is the code of the script:

PHP Code:
import xbmc
from xbmcgui import Window
from urllib import quote_plus
unquote_plus
import re
import sys
import os

class Main:
    
def __init__self ):
        
fileGenre=open('special://skin/720p/ListGenre.xml','w')

        
# sql statement
        
sql_genres "select genre.* from genre "
        
# query the database
        
genres_xml xbmc.executehttpapi"QueryVideoDatabase(%s)" quote_plussql_genres ), )
        
# separate the records
        
genres re.findall"<record>(.+?)</record>"genres_xmlre.DOTALL )
        
# enumerate thru our records and set our properties
        
fileGenre.write('<includes>\n')
        
fileGenre.write('\t<include name="ListGenre">\n')
        
fileGenre.write('\t\t<content>\n')

        for 
countgenre in enumerategenres ):
            
# separate individual fields
            
fields re.findall"<field>(.*?)</field>"genrere.DOTALL )
            
# fields[1]=idgenre, fields[2]=genre
            
fileGenre.write('\t\t\t<item id="'+fields[0]+'">\n')
            
fileGenre.write('\t\t\t\t<label>"'+fields[0]+'"</label>\n')
            
fileGenre.write('\t\t\t\t<label2>'+fields[1]+'</label2>\n')
            
fileGenre.write('\t\t\t\t<onclick>-</onclick>\n')
            
fileGenre.write('\t\t\t</item>\n')
        
fileGenre.write('\t\t</content>\n')
        
fileGenre.write('\t</include>\n')
        
fileGenre.write('</includes>')
        
fileGenre.close()

if ( 
__name__ == "__main__" ):
    
Main() 


so, is there any way to make this work or to convert it in order to work in eden and frodo?
i am trying to use the information for creating "home-buttons"
thanks for any help you can give.
Reply

Logout Mark Read Team Forum Stats Members Help
Videodatabase query to xml file0