1

我只是尝试将 Python 模块twisted.internet用于我目前正在编写的 XBMC 插件。当我尝试执行我的插件时,我遇到了一个我无法理解的异常。当我注意到以下几行引起了所有麻烦时,我感到非常惊讶:

import xbmc, xbmcgui, xbmcaddon # Can be removed; doesn't change anything.
from twisted.internet import reactor, defer

问:我如何twisted用于开发我的 XBMC 插件?任何帮助,将不胜感激!

不幸的是,我对 XBMC 和 XBMC 都是新手,twisted而且我可以提供的细节很少。我认为插件没有在主线程中执行。我目前正在使用 XBMC 11 进行测试。(更新:我正在使用最新的 XBMC、Python 和 Debian 测试包twisted。导入和使用该模块可通过常规脚本和 XBMC 服务工作,但不能来自 XBMC 脚本。)xbmc.log文件中的堆栈跟踪是:

File "/home/markus/.xbmc/addons/script.marmay.wol/timewol.py", line 2, in <module>
  from twisted.internet   import  reactor, defer
File "/usr/lib/python2.7/dist-packages/twisted/internet/reactor.py", line 37, in <module>
  from twisted.internet import default
File "/usr/lib/python2.7/dist-packages/twisted/internet/default.py", line 50, in <module>
  install = _getInstallFunction(platform)
File "/usr/lib/python2.7/dist-packages/twisted/internet/default.py", line 44, in _getInstallFunction
  from twisted.internet.pollreactor import install
File "/usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.py", line 19, in <module>
  from zope.interface import implements
File "/usr/lib/python2.7/dist-packages/zope/interface/__init__.py", line 58, in <module>
  _wire()
File "/usr/lib/python2.7/dist-packages/zope/interface/interface.py", line 805, in _wire
  classImplements(Attribute, IAttribute)
File "/usr/lib/python2.7/dist-packages/zope/interface/declarations.py", line 447, in classImplements
  spec = implementedBy(cls)
File "/usr/lib/python2.7/dist-packages/zope/interface/declarations.py", line 318, in implementedByFallback
  if isinstance(spec, Implements):
TypeError: 'NoneType' object is not callable

这是第一个相关的错误消息。

谢谢你的帮助!

4

0 回答 0