我只是尝试将Python模块twisted.internet
用于我目前正在编写的XBMC插件。当我尝试执行我的附加组件时,我得到了一个我无法理解的异常。当我注意到以下几行造成了所有麻烦时,我感到非常惊讶:
import xbmc, xbmcgui, xbmcaddon # Can be removed; doesn't change anything.
from twisted.internet import reactor, defer
问题:如何使用twisted
开发我的XBMC插件?任何帮助将不胜感激!
不幸的是,我是XBMC和twisted
的新手,我可以提供更多细节。我认为插件没有在主线程中执行。我目前正在使用XBMC 11进行测试。 (更新:我使用的是最新的XBMC,Python和twisted
的Debian测试包。导入和使用该模块可以使用常规脚本和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
这是第一个相关的错误消息。
感谢您的帮助!