如何在xbmc / kodi插件中创建多个目录?

时间:2015-11-08 02:11:28

标签: python xbmc kodi

我最近开始学习如何制作xbmc / kodi插件。 我正在尝试创建多个目录,但一直得到"错误:脚本失败:"当我点击视频部分的插件图标时。

任何人都可以帮我解决这个错误并创建多个目录,这样我以后可以用数据填充它们吗?我搜索了很多关于如何制作目录的初学者教程但却找不到。提前谢谢。

    import urllib, urllib2, sys, re, os, unicodedata
    import xbmc, xbmcgui, xbmcplugin, xbmcaddon, base64

    plugin_handle = int(sys.argv[1])



    def CATEGORIES():
          add_dir("search",url,1,"")
          add_dir( "AnimalS",url,1,"")
          add_dir( "cars",url,1,"")
          add_dir("Fruits",url,1,"")


    url = None
    name = None
    mode = None
    iconimage = None

    if mode==None or url==None or len(url)<1:
            print ""
            CATEGORIES()

xbmcplugin.endOfDirectory(plugin_handle)
xbmc.log上的

错误:

ERROR: EXCEPTION Thrown (PythonToCppException) : 
-->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IndentationError'>
Error Contents: ('unindent does not match any outer indentation level', ('C:\\.....addons\\plugin.video.populateDirectory\\addon.py', 12, 32, '     add_dir("Fruits",url,1,"")\n'))
IndentationError: ('unindent does not match any outer indentation level', ('C:\\....\\addons\\plugin.video.populateDirectory\\addon.py', 12, 32, '     add_dir("Fruits",url,1,"")\n'))
-->End of Python script error report<--
ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.test/
ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.test/) failed
NOTICE: Thread BackgroundLoader start, auto delete: false

0 个答案:

没有答案