def init_addon(): path = xbmc.translatePath(os.path.join(addonsavepath , 'cache', 'images')) if os.path.isdir(path)==False: os.makedirs(path) path = xbmc.translatePath(os.path.join(addonsavepath , 'cache', 'feeds')) if os.path.isdir(path)==False: os.makedirs(path) frf = xbmc.translatePath(os.path.join( addonsavepath, 'startup.txt' )) firstrun = os.path.isfile(frf) if firstrun==False: dia_title = common.get_lstring(32000) dia_l1 = common.get_lstring(32001) dia_l2 = common.get_lstring(32002) dia_l3 = common.get_lstring(32003) dialog = xbmcgui.Dialog() ret = dialog.yesno(dia_title, dia_l1, dia_l2, dia_l3) if ret==1: util.download_cache() file = open(frf, 'w') file.write("Startup Completed") file.close()
# Mode 4: # This Mode gets a parameter as URL so we can do various tasks # It is currently in use to run addon built-in functions elif mode==4: if url=="clean_rss": util.clean_rss() elif url=="clean_ico": util.clean_ico() elif url=="clean_all": util.clean_all() elif url=="download_img": util.download_cache() # Mode 5: # This mode is to grab the actual URL and pass it to XBMC elif mode==5: newurl = common.ResolveURL(url) li=xbmcgui.ListItem(path = newurl) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, li) # Mode 6: # Testing shit elif mode==6: print "MODE 6!" #xbmcplugin.endOfDirectory(int(sys.argv[1])) #DialogAddonScan.Demo()