Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs
#31
Hi there,

I find Kodistubs really-really helpful, however I think there are a couple of things missing, ex.:

Several items in Player class:
http://mirrors.kodi.tv/docs/python-docs/...tml#Player

EDIT: Sorry my mistake, didn't properly typed some command. Please ignore this message.
Reply
#32
That is amazing. Thank you so much.

One thing.

Im working with pyxbmct and the import is red. "Unresolved import: pyxbmct"

Maybe its my mistake, but is there someway I can add that to kodistubs too?
Reply
#33
(2016-11-19, 07:41)user5 Wrote: That is amazing. Thank you so much.

One thing.

Im working with pyxbmct and the import is red. "Unresolved import: pyxbmct"

Maybe its my mistake, but is there someway I can add that to kodistubs too?

pyxbmct is a separate library and has nothing to do with Kodistubs. Add pyxbmct to your project's Python dependencies the same way as you do this for Kodistubs.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#34
I just wanted to announce that I pushed to GitHub a totally re-worked version of Kodistubs. The stub files are now generated (indirectly) from Kodi sources so they re-create Kodi Python API as thoroughly as possible. Now Kodistubs also include PEP-484 type annotations that provide information about actual arguments/return values of Kodi Python API functions and methods. Some Python IDE/code editors (e.g. PyCharm) support such type annotations and warn you if you are trying to pass incompatible arguments to functions/methods.

If you previously installed Kodistubs using pip, run pip install --upgrade git+https://github.com/romanvm/Kodistubs.git#egg=Kodistubs to upgrade.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#35
Hi, is it possible to use Kodistubs with VS Code? I've created a virtual environment and installed them through pip but I can't get them to show up.
Reply
#36
@SpAiK Have you selected your virtual environment via VSCode command palette? 

BTW, Kodistubs 18 are almost ready .
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#37
It seems to be working now as I've discovered that I actually was not into the venv because a Powershell run policy that was not executing the activate script.

Now I got all the stuff, although linter is still complaining about import xbmc and xbmcgui (not xbmcaddon):
Image
Reply
#38
@SpAiK You are not using a right version of Python. Currently Kodi provides Python 2.7 interpreter (and 18.x is planned to be the last version with Python 2) so Kodistubs use Python 2 syntax.

@ All

I'm please to announce that Kodistubs v.18.0.0 have been released. They include functions and classes from Kodi 18 "Leia" Python API, including the new xbmcdrm module for interacting with DRM (I don't even know how this works).

To upgrade Kodistubs in your working virtual environment simply run: pip install --upgrade Kodistubs.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#39
Hi,
Quick question
Has anyone mention a syntax error in xbmcgui?

I created a one line bob.py file

import xbmcgui

Ran pylint against it
pylint bob.py

************* Module bob
bob.py:4:0: E0001: Cannot import 'xbmcgui' due to syntax error 'invalid syntax (<unknown>, line 1090)' (syntax-error)
bob.py:4:0: W0611: Unused import xbmcgui (unused-import)

-----------------------------------------------------------------------
Your code has been rated at -50.00/10 (previous run: -16.67/10, -33.33)
Reply
#40
@dsime42 Quick question: have you read 2 posts just above yours?
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
#41
Ignore my post. :-)
I ran it in Python3 and the "0L" returned on line 1090 is no longer valid in Python3 should just be "0"
So it works when run under Python2
Reply
#42
I'm still working with krypton, 17.6. What version of kodistubs do I need to install for that code base?  THANKS!
Reply
#43
17.6 can still be installed with pip install or downloaded from respective tags on GitHub. But v. 17 is missing callback methods for xbmc.Player and xbmcgui.Window classes as a result of a bug in the generator script. It was fixed only in v. 18.
Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
Reply
 
Thread Rating:
  • 2 Vote(s) - 5 Average



Logout Mark Read Team Forum Stats Members Help
Kodistubs (xbmcstubs) - code auto-completion and quick help for Python IDEs52