Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The class definition:
- import xbmcgui
- JUSTIFY_CENTER = 2
- class RowItem(xbmcgui.ControlGroup):
- def __init__(self, X=0, Y=0, width=380 , height=280, bgdSegmented=False, textColor='0xFFFFFF00',
- bgdColor='0xFFAA0000', alignment=JUSTIFY_CENTER, font='font12'):
- pass
- Code instantiating the class:
- item = RowItem(X,rowY,width,height,bgdSegmented=False,bgdColor='0xFFFF00FF', alignment=0)
- Error Generated by Kodi Python:
- "/storage/.kodi/addons/service.ltvpl/addon.py", line 198, in PlaylistConstructor
- alignment=0)
- TypeError: function takes at most 4 arguments (7 given)
- Clearly, all of the arguments defined in init are kwargs except the first. Why did Kodi Python think that there are 4 positional parameters and why did it reject the kw parameters as being excessive? In order to get the code to run, I had to eliminate the kwargs when instantiating the class. Obviously, doing that is not a proper solution.
- By the way I specified xbmc.python version 2.24.0 in my addon.xml file.
- In the for what it's worth department, I ran a modified version of the above code under Linux (Python 2.7.13) on the same system Kodi is running on and did not get any errors at all.
Advertisement
Add Comment
Please, Sign In to add comment