xbmc プログラムに python スクリプトを使用しています。問題なく addons.py を開くことができますが、addons.py から test.py を開くことができません。私は現在、2 つの異なるファイル addons.py と test.py でコードを使用しています。
Addons.py:
import xbmcgui
import xbmcaddon
import buggalo
from test import MyClass
buggalo.SUBMIT_URL = 'http://tommy.winther.nu/exception/submit.php'
try:
w = xbmcgui.WindowXML( "script-tvguide-mainmenu.xml", xbmcaddon.Addon().getAddonInfo('path'), "Default" )
w.doModal()
del w
print 'Hello!'
mydisplay = MyClass()
mydisplay.doModal()
except Exception:
buggalo.onExceptionRaised()
test.py:
print "hello!"
import xbmc
import xbmcgui
#get actioncodes from https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h
ACTION_MOVE_LEFT = 1
ACTION_MOVE_RIGHT = 2
ACTION_MOVE_UP = 3
ACTION_MOVE_DOWN = 4
class MyClass(xbmcgui.WindowXML):
def onAction(self, action):
if action == ACTION_MOVE_LEFT:
print "You have press on the left arrow button!"
self.close()
if action == ACTION_MOVE_RIGHT:
print "You have press on the right arrow button!"
self.close()
if action == ACTION_MOVE_UP:
print "You have press on the up arrow button!"
self.close()
if action == ACTION_MOVE_DOWN:
print "You have press on the down arrow button!"
self.close()
addons.py を開くと、addons.py から test.py を開くことができないため、本当に助けが必要です。のエラーが表示されますfunction takes at least 2 arguments (0 given)。どうすればいいのかわからない。
ログは次のとおりです。 http://pastebin.com/Qacy0UnA
addons.py スクリプトから test.py を開く方法を知っている人はいますか?