TypeError: function takes exactly 1 argument (0 given)
#1
i have this script that always worked now I'm adapting the skin for gotham.

can't seem to find the issue.. any help?

Code:
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, os
from sqlite3 import dbapi2 as sqlite3
import urllib2,urllib
import re
import shutil
import glob
import sys

print '--------------------------------------------'
print sys.argv[1]
print '--------------------------------------------'

localtxt1 = 'Playing Options'
localtxt3 = 'Activate Cinema Experience?'
dialog = xbmcgui.Dialog()

class MyClass(xbmcgui.Window):
  def __init__(self):
    if dialog.yesno(localtxt1, localtxt3):
      xbmc.executebuiltin("XBMC.RunScript(script.cinema.experience,movieid="+sys.argv[1]+")")
    else:
      xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": {"movieid": '+sys.argv[1]+'}, "options": {"resume": true}}, "id": 1}' )

mydisplay = MyClass()
mydisplay.doModal()
del mydisplay

at
Code:
window = MyClass()
gives error

TypeError: function takes exactly 1 argument (0 given)

Huh
Image Image
Did I Help? Add to my reputation
Reply
#2
Code:
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, os
from sqlite3 import dbapi2 as sqlite3
import urllib2,urllib
import re
import shutil
import glob
import sys

print '--------------------------------------------'
print sys.argv[1]
print '--------------------------------------------'

localtxt1 = 'Playing Options'
localtxt3 = 'Activate Cinema Experience?'
dialog = xbmcgui.Dialog()


if dialog.yesno(localtxt1, localtxt3):
  xbmc.executebuiltin("XBMC.RunScript(script.cinema.experience,movieid="+sys.argv[1]+")")
else:
  xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": {"movieid": '+sys.argv[1]+'}, "options": {"resume": true}}, "id": 1}' )

should do exactly the same without calling the window
Reply
#3
Thanks!!!

that worked like a charm... makes sense too. (actually I did try it before but I was dumb enough non remove indentation from if / else ehmmm)

so since I use a few other scripts here and there should I try and make them all happen without calling the windows? no windows calling in gotham?

Sorry for my lack of python knowledge and thank you very much for the help!

---

EDIT > Oh YES! thank you for makin' me realize i was USELESSLY calling windows !! adapting the scripts right now...
Image Image
Did I Help? Add to my reputation
Reply
#4
you call python window when you actually need a window and you need to pass one as argument


see how its done here - > https://github.com/amet/script.xbmc.subt...ult.py#L26
and window is here -> https://github.com/amet/script.xbmc.subt...s-main.xml

that way xbmc will open that window or any other xml window found in skin path or addon/skin path
Reply

Logout Mark Read Team Forum Stats Members Help
TypeError: function takes exactly 1 argument (0 given)0